<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4980628797186804242</id><updated>2012-01-30T22:57:40.696-08:00</updated><category term='Programming'/><title type='text'>Undiscovered Features</title><subtitle type='html'>If it ain't broke, it doesn't have enough features.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-6864305045909618110</id><published>2012-01-30T22:57:00.000-08:00</published><updated>2012-01-30T22:57:40.706-08:00</updated><title type='text'>Manage My MiFi</title><content type='html'>A few months ago I made a&amp;nbsp;&lt;a href="http://www.undiscoveredfeatures.com/2011/08/3g-connectivity-no-data-plan.html" target="_blank"&gt;post&lt;/a&gt;&amp;nbsp;about a m&lt;a href="http://www.truconnect.com/" target="_blank"&gt;obile broadband provider&lt;/a&gt;&amp;nbsp;called Truconnect. &amp;nbsp;They provide mobile access without a set plan or contract. &amp;nbsp;I know the founders personally and after some discussion I proposed an interesting mobile app. &amp;nbsp;I present &lt;a href="http://www.truconnect.com/manage-my-mifi/" target="_blank"&gt;Manage My MiFi&lt;/a&gt;:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-E94J5oE3P0k/TyeLqWLgENI/AAAAAAAAAN4/SW-p7nckKFc/s1600/htc_evo_landscape.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="384" src="http://2.bp.blogspot.com/-E94J5oE3P0k/TyeLqWLgENI/AAAAAAAAAN4/SW-p7nckKFc/s640/htc_evo_landscape.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;One of the big benefits of using Truconnect is only paying for the data I use (see previous post on why a mobile access without a plan is a good thing). &amp;nbsp;Since keeping track of that data usage is crucial, &amp;nbsp;I developed an&amp;nbsp;application for Android and iOS that monitors data usage of a connected MiFi device. &amp;nbsp;I also built a Mac OS X widget. &amp;nbsp;It works well and I use it all the time myself.&lt;br /&gt;&lt;br /&gt;It works with all MiFi devices (made by Novatel) on all major carriers. &amp;nbsp;If anyone is interested in Truconnect service, download the &lt;a href="http://itunes.apple.com/us/app/manage-my-mifi/id492589477" target="_blank"&gt;free&lt;/a&gt; &lt;a href="https://market.android.com/details?id=com.truconnect" target="_blank"&gt;app&lt;/a&gt; to learn more (There will occasionally be a promo code in the app for new customers to use, so check before signing up!).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Technical notes: &amp;nbsp;(for those interested)&lt;br /&gt;&lt;br /&gt;The app was a blast to build. &amp;nbsp;The app concept was conceived just before Christmas and we wanted to launch it in time for CES. &amp;nbsp;That left about a week to develop the application and submit it to the respective app stores. &amp;nbsp;I decided to build on the PhoneGap framework, as that would allow cross platform support with minimal effort. &amp;nbsp;This also made it easy to build a Mac OS X widget. &amp;nbsp;A Windows Gadget shouldn't be too hard either (let me know in the comments if there's an interest in it). &amp;nbsp;I actually did a good portion of the development in the car driving home from a skiing trip to Mammoth Mountain. &amp;nbsp;Surprisingly enough, we got the app finished and approved in time for CES. &amp;nbsp;It was displayed at the TruConnect booth and was featured in a &lt;a href="http://finance.yahoo.com/news/truconnect-app-puts-mifi-users-182400866.html" target="_blank"&gt;press release&lt;/a&gt;. &amp;nbsp;I went down for the last day and it was pretty cool to see something I built on display. &amp;nbsp;Now I want to see people using it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-6864305045909618110?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/6864305045909618110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2012/01/manage-my-mifi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/6864305045909618110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/6864305045909618110'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2012/01/manage-my-mifi.html' title='Manage My MiFi'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-E94J5oE3P0k/TyeLqWLgENI/AAAAAAAAAN4/SW-p7nckKFc/s72-c/htc_evo_landscape.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-4046555502858623497</id><published>2012-01-02T17:49:00.000-08:00</published><updated>2012-01-02T21:22:29.175-08:00</updated><title type='text'>Space Invaders - 2 Player</title><content type='html'>Last semester I took a course on embedded systems. &amp;nbsp;The class revolved around building the classic Space Invaders game. &amp;nbsp;We built the game on the &lt;a href="http://www.digilentinc.com/Products/Detail.cfm?Prod=XUPV2P"&gt;Virtex-II Development Platform&lt;/a&gt;&amp;nbsp;which involves an FPGA with a PowerPC processor. &amp;nbsp;The combination of a "fast enough" processor and an FPGA meant we could do some pretty cool things. &amp;nbsp;We developed some custom hardware to act as a DMA audio controller, for example. &amp;nbsp;One part of the course is a creative assignment, where we were supposed to create a substantial addition to the game. &amp;nbsp;We decided to make it a two player game, but wanted to do a little more hardware development. &amp;nbsp;So we picked up two&lt;a href="http://www.sparkfun.com/products/9582"&gt; RF transceivers&lt;/a&gt;&amp;nbsp;and added wireless communication. &amp;nbsp;Here's the final product:&lt;br /&gt;&lt;br /&gt;&lt;iframe allowfullscreen="" frameborder="0" height="300" mozallowfullscreen="" src="http://player.vimeo.com/video/34487751?title=0&amp;amp;byline=0&amp;amp;portrait=0" webkitallowfullscreen="" width="400"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;a href="http://vimeo.com/34487751"&gt;Space Invaders - 2 Player&lt;/a&gt; from &lt;a href="http://vimeo.com/user9274302"&gt;Peter Hamilton&lt;/a&gt; on &lt;a href="http://vimeo.com/"&gt;Vimeo&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;As you can see, the graphics are pretty good (the video skews them a bit) and the gameplay is very smooth. &amp;nbsp;My friend Jeremy worked hard to make it an exact copy. &amp;nbsp;As far as multiplayer goes, the video explains the additional rules for 2 players. &amp;nbsp;Every time a player kills an alien, there is a 30% chance it reappears on the other persons screen as a yellow alien. &amp;nbsp;When a player shoots a spaceship, a random number of aliens (between 1 and 7), appear on the other players screen. &amp;nbsp;The game state is synced over the wireless connection 10 times a second.&lt;br /&gt;&lt;br /&gt;This turned out to be a blast. &amp;nbsp;It was fun to build and pretty fun to play. &amp;nbsp;It added a very fun competitive element to an a classic game. &amp;nbsp;We actually left it running in the lab for a few weeks and students in the class would frequently challenge each other.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Overall it was a pretty cool project.&lt;br /&gt;&lt;br /&gt;Thanks to Jeremy Mickelson and Jared Pilcher, my lab partners.&lt;br /&gt;&lt;br /&gt;Edit: &lt;a href="http://news.ycombinator.com/item?id=3418292"&gt;Hacker news comments&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-4046555502858623497?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/4046555502858623497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2012/01/space-invaders-2-player.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/4046555502858623497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/4046555502858623497'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2012/01/space-invaders-2-player.html' title='Space Invaders - 2 Player'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-6460646909394464161</id><published>2011-11-13T22:35:00.000-08:00</published><updated>2011-11-15T10:47:26.667-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>Smuggling data in pointers</title><content type='html'>While reading up on&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/ABA_problem"&gt;The ABA Problem&lt;/a&gt;&amp;nbsp;I came across a fantastic hack. &amp;nbsp;The ABA problem, in a nutshell, results from the inability to atomically access both a pointer and a "marked" bit at the same time (read the wikipedia page). &amp;nbsp;One fun, but very hackish solution is to "smuggle" data in a pointer. &amp;nbsp;Example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#include "stdio.h"&lt;br /&gt;void * smuggle(void * ptr, int value){&lt;br /&gt;  return (void *)( (long long)ptr | (value &amp;amp; 3) );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int recoverData(void * ptr){&lt;br /&gt;  return (long long)ptr &amp;amp; 3;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void * recoverPointer(void * ptr){&lt;br /&gt;  return (void *)( (long long)ptr &amp;amp; (~3) );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main(){&lt;br /&gt;  int a = 90;&lt;br /&gt;  int b = 2;&lt;br /&gt;  int * c = &amp;amp;a;&lt;br /&gt;  void * d = smuggle((void *)c, b);&lt;br /&gt;  printf("The value of a is %d\n", *( (int *) recoverPointer(d) ) );&lt;br /&gt;  printf("The value of b is %d\n", recoverData(d) );&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The above code outputs:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;The value of a is 90&lt;br /&gt;The value of b is 2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So what happened?  On a Unix system like OS X or Linux (as well as almost every operating system), memory is aligned to specific addresses.  Since a pointer is nothing more than an address, the alignment has an interesting effect on the value of the pointer.&lt;br /&gt;&lt;br /&gt;If I run the above code, the integer &lt;i&gt;a&lt;/i&gt;&amp;nbsp;has an address of 0x68537518. &amp;nbsp;This isn't set in stone, and will be different each time I run the program. &amp;nbsp;If we look at the addresses in binary it looks like this:&lt;br /&gt;&lt;br /&gt;0110 1000 0101 0011 0111 0101 0001 1000&lt;br /&gt;&lt;br /&gt;Run the code again and we get 0x66601518:&lt;br /&gt;&lt;br /&gt;0110 0110 0110 0000 0001 0101 0001 1000&lt;br /&gt;&lt;br /&gt;If we look at the address of integer &lt;i&gt;b&lt;/i&gt;&amp;nbsp;in the same run we get 0x66601514:&lt;br /&gt;&lt;br /&gt;0110 0110 0110 0000 0001 0101 0001 0100&lt;br /&gt;&lt;br /&gt;There is a lot of similarity in those addresses, but I want to point out the last two binary bits. &amp;nbsp;In all addresses, they are zero. &amp;nbsp;This is because of alignment. &amp;nbsp;The compiler will align the bits so they always start on a value that is a multiple of four, since integers are 4 bytes (32 bits) long. &amp;nbsp;This means all integer addresses will always end in 00.&lt;br /&gt;&lt;br /&gt;So the &lt;i&gt;smuggle &lt;/i&gt;method above takes advantage of that fact. &amp;nbsp;Since we know the values are always going to be 00, we can replace them with an arbitrary value between 0 and 3. &amp;nbsp;When we want to retrieve the smuggled data, we only look at the lowest two bits. &amp;nbsp;When we want to dereference the pointer, we zero those bits out and voila, we have our original address.&lt;br /&gt;&lt;br /&gt;In almost all applications, this would be a pretty useless trick, but in the case of the ABA problem, one can provide a couple of flags in addition to the pointer to better describe the value it is pointing to. &amp;nbsp;This allows instructions such as compare-and-set to atomically access both pieces of data.&lt;br /&gt;&lt;br /&gt;Pretty cool little trick, eh?&lt;br /&gt;&lt;br /&gt;EDIT: &amp;nbsp;After a number of comments condemning this practice, I wanted to state that, for the record, you don't want to do this. &amp;nbsp;There are some corner cases where this is very useful, but generally should be avoided.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-6460646909394464161?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/6460646909394464161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2011/11/smuggling-data-in-pointers.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/6460646909394464161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/6460646909394464161'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2011/11/smuggling-data-in-pointers.html' title='Smuggling data in pointers'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-5703204189501553418</id><published>2011-10-07T12:11:00.000-07:00</published><updated>2011-10-07T12:11:38.505-07:00</updated><title type='text'>Dangerous Roads in Michigan - The iPhone App</title><content type='html'>I recently built a pretty cool little iPhone app for a group in Michigan.  &lt;br /&gt;&lt;br /&gt;Here's their web site:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dangeronourroads.com/"&gt;http://www.dangeronourroads.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here's a news article about it:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.wilx.com/home/headlines/New_Mobile_App_Launched_To_Track_Michigans_Worst_Roads_Bridges_131288459.html"&gt;http://www.wilx.com/home/headlines/New_Mobile_App_Launched_To_Track_Michigans_Worst_Roads_Bridges_131288459.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here's the app in the app store:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://itunes.apple.com/us/app/michigan-danger-on-our-roads/id465543077?mt=8"&gt;http://itunes.apple.com/us/app/michigan-danger-on-our-roads/id465543077?mt=8&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-5703204189501553418?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/5703204189501553418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2011/10/dangerous-roads-in-michigan-iphone-app.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/5703204189501553418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/5703204189501553418'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2011/10/dangerous-roads-in-michigan-iphone-app.html' title='Dangerous Roads in Michigan - The iPhone App'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-320879824536402581</id><published>2011-10-04T10:44:00.000-07:00</published><updated>2011-10-04T10:49:06.337-07:00</updated><title type='text'>New Baby</title><content type='html'>Great news!  I'm a father.  My wife gave birth to our healthy baby boy yesterday.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="https://lh3.googleusercontent.com/-oolLgpuSgdU/TooRZcNTQ1I/AAAAAAAAAH0/X-CHrJGQ1-s/s816/11%2B-%2B1" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="380" src="https://lh3.googleusercontent.com/-oolLgpuSgdU/TooRZcNTQ1I/AAAAAAAAAH0/X-CHrJGQ1-s/s640/11%2B-%2B1" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Since this is a tech blog, I thought I'd post about the script I wrote at 2:30 am.&lt;br /&gt;&lt;br /&gt;My wife wanted me to time her contractions for her. &amp;nbsp;I started using my phone, but soon decided to write a quick program. &amp;nbsp;I wrote the following program in python to keep track of contractions:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://github.com/hamiltop/Contraction-Timer"&gt;https://github.com/hamiltop/Contraction-Timer&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It's a command line utility that works as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Melker:contraction_timer peter$ python timer.py&lt;br /&gt;&lt;br /&gt;Welcome to Contraction Timer.&lt;br /&gt;Any time a contraction either starts or stops, press any key to record it&lt;br /&gt;Press any key to start timing first contraction&lt;br /&gt;&lt;br /&gt;Timing Contraction&lt;br /&gt;&lt;br /&gt;Contraction was 0 minutes and &amp;nbsp;31 seconds long&lt;br /&gt;&lt;br /&gt;Waiting for new contraction to start&lt;br /&gt;&lt;br /&gt;Time between contractions was 0 minutes and 20 seconds long&lt;br /&gt;&lt;br /&gt;Timing Contraction&lt;br /&gt;&lt;br /&gt;Contraction was 1 minutes and &amp;nbsp;4 seconds long&lt;br /&gt;&lt;br /&gt;Waiting for new contraction to start&lt;br /&gt;&lt;br /&gt;Time between contractions was 0 minutes and 5 seconds long&lt;br /&gt;&lt;br /&gt;Timing Contraction&lt;br /&gt;&lt;br /&gt;....&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We didn't get to use it for very long, because labor got really intense and we went into the hospital, but I found the fact I decided to write it while my wife was in labor was amusing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-320879824536402581?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/320879824536402581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2011/10/new-baby.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/320879824536402581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/320879824536402581'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2011/10/new-baby.html' title='New Baby'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh3.googleusercontent.com/-oolLgpuSgdU/TooRZcNTQ1I/AAAAAAAAAH0/X-CHrJGQ1-s/s72-c/11%2B-%2B1' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-6469735245896689955</id><published>2011-09-25T23:05:00.000-07:00</published><updated>2011-09-26T12:28:23.748-07:00</updated><title type='text'>Kelley Blue Book</title><content type='html'>So I'm still passively in the market for a car. &amp;nbsp;I wanted to do some analysis using kbb.com. &amp;nbsp;The problem is that their interface is terrible if you want trend data. &amp;nbsp;I wanted to see the private party "good condition" (the middle 80% range) price for a range of years and a range of mileages. &amp;nbsp;Doing it through the website was painful, so I wrote the following script (Ruby):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;1 require "open-uri"&lt;br /&gt;  2 require "nokogiri"&lt;br /&gt;  3 require "csv"&lt;br /&gt;  4 &lt;br /&gt;  5 years = (2006..2010)&lt;br /&gt;  6 mileages = (0..10).map{ |v| 10000 + v*5000 }&lt;br /&gt;  7 &lt;br /&gt;  8 data = {}&lt;br /&gt;  9 &lt;br /&gt; 10 years.each do |year|&lt;br /&gt; 11   data[year] = {}&lt;br /&gt; 12   mileages.each do |mileage|&lt;br /&gt; 13     sleep 2&lt;br /&gt; 14     doc = Nokogiri::HTML(open("http://www.kbb.com/mazda/mazda5/#{year}-mazda-mazda5/sport-minivan-4d/?pricetype=private-party&amp;amp;anchor=true&amp;amp;mileage=#{mileage}"))&lt;br /&gt; 15     data[year][mileage] = doc.css(".good-value .value").text&lt;br /&gt; 16     puts "year: #{year} mileage: #{mileage} value: #{data[year][mileage]}"&lt;br /&gt; 17   end&lt;br /&gt; 18 end&lt;br /&gt; 19 &lt;br /&gt; 20 CSV.open("mazda5.csv", "w") do |csv|&lt;br /&gt; 21   csv &amp;lt;&amp;lt; [""].concat(years.to_a)&lt;br /&gt; 22   mileages.each do |mileage|&lt;br /&gt; 23     csv &amp;lt;&amp;lt; [mileage].concat(data.values.map{ |y| y[mileage] })&lt;br /&gt; 24   end&lt;br /&gt; 25 end&lt;/pre&gt;&lt;br /&gt;This produced a nice spreadsheet file and then I created the following chart (y axis is cost, x axis is mileage):&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-n4zXmcqCb6c/ToALr1IR5BI/AAAAAAAAAHk/1XCIEanQD8U/s1600/chart_1+%25281%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-n4zXmcqCb6c/ToALr1IR5BI/AAAAAAAAAHk/1XCIEanQD8U/s1600/chart_1+%25281%2529.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Interesting observations:&lt;br /&gt;&lt;br /&gt;The car seems to depreciate at the same rate with respect to miles, regardless of the year. &amp;nbsp;(ie, the slope of the lines are all about the same)&lt;br /&gt;&lt;br /&gt;The car seems to depreciate at about the same rate with respect to time for the first few years. &amp;nbsp;(ie, the space between lines is constant for 2010,2009,2008)&lt;br /&gt;&lt;br /&gt;There is a big drop in value between 2008 and 2007 models, and a slightly smaller gap between 2007 and 2006 models.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Conclusions:&lt;br /&gt;&lt;br /&gt;1) &amp;nbsp;I like ruby. &amp;nbsp;The library I used, nokogiri, is great. &amp;nbsp;I've tried some python libraries, like beautiful soup and lxml, but none are as succinct as nokogiri, especially when it comes to css selectors.&lt;br /&gt;2) &amp;nbsp;I find it interesting that there is such a sharp drop between 2008 and 2007. &amp;nbsp;I always thought the car dropped in value more during the first 3 years than in years 4-8.&lt;br /&gt;3) &amp;nbsp;In the first three years, depreciation is about $500/year and $500/10k miles. &amp;nbsp;So if trends continued, you could buy a 2010 and sell the car after 2 years and 20k for 2000 less than you bought it for.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-6469735245896689955?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/6469735245896689955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2011/09/kelly-blue-book.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/6469735245896689955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/6469735245896689955'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2011/09/kelly-blue-book.html' title='Kelley Blue Book'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-n4zXmcqCb6c/ToALr1IR5BI/AAAAAAAAAHk/1XCIEanQD8U/s72-c/chart_1+%25281%2529.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-4587487423731385518</id><published>2011-08-03T07:54:00.000-07:00</published><updated>2011-08-03T07:54:26.198-07:00</updated><title type='text'>3G Connectivity – No Data Plan</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: collapse; color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;&amp;lt;TLDR below&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;Being the somewhat connected guy that I am, I am always looking for a way to get mobile access to the internet without having to donate a pint of blood at the same time.&amp;nbsp;&amp;nbsp; Most of the time I am on my home, school or office Wifi network, but occasionally I could use a mobile connection. &amp;nbsp;When I say occasionally, I mean the once or twice a year I actually go somewhere. &amp;nbsp;A 10 hour drive from Utah to LA is a pretty big time sink. &amp;nbsp;One such trip, I borrowed my fathers mobile broadband card and put in a good 4-5 hours of web development. &amp;nbsp;On such an occasion, I would easily pay the 45 bucks/month for the mobile broadband but as I said, that's only an occasional thing. &amp;nbsp;For most months, that would be a waste of money.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;I've looked at various pay as you go mobile broadband plans, but they are always so gimmicky. Plans like 10 bucks for 10 days totaling 100 MB. &amp;nbsp;I'm not even sure what that means, to be honest. &amp;nbsp;Do I get to pick the 10 days?&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;I came across a company called &lt;a href="http://www.truconnect.com/"&gt;TruConnect&lt;/a&gt; that does have a “pay as you go” pricing scheme.&amp;nbsp;&amp;nbsp; For a pretty reasonable monthly access fee of $4.99 , you can connect anywhere and anytime and then just pay for actual usage at 3.9 cents a megabyte.&amp;nbsp;&amp;nbsp; So 200 MB (which is enough for anything except Netflix) for about $8. &amp;nbsp;That's cheap enough that I can keep a device with me in my bag and use it when I need to.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: arial, sans-serif; font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;They offer two different devices: a USB stick for laptops or a MiFi mobile hotspot for tablets or laptops.&amp;nbsp;&amp;nbsp; The MiFi is your usual run of the mill device. &amp;nbsp;(It lets you connect several Wifi devices to a mobile hotspot that you create on the fly).&amp;nbsp; &amp;nbsp;The 3G service itself is really pretty zippy – no problems with email or surfing the web.&amp;nbsp;&amp;nbsp; I've used it with tablet, laptops, even my desktop when my internet wasn't working. &amp;nbsp;It worked fine – no problems. &amp;nbsp;The devices are not subsidized, as you aren't locked into a contract, but they are very reasonably priced. &amp;nbsp;$69.99 for the USB and $89.99 for the MiFi&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Interesting Applications:&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;The obvious use case is pretty great. &amp;nbsp;It's a cheap way for me to have inexpensive internet on the go. &amp;nbsp;But what really intrigues me is the couple of MB a month applications. &amp;nbsp;I plugged my USB 3g device into a Beagle Board (3" by 3" ARM based computer) and was able to connect it up to the internet and suddenly my embedded projects are 3g enabled. &amp;nbsp;I can keep the machine on and run a ssh (remote login) server on it at just under 1 MB/day. &amp;nbsp;For around 6 bucks a month I can put that device anywhere and still have access to it. &amp;nbsp;Other interesting applications:&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Car computer - GPS navigation, Pandora (at ~ 1 MB/minute, not the cheapest solution, but still not terrible)&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Shared office plan - Since there's no plan, the device isn't tied to anyone in particular. &amp;nbsp;Keep 2 or 3 available in the office for anyone travelling.&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Tablet/iPod Touch - Add 3g access to a mobile device.&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Anyone got any good ideas? &amp;nbsp;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&amp;lt;TLDR&amp;gt; &lt;a href="http://www.truconnect.com/"&gt;TruConnect&lt;/a&gt;&amp;nbsp;offers a cheap 3g mobile broadband plan. &amp;nbsp;It's a pay-as-you-go model, (with a $4.99/month "keep my device active" fee), at 3.9 cents/MB with no contracts or commitments of any kind.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-4587487423731385518?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/4587487423731385518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2011/08/3g-connectivity-no-data-plan.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/4587487423731385518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/4587487423731385518'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2011/08/3g-connectivity-no-data-plan.html' title='3G Connectivity – No Data Plan'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-5286893448703506417</id><published>2011-06-21T23:59:00.000-07:00</published><updated>2011-06-22T07:23:42.217-07:00</updated><title type='text'>Bitcoin - A decentralized economy</title><content type='html'>So those embedded in the hacker/nerd industry have probably heard about something called Bitcoin. &amp;nbsp;Here's the standard video presentation on what bitcoin is:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://2.gvt0.com/vi/Um63OQz3bjo/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Um63OQz3bjo&amp;fs=1&amp;source=uds" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266"  src="http://www.youtube.com/v/Um63OQz3bjo&amp;fs=1&amp;source=uds" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;So what's my take on bitcoin? &lt;br /&gt;&lt;br /&gt;Bitcoin as a currency:&lt;br /&gt;&lt;br /&gt;First off, it is really easy to use. &amp;nbsp;I bought some computer parts with bitcoin last week. &amp;nbsp;I ordered them from cablesaurus.com, chose Bitcoin as my payment method. &amp;nbsp;They sent me an email with a bitcoin address and an amount. &amp;nbsp;I sent it and they shipped the item. &amp;nbsp;Very simple. &amp;nbsp;No seller fees. &amp;nbsp;Easy to keep track of on the selling end - the address I sent to was unique and only used for my transaction. &amp;nbsp;It's essentially online cash. &amp;nbsp;No rolling back transactions. &amp;nbsp;It's difficult to trace who spent it. &lt;br /&gt;&lt;br /&gt;Bitcoin mining:&lt;br /&gt;&lt;br /&gt;I have a "mining rig" as they call it, and it generates around 0.2 BTC (bitcoins) per day. &amp;nbsp;I have a program that I leave running 24/7. &amp;nbsp;0.2 BTC is not that much, but my total hardware cost was around 150 bucks. &amp;nbsp;At the current exchange rate ( it's been floating around $15 per BTC,) that's about 10 bitcoins. &amp;nbsp;So far I've mined ~ 3.50 BTC. &amp;nbsp;In about a month I'll have paid off the rest of my hardware. &amp;nbsp;There are a few other costs in there. &amp;nbsp;The electricity required to run my computer for a month is about 144 kWhrs. &amp;nbsp;At $0.07 per kWhr (Idaho is cheap... I love it,) &amp;nbsp;that's an extra 10 bucks a month in overhead, which is low enough to still make bitcoin profitable. &amp;nbsp;I'm just a hobbyist miner. &amp;nbsp;I do it because I find the concept intriguing, not because I'm trying to make a big profit. &amp;nbsp;Some people do try to make significant profits and have rigs that generate 100 times what I do. &amp;nbsp;One person I know personally mines around 200-300 coins a month, or $3,000-$5,000 worth of BTC. &amp;nbsp;Not enough to quit your day job, but not too bad for just letting hardware run.&lt;br /&gt;&lt;br /&gt;Future as a currency:&lt;br /&gt;&lt;br /&gt;In the past month, the bitcoin exchange has been pretty crazy. &amp;nbsp;It went from $1 a few months ago to $30/BTC in early June. &amp;nbsp;It then crashed down to $10, and has been stabilizing between 15 and 20. &amp;nbsp;Then this last weekend one of the main exchanges was hacked and all sorts of crazy stuff happened. &amp;nbsp;Bitcoin has gotten its fair share of press coverage. &amp;nbsp;A couple of US Senators have labeled it as a money laundering ploy and a vehicle for drug trafficking. &amp;nbsp;If it survives the next few months I think it may stick around.&lt;br /&gt;&lt;br /&gt;One interesting use that is emerging is online tip jars. &amp;nbsp;A few communities have emerged where it is customary to tip a blog writer a fraction of a coin if you found the article interesting. &amp;nbsp;With no transaction fees, leaving the equivalent of a nickel in a virtual tip jar is quite simple. &amp;nbsp;A blog with 1000 readers can make a couple of bucks if people tipped a few thousandths of a bitcoin each. &lt;br /&gt;&lt;br /&gt;I'm not sure where it's ultimately going, but I find it to be a really interesting economic microcosm. &amp;nbsp;Since nobody is in charge, it ends up being a very interesting demonstration in economics, both macro and micro. &amp;nbsp;I expect to have my mining costs paid off soon, and if they don't I think I've made enough to clear any losses when I sell my equipment on craigslist (it is all high end computer gaming equipment, so it shouldn't be too hard to sell).&lt;br /&gt;&lt;br /&gt;I could go into much more detail on technical side of things. &amp;nbsp;It's a pretty intricate and complicated system. &amp;nbsp;Pretty genius in my opinion. &amp;nbsp;It will be interesting to see how things play out.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Comments? &amp;nbsp;Questions?&lt;br /&gt;&lt;br /&gt;Donations? &amp;nbsp;Bitcoin: &amp;nbsp;1J7meb6uwvKEjQrabtNVBqVS9nrF8TxpuT&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-5286893448703506417?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/5286893448703506417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2011/06/bitcoin-decentralized-economy.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/5286893448703506417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/5286893448703506417'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2011/06/bitcoin-decentralized-economy.html' title='Bitcoin - A decentralized economy'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-5463247100898163807</id><published>2011-05-25T22:42:00.000-07:00</published><updated>2011-05-26T19:49:58.229-07:00</updated><title type='text'>Solid State Drives</title><content type='html'>I'm spending this summer working as an intern for Micron in the Solid State Drive Product Engineering group. &amp;nbsp;I'm working on some interesting things that haven't come to market yet. &amp;nbsp;Since I've been here, I've talked to a few friends who don't know much about SSDs. &amp;nbsp;Here are a few questions with answers. &amp;nbsp;There's nothing here that you couldn't find by searching around.&lt;br /&gt;&lt;br /&gt;1) &amp;nbsp;Are SSDs as reliable as traditional hard drives?&lt;br /&gt;&lt;br /&gt;While I can't make any blanket statements, here are a few points to consider. &amp;nbsp;SSDs contain no mechanical parts. &amp;nbsp;Traditional hard drives have motors and spin and things move around. &amp;nbsp;If a tiny component were to break, you would hear a wonderful clicking noise before seeing the "Blue Screen of Death". &amp;nbsp;SSDs do not suffer from the same problems.&lt;br /&gt;&lt;br /&gt;2) &amp;nbsp;Do SSDs wear out faster than traditional hard drives?&lt;br /&gt;&lt;br /&gt;Not all SSDs are created equal. &amp;nbsp;Because SSDs use flash memory, there is a limited number of times each block can be erase and rewritten. &amp;nbsp;This varies greatly from 3k writes to 100k writes. &amp;nbsp;But even at 3k writes, that means that you can erase and rewrite the entire drive 3 thousand times before it fails. &amp;nbsp;On a 64GB drive, that means you will write 192 TB of data, or 100 GB a day (more than the entire drive) for the next 5 years. &amp;nbsp;One concern is if you rewrite a single file more than 3k times. &amp;nbsp;Most SSDs are smart enough to "share the wealth" and move that file around so it wears the drive out evenly. &amp;nbsp;Think of it like rotating your cars tires. &amp;nbsp;Since not all SSDs are created equally, do a little research into the life of the drive. &amp;nbsp;Most manufacturers release that information (Micron does).&lt;br /&gt;&lt;br /&gt;3) &amp;nbsp;SSDs are really expensive. &amp;nbsp;Do they really make a difference?&lt;br /&gt;&lt;br /&gt;According to many benchmarks I've seen, a good SSD will speed up your random file access something like a half second. &amp;nbsp;Not much on paper. &amp;nbsp;But in actual use, that half second makes a lot of difference. &amp;nbsp;Many people say that an SSD is not something you notice being there, but you definitely notice when it's not. &amp;nbsp;With an SSD, opening an application is practically instantaneous. &amp;nbsp;Reboots take 20 seconds. &amp;nbsp;Everything just feels so much snappier. &amp;nbsp;There's a reason so many people have said that an SSD is the best&amp;nbsp;available&amp;nbsp;upgrade to your computer.&lt;br /&gt;&lt;br /&gt;If anyone has other questions, just ask in the comments.&lt;br /&gt;&lt;br /&gt;I'm having a blast. &amp;nbsp;There's a lot of cool stuff going on under the hood. &amp;nbsp;Micron is unique in that they are one of the few companies who manufacture their own memory. &amp;nbsp;This lets us do some cool things most other SSD companies can't do. &amp;nbsp;Cool stuff on the horizon.&lt;br /&gt;&lt;br /&gt;UPDATE:&lt;br /&gt;I figured it would be cool to post the drives I'm working with:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/Crucial-CT256M4SSD2-256GB-SSD-SATA/dp/B004W2JL2A?ie=UTF8&amp;amp;tag=undiscover-20&amp;amp;link_code=bil&amp;amp;camp=213689&amp;amp;creative=392969" imageanchor="1" target="_blank"&gt;&lt;img alt="Crucial CT256M4SSD2 256GB M4 SSD 2.5&amp;quot; SATA III" src="http://ws.amazon.com/widgets/q?MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;ID=AsinImage&amp;amp;WS=1&amp;amp;Format=_SL160_&amp;amp;ASIN=B004W2JL2A&amp;amp;tag=undiscover-20" /&gt;&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=undiscover-20&amp;amp;l=bil&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B004W2JL2A" style="border: none !important; margin: 0px !important; padding: 0px !important;" width="1" /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/Lexar-Media-Crucial-2-5-Inch-CT512M4SSD2/dp/B004W2JL3Y?ie=UTF8&amp;amp;tag=undiscover-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969" target="_blank"&gt;Crucial 512 GB m4 2.5-Inch Solid State Drive SATA 6Gb/s&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=undiscover-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B004W2JL3Y" style="border: none !important; margin: 0px !important; padding: 0px !important;" width="1" /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/Crucial-CT256M4SSD2-256GB-SSD-SATA/dp/B004W2JL2A?ie=UTF8&amp;amp;tag=undiscover-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969" target="_blank"&gt;Crucial 256 GB m4 2.5-Inch Solid State Drive SATA 6Gb/s&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=undiscover-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B004W2JL2A" style="border: none !important; margin: 0px !important; padding: 0px !important;" width="1" /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/Lexar-Media-Crucial-2-5-Inch-CT128M4SSD2/dp/B004W2JKZI?ie=UTF8&amp;amp;tag=undiscover-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969" target="_blank"&gt;Crucial 128 GB m4 2.5-Inch Solid State Drive SATA 6Gb/s&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=undiscover-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B004W2JKZI" style="border: none !important; margin: 0px !important; padding: 0px !important;" width="1" /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/Lexar-Media-Crucial-64-2-5-Inch-CT064M4SSD2/dp/B004W2JKWG?ie=UTF8&amp;amp;tag=undiscover-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969" target="_blank"&gt;Crucial 64 GB m4 2.5-Inch Solid State Drive SATA 6Gb/s&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=undiscover-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B004W2JKWG" style="border: none !important; margin: 0px !important; padding: 0px !important;" width="1" /&gt;&lt;br /&gt;&lt;br /&gt;Those are the new models that just launched last month. (That 512 GB is expensive, I know)&lt;br /&gt;&lt;br /&gt;These are the last generation of drives. &amp;nbsp;Still very fast. &amp;nbsp;They've got a lot of great reviews, which is why I'm linking to them.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/Crucial-Technology-RealSSD-Solid-CTFDDAC256MAG-1G1/dp/B0039SM0B2?ie=UTF8&amp;amp;tag=undiscover-20&amp;amp;link_code=bil&amp;amp;camp=213689&amp;amp;creative=392969" imageanchor="1" target="_blank"&gt;&lt;img alt="Crucial Technology 256 GB Crucial RealSSD C300 Series Solid State Drive CTFDDAC256MAG-1G1" src="http://ws.amazon.com/widgets/q?MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;ID=AsinImage&amp;amp;WS=1&amp;amp;Format=_SL160_&amp;amp;ASIN=B0039SM0B2&amp;amp;tag=undiscover-20" /&gt;&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=undiscover-20&amp;amp;l=bil&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B0039SM0B2" style="border: none !important; margin: 0px !important; padding: 0px !important;" width="1" /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/Crucial-Technology-RealSSD-Solid-CTFDDAC256MAG-1G1/dp/B0039SM0B2?ie=UTF8&amp;amp;tag=undiscover-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969" target="_blank"&gt;Crucial Technology 256 GB Crucial RealSSD C300 Series Solid State Drive&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=undiscover-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B0039SM0B2" style="border: none !important; margin: 0px !important; padding: 0px !important;" width="1" /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/Crucial-Technology-RealSSD-Solid-CTFDDAC128MAG-1G1/dp/B0039SM0AS?ie=UTF8&amp;amp;tag=undiscover-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969" target="_blank"&gt;Crucial Technology 128 GB Crucial RealSSD C300 Series Solid State Drive&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=undiscover-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B0039SM0AS" style="border: none !important; margin: 0px !important; padding: 0px !important;" width="1" /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/Crucial-RealSSD-2-5-Inch-Transfer-CTFDDAC064MAG-1G1CCA/dp/B003YNX3TU?ie=UTF8&amp;amp;tag=undiscover-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969" target="_blank"&gt;Crucial Technology 64 GB Crucial RealSSD C300 Series Solid State Drive&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=undiscover-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B003YNX3TU" style="border: none !important; margin: 0px !important; padding: 0px !important;" width="1" /&gt;&lt;br /&gt;&lt;br /&gt;Also, I should probably make some sort of disclaimer. &amp;nbsp;I work for Micron. &amp;nbsp;This blog is in no way affiliated with Micron. &amp;nbsp;The views expressed here are my own and do not represent Micron in any way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-5463247100898163807?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/5463247100898163807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2011/05/solid-state-drives.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/5463247100898163807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/5463247100898163807'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2011/05/solid-state-drives.html' title='Solid State Drives'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-3516643660239852153</id><published>2011-04-19T01:03:00.000-07:00</published><updated>2011-04-19T01:03:23.978-07:00</updated><title type='text'>Transformation</title><content type='html'>I took the second half of the History of Creativity course this semester. &amp;nbsp;For the first half my project was the Park in the Shade app described in previous blog posts. &amp;nbsp;(&lt;a href="http://www.undiscoveredfeatures.com/2010/08/park-in-shade.html"&gt;here&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="http://www.undiscoveredfeatures.com/2010/09/park-in-shade-iphone.html"&gt;here&lt;/a&gt;). &amp;nbsp;This time around I wanted to make something a little less useful, a little more "creative".&lt;br /&gt;&lt;br /&gt;One Electrical Engineering class I took this semester focused on various transformations. &amp;nbsp;These are extremely useful because they &amp;nbsp;make it possible for engineers like me to build things like MP3 players and stuff. &amp;nbsp;The idea is that by doing some clever math, suddenly we have a signal (like a sound wave) in a new domain, which let's use do even more clever math. &amp;nbsp;Lot's of clever math, &amp;nbsp;We actually use imaginary numbers a lot here. &amp;nbsp;By imaginary numbers i mean sqrt(-1) and such, not numbers like eleventy billion as my wife believes. &amp;nbsp;But the end result is that you can carry a little device in your pocket that can recreate a sound wave almost perfectly. &amp;nbsp;Cool stuff.&lt;br /&gt;&lt;br /&gt;So I decided to create an art piece called Transformation. &amp;nbsp;I started with this image:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-BbR66SAibjU/Ta09O30Jo_I/AAAAAAAAACU/tFr8e8kXXOo/s1600/jimmer.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://2.bp.blogspot.com/-BbR66SAibjU/Ta09O30Jo_I/AAAAAAAAACU/tFr8e8kXXOo/s200/jimmer.bmp" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I then did a few simple things to it. &amp;nbsp;First, I shrunk it down from 100x100 pixels to 20x20. &amp;nbsp;100x100 was just too big to work with.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Q1LIgqvQnco/Ta09eB9IX1I/AAAAAAAAACY/RY6BHVr6cI8/s1600/jimmer_20x20.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://2.bp.blogspot.com/-Q1LIgqvQnco/Ta09eB9IX1I/AAAAAAAAACY/RY6BHVr6cI8/s200/jimmer_20x20.bmp" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Now it looked grainy and course, but you could still see what it was. &amp;nbsp;Then I converted it to Grayscale.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-ccgrX6veDh8/Ta09y1HZXtI/AAAAAAAAACc/Ky7ckOvOqc8/s1600/jimmer_20x20_L.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://3.bp.blogspot.com/-ccgrX6veDh8/Ta09y1HZXtI/AAAAAAAAACc/Ky7ckOvOqc8/s200/jimmer_20x20_L.bmp" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Once it was in grayscale, it meant I had 400 values (20x20 pixels), with each value represented as a number between 0 (black) and 255 (white). &amp;nbsp;I quantized these values, essentially rounding them down to the nearest 20. &amp;nbsp;So values between 0 and 19 would get 0. &amp;nbsp;Values between 20 and 39 would get 20. &amp;nbsp;And so on. &amp;nbsp;So instead of 255 possible values, I only had 13 values, in steps of 20. &amp;nbsp;This didn't have a huge effect, as you can see, but it helped with my final step.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-qWkg91zYWJQ/Ta0-Uvez84I/AAAAAAAAACg/33xwPd6g4aA/s1600/jimmer_20x20_L_downsampled.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://3.bp.blogspot.com/-qWkg91zYWJQ/Ta0-Uvez84I/AAAAAAAAACg/33xwPd6g4aA/s200/jimmer_20x20_L_downsampled.bmp" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;For my final step, I took the values from the above image, and converted them to depth in a 3D model. &amp;nbsp;I wrote a clever little script that output this grid:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;02 01 00 03 06 04 03 02 00 00 00 00 05 02 01 01 00 00 01 02&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;08 01 01 02 02 02 02 03 01 00 00 02 03 03 03 03 01 00 01 02&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;02 02 02 01 02 01 07 08 08 08 08 03 01 03 03 02 03 00 00 01&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;01 02 02 03 01 06 08 07 07 07 07 07 06 05 01 01 03 05 01 02&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;01 05 03 03 04 07 06 06 07 07 06 07 07 09 01 01 01 03 02 03&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;01 03 03 05 05 05 04 02 05 03 05 07 02 04 10 01 03 05 01 02&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;04 01 03 03 04 04 04 05 06 04 05 06 03 04 07 09 06 01 01 02&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;04 03 06 05 03 09 01 02 06 05 05 04 06 07 06 07 10 08 01 00&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;01 01 04 06 12 10 09 08 02 04 04 03 02 01 04 04 07 09 09 06&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;02 02 01 06 10 09 07 07 08 04 05 02 01 05 04 08 08 08 10 10&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;05 02 02 10 11 07 04 04 05 02 08 06 08 06 03 04 06 07 09 10&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;07 08 11 10 10 04 03 01 05 03 06 10 05 09 00 06 03 06 08 09&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;05 10 09 10 09 02 02 04 04 01 11 03 09 09 01 03 03 05 07 08&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;06 09 10 10 00 00 03 00 04 03 09 00 10 09 09 04 03 03 04 07&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;10 09 09 09 00 00 00 00 03 05 10 09 09 09 05 02 07 06 09 08&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;07 09 10 10 11 12 00 01 00 01 07 06 07 08 02 04 06 08 07 08&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;07 07 10 10 09 10 10 12 09 12 12 09 10 09 05 05 10 08 08 08&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;07 08 08 09 08 09 11 12 12 12 11 12 12 12 12 09 08 07 08 08&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;04 03 09 08 05 11 11 05 07 08 12 04 01 10 11 10 07 07 08 09&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;04 04 07 07 03 11 11 12 05 07 09 04 03 09 11 11 04 05 08 00&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Each number above corresponds to the length of a wooden dowel. &amp;nbsp;The measurements are in quarter inches, so a 10 would mean 2 1/2 inches, a 12 would mean 3 inches, etc. &amp;nbsp;Once I had the grid laid out for me, I assembled the dowels that I had cut. &amp;nbsp;The final result was this:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-3ObGweTYdJA/Ta0_cqP2stI/AAAAAAAAACk/1X4IcWPHhCE/s1600/IMAG0009.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="237" src="http://3.bp.blogspot.com/-3ObGweTYdJA/Ta0_cqP2stI/AAAAAAAAACk/1X4IcWPHhCE/s400/IMAG0009.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;It's hard to show it in a photo, but it was amazing how well this process created a 3D model from a 2D image. &amp;nbsp;His arms and head are clear enough. &amp;nbsp;His eyes and mouth are pretty clear as well. &amp;nbsp;There are a few interesting artifacts. &amp;nbsp;In the top left corner, there's a random dowel sticking out. &amp;nbsp;If you look in the original image, there's a fan in that corner wearing a white shirt. &amp;nbsp;Jimmer's hair, since it's darker than his face, seems to disappear. &amp;nbsp;But overall, shape seems to be kept intact.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;It was a fun little project. &amp;nbsp;Not all that useful, but interesting nonetheless. &amp;nbsp;It would be cool to use my script to produce a little finer image. &amp;nbsp;Maybe use a 3D printer like a&amp;nbsp;&lt;a href="http://reprap.org/wiki/Main_Page"&gt;RepRap&lt;/a&gt;, so I could keep the image at full resolution. &amp;nbsp;I shrunk the image down to 20x20 because even then I had to cut and assemble 400 dowels. &amp;nbsp;At full resolution that would have been 10,000. &amp;nbsp;With a RepRap, I wouldn't have to care. &amp;nbsp;It would take a bit longer to print, but that's not a big deal.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Anyone else got any interesting applications / improvements?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-3516643660239852153?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/3516643660239852153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2011/04/transformation.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/3516643660239852153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/3516643660239852153'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2011/04/transformation.html' title='Transformation'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-BbR66SAibjU/Ta09O30Jo_I/AAAAAAAAACU/tFr8e8kXXOo/s72-c/jimmer.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-3847067869481320761</id><published>2011-03-07T00:42:00.000-08:00</published><updated>2011-03-07T00:46:22.474-08:00</updated><title type='text'>Finance or Pay Cash</title><content type='html'>So, my wife and I are looking at buying a new car about 6 months from now. &amp;nbsp;We've started crunching numbers to see what we can afford and plan to pay cash.&lt;br /&gt;&lt;br /&gt;A while back, I heard a strategy when buying a car. &amp;nbsp;Instead of paying cash, try to get a loan with a low interest rate. &amp;nbsp;If you are able to get a low enough rate, it can be profitable to take the loan and invest the cash you have saved up. &amp;nbsp;At the end of the loan period, you will have made more interest on the cash you had saved than you paid on the loan.&lt;br /&gt;&lt;br /&gt;Sounds like a good, sophisticated, "I understand opportunity cost", economic approach. &amp;nbsp;Professor James Kearl (of BYU's infamous Econ 110 class) would be proud.&lt;br /&gt;&lt;br /&gt;Then I took a closer look at the numbers, and discovered a flaw in the argument:&lt;br /&gt;&lt;br /&gt;Assumptions:&lt;br /&gt;&lt;br /&gt;Car costs $20,000&lt;br /&gt;The load period is 5 years&lt;br /&gt;The loan interest rate is 5%&lt;br /&gt;The investment interest rate is guaranteed at 6% &amp;nbsp;(after taxes, etc.)&lt;br /&gt;&lt;br /&gt;So the blind calculations are (after 5 years):&lt;br /&gt;&lt;br /&gt;Total cost of loan (principle + interest): &amp;nbsp;$22,645.48&lt;br /&gt;Total value of investment (principle + interest): &amp;nbsp;$26,977.00&lt;br /&gt;&lt;br /&gt;So theoretically we make ~$4,300 by being smart. &amp;nbsp;"Self, Great Day!"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;PROBLEM: &amp;nbsp;The argument forgot about the monthly payment. &amp;nbsp;It needs to come from somewhere. &amp;nbsp;Here's the breakdown:&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Assuming no other income, we must make the monthly payment from our investment. &amp;nbsp;The payment is $377.42/month.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;The total cost of the loan is the same, but the total value of the investment takes a hit, as the principle decreases (and with it the interest amount earned) each month.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;If we do the math, after making the final payment, we are left with $512.74 in our account.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Not too bad still. &amp;nbsp;We make 500 bucks. &amp;nbsp;"Self, Not-too-shabby day!"&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;I decided to explore the case where we have a monthly income. &amp;nbsp;Let's say we have a monthly income surplus of exactly $377.42/month, allowing us to make the monthly payment without affecting our investment. &amp;nbsp;Sounds great! &amp;nbsp;We pay a total of&amp;nbsp;$22,645.48 and have $26,977.00 in our investment. &amp;nbsp;We make ~$4,300!&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;ALTERNATIVE: &amp;nbsp;What if we paid cash, and decided to invest that $377.42/month instead. &amp;nbsp;So we would empty our investment by paying cash, and instead of paying a monthly payment to the bank, we would use it to replenish our investment. &amp;nbsp;So at the end of 5 years:&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Total paid for car: &amp;nbsp;$20,000.00&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Total in investment: $26,464.27&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Total gain: &amp;nbsp;$6,464.27 &amp;nbsp;"Self, &amp;nbsp;Great day!!!!!!!!!"&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;So in conclusion, taking the loan and investing the cash appears to not be such a great deal after all. &amp;nbsp;It only seems to make sense if you are &amp;nbsp;(1) expecting no additional income during the loan and (2) guaranteed a high enough interest rate on your investment. &amp;nbsp;Even then it's only a difference of $500. &amp;nbsp;Not sure if that's enough to offset the risk of something going wrong. &amp;nbsp;If you expect to have enough income to make the monthly payments from your surplus, then it is much better to pay in cash upfront and invest the monthly payment amount. &amp;nbsp;It requires diligence, but clearly pays off.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Did I miss anything? &amp;nbsp;The assumptions I made may not be very realistic, but I think they are generous enough to show a favorable, yet possible scenario. &amp;nbsp;If things were more generous (like an interest rate of 10% on the investment) then perhaps the numbers would change.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Thoughts? &amp;nbsp;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-3847067869481320761?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/3847067869481320761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2011/03/finance-or-pay-cash.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/3847067869481320761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/3847067869481320761'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2011/03/finance-or-pay-cash.html' title='Finance or Pay Cash'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-6238795972457181282</id><published>2011-02-15T23:25:00.000-08:00</published><updated>2011-02-15T23:25:53.162-08:00</updated><title type='text'>HD antenna</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;Building an HD antenna has been on my Todo list for a while. &amp;nbsp;Apparently there are a bunch of HD channels freely available for anyone with an HD tuner. &amp;nbsp;I had always planned on following &lt;a href="http://blog.makezine.com/archive/2009/01/maker-workshop-dtv-antenna-steadyca.html"&gt;this guide&lt;/a&gt;,&amp;nbsp;but today I came across &lt;a href="http://blamcast.net/articles/how-to-make-an-hdtv-antenna"&gt;this blog post&lt;/a&gt;. &amp;nbsp; The guy made an antenna out of some wire and a paper towel roll! &amp;nbsp;"I've gotta try this" was my response. &amp;nbsp;30 minutes later (It took some adjusting to get right), I had 16 channels, 3 (NBC, ABC, and CBS) were in HD. &amp;nbsp;Crystal clear HD. &amp;nbsp;Much clearer than the cable that comes with the apartment. &amp;nbsp;I also get Universal Sport, which I've now discovered carries exclusively skiing during the wintertime. &amp;nbsp;All for free!&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Here's my paper towel roll by our window.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-AHRXS7Q051Y/TVt4njjJkGI/AAAAAAAAAB0/dn4b0bbT2GA/s1600/CIMG0010.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-AHRXS7Q051Y/TVt4njjJkGI/AAAAAAAAAB0/dn4b0bbT2GA/s320/CIMG0010.jpg" width="239" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The original poster just plugged his cable directly into the TV (look at his post... it's kinda funny). &amp;nbsp;I did that originally, but found it to be a little too finicky. &amp;nbsp;So I used some alligator clips to connect my wire to a coax cable that I plugged into the TV.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-u4ohKz-fp7E/TVt4ouFatDI/AAAAAAAAAB4/biyEPXkOPzQ/s1600/CIMG0011.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="239" src="http://1.bp.blogspot.com/-u4ohKz-fp7E/TVt4ouFatDI/AAAAAAAAAB4/biyEPXkOPzQ/s320/CIMG0011.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-P69g4ckeW1c/TVt4pDCuDFI/AAAAAAAAAB8/V4urA80K_Ck/s1600/CIMG0012.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="239" src="http://3.bp.blogspot.com/-P69g4ckeW1c/TVt4pDCuDFI/AAAAAAAAAB8/V4urA80K_Ck/s320/CIMG0012.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;I'm amazed at how well this works. &amp;nbsp;Above all I'm amazed that free over the air channels are higher quality than non digital cable. &amp;nbsp;Since we get NBC (translation: &amp;nbsp;The Office, Community, Parks and Recreation, and 30 Rock) &amp;nbsp;I doubt I'll be plugging our cable connection back in anytime soon. &amp;nbsp;I will probably build the nicer hanger version, as the cardboard tube needs to be set up "just right" for it to work, but I'm impressed nonetheless.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-6238795972457181282?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/6238795972457181282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2011/02/hd-antenna.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/6238795972457181282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/6238795972457181282'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2011/02/hd-antenna.html' title='HD antenna'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-AHRXS7Q051Y/TVt4njjJkGI/AAAAAAAAAB0/dn4b0bbT2GA/s72-c/CIMG0010.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-496468762794911339</id><published>2011-01-23T09:59:00.000-08:00</published><updated>2011-01-23T09:59:26.576-08:00</updated><title type='text'>Take advantage of 802.11n</title><content type='html'>So I just bought a Macbook Air 11". &amp;nbsp;It's a fantastic machine, I would recommend it to anyone with a budget for one. &amp;nbsp;I got the base version, which only has a 64GB SSD. &amp;nbsp;I find myself transferring files to and from the device and my old laptop quite frequently. &amp;nbsp;Transferring a whole season of Dr. Who, for example, &amp;nbsp;is ~10GB, and takes a while over the 802.11g network we have set up. &amp;nbsp;Theoretically I could use a crossover cable and transfer at gigabit speeds, but the Macbook Air doesn't have a LAN port. &amp;nbsp;Both machines have 802.11n built in, but I don't feel a need to buy an N router. &amp;nbsp;So I put both machines in ad-hoc mode, and transferred the files with around 10x speedup. &amp;nbsp;I found it to be extremely useful.&lt;br /&gt;&lt;br /&gt;Here's a tutorial explaining how to create an ad-hoc network.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object width="320" height="266" class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://0.gvt0.com/vi/iyXp4IzhvTg/0.jpg"&gt;&lt;param name="movie" value="http://www.youtube.com/v/iyXp4IzhvTg&amp;fs=1&amp;source=uds" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266" src="http://www.youtube.com/v/iyXp4IzhvTg&amp;fs=1&amp;source=uds" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Good luck.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-496468762794911339?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/496468762794911339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2011/01/take-advantage-of-80211n.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/496468762794911339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/496468762794911339'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2011/01/take-advantage-of-80211n.html' title='Take advantage of 802.11n'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-4037260384305204579</id><published>2011-01-05T11:34:00.000-08:00</published><updated>2011-01-05T11:34:30.991-08:00</updated><title type='text'>Apple Computers resale value</title><content type='html'>My Macbook pro has recently been the recipient of water damage.&amp;nbsp; I want to hold out until the MBP line gets a refresh before replacing my machine.&amp;nbsp; I'm not sure I can survive without a laptop until then, so I've been looking at a few options:&lt;br /&gt;&lt;br /&gt;1)&amp;nbsp; Just deal with it.&amp;nbsp; I've got a desktop machine (running linux) and I've got OS X installed in Virtualbox if I have to do some iOS development.&lt;br /&gt;2)&amp;nbsp; Just get a Macbook Pro.&amp;nbsp; It's a great machine and will do everything I need to do.&lt;br /&gt;3)&amp;nbsp; Buy a new laptop now and sell it when the MBP line gets refreshed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Number 3 was intriguing to me.&amp;nbsp; I could have a laptop now, but still get the new MBP line.&amp;nbsp; I started exploring the resale value of used apple laptops.&amp;nbsp; I looked on ebay, looking only at completed listings.&amp;nbsp; I looked at 4 different apple products, hoping to see which retains it's value the best.&amp;nbsp; I took ~10 samples of each model, (among the 10 were varying configurations, which I took into account for the purchase price).&amp;nbsp; These were all in mint condition still under the manufacturers warranty.&lt;br /&gt;&lt;br /&gt;Results:&lt;br /&gt;&lt;br /&gt;White Macbooks sold for an average of 73% of the original cost. &lt;br /&gt;13" Macbook Pros sold for an average of 78% of the original cost.&lt;br /&gt;Ipads sold for an average of 88% of the original cost.&lt;br /&gt;11" Macbook Airs sold for an average of 87% of the original cost.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;First, even 73% isn't terrible for a used laptop, although the White Macbooks were the most inconsistent, so the average may be misleading.&lt;br /&gt;&lt;br /&gt;Second, I was impressed by the 88% and 87% of the iPad and the Macbook Air.&amp;nbsp; I guess without any alternatives to these two machines, prices stay pretty rigid.&lt;br /&gt;&lt;br /&gt;I haven't made any purchases yet, but I think I'm going to purchase an 11" macbook air.&amp;nbsp; Why 11" instead of 13"?&amp;nbsp; I'm guessing that when the new MBP line comes around, the 13" macbook air will be competing with the MBP 13", causing the resale price to fall due to decreased demand and increased supply.&amp;nbsp; Just speculation though.&amp;nbsp; The 11" is unique enough to be pretty stable in my oppinion.&lt;br /&gt;&lt;br /&gt;Just thought it was an interesting observation.&amp;nbsp; Thoughts?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-4037260384305204579?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/4037260384305204579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2011/01/apple-computers-resale-value.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/4037260384305204579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/4037260384305204579'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2011/01/apple-computers-resale-value.html' title='Apple Computers resale value'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-2242361303279624762</id><published>2010-12-21T00:34:00.000-08:00</published><updated>2010-12-21T00:34:24.152-08:00</updated><title type='text'>Wake up to music</title><content type='html'>My friend and I were discussing Social Media marketing, and how buzzword laden it has become.  I'm personally of the "Field of Dreams" opinion.  If you build it they will come.  Granted, I'm wrong, but I enjoy building it much more than I enjoy marketing it, especially when the marketing is dry and boring.  SEO, Twitter, Facebook and other online marketing seems too simple to be interesting.  Everything I've read on it is generally just being meticulous about keyword usage and diligent about consistency.  Not quite my cup of tea.  &lt;br /&gt;&lt;br /&gt;So my friend and I decided, in classic Seinfeld style, to start a blog about "Nothing!".  We wanted to see if all this online marketing really is as simple as it seems.  So we started a blog, bought 15 articles from textbroker.com , and started posting them.  We've create a Facebook page and a twitter account, and are currently working on a few other things.&lt;br /&gt;&lt;br /&gt;The blog is called &lt;a href="http://wakeuptomusic.com/"&gt;Wake Up To Music&lt;/a&gt;. &amp;nbsp;A few times a week, we post a song along with a paragraph on why it's a great &amp;nbsp;song to wake up to. &amp;nbsp;We hope people will see it and think, "Hey! &amp;nbsp;That is a great song. &amp;nbsp;I don't own it. &amp;nbsp;I'm going to click this link to Amazon/iTunes(coming soon) and buy it." &amp;nbsp;We get a cut through their affiliate program and hopefully earn enough to cover costs (~$2/article).&lt;br /&gt;&lt;br /&gt;This is going to be an interesting little experiment. &amp;nbsp;The stakes are pretty low here, so we want to try some very clever marketing techniques. &amp;nbsp;Simple things like raffling off iTunes gift cards on Twitter. &amp;nbsp;Or building an iPhone alarm app that will wake you up to the iTunes preview of the latest posted song.&lt;br /&gt;&lt;br /&gt;This may flop. &amp;nbsp;Or it may work out and pay for lunch a couple of times a week. &amp;nbsp;We'll see.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-2242361303279624762?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/2242361303279624762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2010/12/wake-up-to-music.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/2242361303279624762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/2242361303279624762'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2010/12/wake-up-to-music.html' title='Wake up to music'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-7171228048177391017</id><published>2010-12-04T02:21:00.000-08:00</published><updated>2010-12-05T18:12:30.723-08:00</updated><title type='text'>10,000 ints in 1 page of memory (4KB)</title><content type='html'>So I was talking to a friend of mine about some interesting job interview questions. &amp;nbsp;He mentioned a favorite of his:&lt;br /&gt;&lt;br /&gt;You are writing an application which continuously receives integer values between 1 and 10,000. &amp;nbsp;Your job is, once the input stream ceases, to output each integer received in ascending order. &amp;nbsp;You don't know how many there will be, and you can only use a page (4KB) of memory. &amp;nbsp;What do you do?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So there is a pretty straightforward and simple method using the whole page as a giant bitmap.&lt;br /&gt;&lt;br /&gt;I came up with a different solution. &amp;nbsp;This is still a little flawed, but the idea is pretty solid.  Also, the code is pretty ugly...  It was a proof of concept and so I just hacked away.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#define ARRAYSIZE 2000&lt;br /&gt;#define OVERLAYCOUNT 32&lt;br /&gt;&lt;br /&gt;// So we have them all stored in an array of short ints with 2000 items.&lt;br /&gt;short x[ARRAYSIZE];&lt;br /&gt;void addToX(int z);&lt;br /&gt;&lt;br /&gt;// Here's the data we are going to be adding in. &amp;nbsp;&lt;br /&gt;// Can be changed around, grown, shrunk&lt;br /&gt;void populateX(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;int values[20] = {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;2,3454,6666,1666,1234,&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;1532,532,1235,6543,3434,&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;2432,555,232,1555,6432,&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;6789,8767,6766,8766,12&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;br /&gt;&amp;nbsp;&amp;nbsp;int i;&lt;br /&gt;&amp;nbsp;&amp;nbsp;for(i = 0; i &amp;lt; 20; i++){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;addToX(values[i]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// When we receive a value, we xor it into it's bucket.&lt;br /&gt;void addToX(int z){&lt;br /&gt;&amp;nbsp;&amp;nbsp;x[z%ARRAYSIZE] ^=z;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;populateX();&lt;br /&gt;&amp;nbsp;&amp;nbsp;// each slot will be a xor of up to 5 numbers of &lt;br /&gt;&amp;nbsp;&amp;nbsp;// the form i + 2000j&lt;br /&gt;&amp;nbsp;&amp;nbsp;short i,j,k;&lt;br /&gt;&amp;nbsp;&amp;nbsp;int imax = 10000/ARRAYSIZE;&lt;br /&gt;&amp;nbsp;&amp;nbsp;for(i = 0; i &amp;lt; imax ; i++){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(j = 0; j &amp;lt; ARRAYSIZE; j++){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;short valueToCheck = x[j];&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;int a;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;int l;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;// walk through all 32 combinations of 5 xors, &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;//figure out which one it is&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;// this is a bit encoding of which numbers &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;// could be stored there.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;for(l = 0; l &amp;lt; OVERLAYCOUNT; l++){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;printf("\tTrying %d\n",l);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;short guessValues = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// see if the least bit is set. &amp;nbsp;If so, &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//xor the new value calculated with&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// our guess. &amp;nbsp;increment a ( the multiplier)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// and shift b to get access to the next bit;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a = 0; &amp;nbsp;//&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int b = l; // make a copy we can tweak&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;do{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(b &amp;amp; 1){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;short newValue =j + ARRAYSIZE*a;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;guessValues = guessValues ^ newValue;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a++; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}while(b&amp;gt;&amp;gt;=1);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// if the generated value from this version of&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// the bitmapping is equal to the value,&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// we know which 5 numbers were entered.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(guessValues == valueToCheck){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;break;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;int n = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;// In order to preserve ascending order, only printout &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;//the i'th lowest bit, if set&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;l&amp;gt;&amp;gt;=i;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;if(l &amp;amp; 1){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;printf("%d\n",j + ARRAYSIZE*i);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Output (newlines added for clarity):&lt;br /&gt;&lt;br /&gt;2&lt;br /&gt;12&lt;br /&gt;232&lt;br /&gt;532&lt;br /&gt;555&lt;br /&gt;&lt;br /&gt;1234&lt;br /&gt;1235&lt;br /&gt;1532&lt;br /&gt;1555&lt;br /&gt;1666&lt;br /&gt;&lt;br /&gt;2432&lt;br /&gt;3434&lt;br /&gt;3454&lt;br /&gt;6432&lt;br /&gt;6543&lt;br /&gt;&lt;br /&gt;6666&lt;br /&gt;6766&lt;br /&gt;6789&lt;br /&gt;8766&lt;br /&gt;8767&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Other Thoughts:&lt;br /&gt;Here I used the full 4KB to hold 2000 short ints.  The bitmapping method uses 1250 bytes.  Theoretically I could tighten this down to ~600 bytes by setting the overlay count to 2^32 and the array size to be 300 (at 2 bytes for a short int);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Known issues:&lt;br /&gt;&lt;br /&gt;It doesn't handle duplicates.  &lt;br /&gt;&lt;br /&gt;It is a little buggy, due to certain scenarios where a^b^c == e^d^f.  This could probably be fixed by an additional check before printout.  The check could be guessValue^b^c == a, as a^b^c^b^c == a and e^d^f^b^c !- a.&lt;br /&gt;&lt;br /&gt;Interesting solution to say the least.&lt;br /&gt;&lt;br /&gt;Thoughts?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-7171228048177391017?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/7171228048177391017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2010/12/10000-ints-in-1-page-of-memory-4kb.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/7171228048177391017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/7171228048177391017'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2010/12/10000-ints-in-1-page-of-memory-4kb.html' title='10,000 ints in 1 page of memory (4KB)'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-7470869471338921499</id><published>2010-09-25T07:40:00.000-07:00</published><updated>2010-09-25T07:40:45.862-07:00</updated><title type='text'>Park in the Shade - IPhone</title><content type='html'>So I finally got around to building an iPhone version of my Park in the Shade app. &amp;nbsp;You can check it out&amp;nbsp;&lt;a href="itms://itunes.apple.com/us/app/park-in-the-shade/id391296993?mt=8"&gt;In the App Store&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;It works, (or at least... should work... we'll see). &amp;nbsp;I need to do an overhaul of the graphics. &amp;nbsp;I am not a graphic designer. &amp;nbsp;If anyone want to redesign it feel free to let me know.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-7470869471338921499?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/7470869471338921499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2010/09/park-in-shade-iphone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/7470869471338921499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/7470869471338921499'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2010/09/park-in-shade-iphone.html' title='Park in the Shade - IPhone'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-580087758025872116</id><published>2010-09-03T21:18:00.000-07:00</published><updated>2010-10-05T08:16:24.401-07:00</updated><title type='text'>Fermat's Last Theorem</title><content type='html'>I just finished a great book on Fermat's Last Theorem.  &lt;br /&gt;&lt;a href="http://www.amazon.com/gp/product/0385493622?ie=UTF8&amp;amp;tag=undiscover-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0385493622"&gt;Fermat's Enigma&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=undiscover-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0385493622" style="border: none !important; margin: 0px !important;" width="1" /&gt;&lt;br /&gt;It was very well written and I enjoyed it because it explored each great mathematician from Pythagoras up through Andrew Wiles (who solved the problem).  I would recommend the book to anyone interested in math, especially those who enjoy number theory.&lt;br /&gt;&lt;br /&gt;For those of you who don't know much about number theory, it's a branch of mathematics dealing with the property of numbers.  Just like how chemists examine oxygen, carbon, etc. to see how they interact with each other, number theorists examine how numbers interact.  For example, there are certain numbers called perfect numbers.  6 is one of them.  The factors of 6 (1,2,3) add up to 6.  Numbers have properties such as being prime, perfect squares, odd, even.  These don't seem to be assigned at random.  There is a pattern to many of these, and number theorists try to discover these patterns.  The book is about one particular relation, and how it took over 300 years to prove.&lt;br /&gt;&lt;br /&gt;In reading it, I came up with a few theorems and proofs that I found interesting.  While not technically difficult, they caught my attention.&lt;br /&gt;&lt;br /&gt;In reading it, I came up with a few theorems and proofs that I found interesting.  While not technically difficult, they caught my attention.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_Ri0vC02reOk/TKtBGwYXz-I/AAAAAAAAAA4/BQ3pZZFEYK0/s1600/equation+1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_Ri0vC02reOk/TKtBGwYXz-I/AAAAAAAAAA4/BQ3pZZFEYK0/s1600/equation+1.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This is most clearly demonstrated with&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_Ri0vC02reOk/TKtBHe0ifnI/AAAAAAAAAA8/fouZgRX1uI0/s1600/equation+2.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_Ri0vC02reOk/TKtBHe0ifnI/AAAAAAAAAA8/fouZgRX1uI0/s1600/equation+2.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_Ri0vC02reOk/TKtA2X_8uBI/AAAAAAAAAA0/iSdfBUakrCs/s1600/equation+4.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_Ri0vC02reOk/TKtA2X_8uBI/AAAAAAAAAA0/iSdfBUakrCs/s1600/equation+4.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;But is in fact true for all values of a and x.  The proof by induction is quite simple.&lt;br /&gt;&lt;br /&gt;The other problem I've been exploring has less to do with equations and is more of a simple puzzle.  It's called "The Broken Weight Problem".  The idea is that using a standard balance, what is the minimum number of weights needed to weigh anything of whole values between 1 and 40.&lt;br /&gt;&lt;br /&gt;The initial thought is that you need 6 weights, values 1,2,4,8,16, and 32.  This is based on the assumption that you can only add weights to one side of the balance.&lt;br /&gt;&lt;br /&gt;The actual solution is that you need 4 weights, values 1, 3, 9, and 27.  This only works if you add these weights to both sides to get a balanced measurement.  For example, to measure an orange of weight 2 you put the orange and a 1 lb weight  on one side and balance it with a 3 lb weight.&lt;br /&gt;&lt;br /&gt;The first solution is the powers of 2, the second is the powers of 3.  So I started thinking about a scenario in which the solution would be the powers of 4.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_Ri0vC02reOk/TIE0cyfn8BI/AAAAAAAAAAk/xdojQsM_wIU/s1600/balance3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_Ri0vC02reOk/TIE0cyfn8BI/AAAAAAAAAAk/xdojQsM_wIU/s320/balance3.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Consider a balance like the one above. &amp;nbsp; The object to be weighed is placed in B. &amp;nbsp;The weights can be placed in A, B, or C. &amp;nbsp;The weights in C would have a factor of 2 applied due to leverage. &amp;nbsp;In this scenario, the only weights needed would be 1, 4, 16, 64, etc. &amp;nbsp;(The powers of 4). &amp;nbsp; So to get a number like 35, one could put 16 and in C and &amp;nbsp;4 in A, totaling 36 on the left. &amp;nbsp;Put the object being weighed and the 1 weight in B, balancing the scale.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_Ri0vC02reOk/TIHEQH79t_I/AAAAAAAAAAs/7w4Vpy0uDhM/s1600/balance4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_Ri0vC02reOk/TIHEQH79t_I/AAAAAAAAAAs/7w4Vpy0uDhM/s320/balance4.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;In this case, D would be a counter balance. &amp;nbsp;The weights in D would also have a factor of 2. &amp;nbsp;In this scenario, the weights needed would be 1, 5, 25, 125, etc. (The powers of 5).&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I don't have a proof for this, but I suspect this pattern continues as you add arms to the balance. &amp;nbsp;The next set would have a spot for weights on the left side that would be a factor of 3 and would result in the powers of 6 being the minimum set of weights. &amp;nbsp;The following set would add an arm on the right side with a factor of three. &amp;nbsp;This would result in the powers of 7 being the minimum set of weights.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Why is this important at all? &amp;nbsp;It's not really. &amp;nbsp;But I found it to be an interesting pattern. &amp;nbsp;There are probably some applications in number theory dealing with various bases, and I may try to write it up as some equations someday and try to prove it. &amp;nbsp;But this is enough for now.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-580087758025872116?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/580087758025872116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2010/09/fermats-last-theorem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/580087758025872116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/580087758025872116'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2010/09/fermats-last-theorem.html' title='Fermat&apos;s Last Theorem'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Ri0vC02reOk/TKtBGwYXz-I/AAAAAAAAAA4/BQ3pZZFEYK0/s72-c/equation+1.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-8783463993120788077</id><published>2010-08-15T13:21:00.000-07:00</published><updated>2010-08-15T13:34:44.663-07:00</updated><title type='text'>Park in the shade</title><content type='html'>Last Summer I worked at an office building in California.  It was a pretty normal 9-5 programming job.  My car would roast out in the parking lot.  I started parking in the shade, but by 5 pm, the car was back in direct sunlight.  Apparently, the shade moves throughout the day.  Rather than park where the shade is at 9am, I set out to park where the shade would be by 5 pm so my car would cool off a bit.  After some trial and error I figured out which parking spots where good to park in.  It as always the spot next to where the shade currently was.  Usually the one on the east side, but it was always hard to figure out which direction was which.&lt;br /&gt;&lt;br /&gt;I took a class last fall called History of Creativity.  We had a final "Creativity" project which could be anything we wanted that we could somehow relate to something we studied.  I decided to build a webapp.  "Park in the Shade" I called it.  &lt;br /&gt;&lt;br /&gt;&lt;a href="http://parkintheshade.appspot.com"&gt;http://parkintheshade.appspot.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I got an A!&lt;br /&gt;&lt;br /&gt;I used Google App Engine and Python as the backend.  The calculations start with a zipcode, and convert that to latitude and longitude using a look up table.  The angle of altitude and angle of azimuth are then calculated using the given time interval, and the graphic is manipulated accordingly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-8783463993120788077?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/8783463993120788077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2010/08/park-in-shade.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/8783463993120788077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/8783463993120788077'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2010/08/park-in-shade.html' title='Park in the shade'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-862650702530150848</id><published>2010-08-13T21:21:00.001-07:00</published><updated>2010-08-15T13:21:29.537-07:00</updated><title type='text'>Thermostat</title><content type='html'>So lately I've been playing with a new toy:  The Arduino.  It's a microcontroller prototyping board.  Quite fun.  I bought a kit which came with all sorts of sensors and LEDs/motors/etc.  &lt;br /&gt;&lt;br /&gt;So the first real project (other than making lights blink in fun patterns) was a thermostat for our air conditioning.  Here's a little description of the layout:&lt;br /&gt;&lt;br /&gt;Sensors:&lt;br /&gt;  Temperature Sensor - basically a thermal resistor.  Every degree Celsius translates to a 5mV change in voltage.&lt;br /&gt;  Potentiometer - a variable resistor, most frequently used in stereos for volume control.  (Think walkman wheel control)&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;  8 LEDS (4 Green, 4 Red) - This is my crude display for binary/ hex data.  The red lights display one hex digit, the green the other.  This displays the current value the potentiometer is set at (the triggering temperature);&lt;br /&gt;  Servo Motor - I have this motor set to turn 100 degrees in the event that the temperature is too high (turning on the A/C) and turn back if it drops down again.&lt;br /&gt;  &lt;br /&gt;The code is pretty simple.  Read in the values, tweak the numbers a bit so they are in the range we want them to be.  Then there's a simple if/else statement dealing with the temperature.  I have it polling every second, but in reality I could probably lower it to once a minute.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;EDIT: after leaving it to run overnight, I found it not working in the morning.  My wife suggested that it drained the battery.  After looking at it, I think having it poll so often uses way too much power.  I switched it to be powered off of USB instead, and changed the polling interval to 5 minutes.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ri0vC02reOk/TGYeFgov2TI/AAAAAAAAAAU/s0xJYeUbF9w/s1600/CIMG0015.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 239px; height: 320px;" src="http://2.bp.blogspot.com/_Ri0vC02reOk/TGYeFgov2TI/AAAAAAAAAAU/s0xJYeUbF9w/s320/CIMG0015.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5505120674516031794" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ri0vC02reOk/TGYeFRXV0NI/AAAAAAAAAAM/7nJfDhbgrcI/s1600/CIMG0014.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 239px; height: 320px;" src="http://3.bp.blogspot.com/_Ri0vC02reOk/TGYeFRXV0NI/AAAAAAAAAAM/7nJfDhbgrcI/s320/CIMG0014.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5505120670416490706" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;#include &lt;Servo.h&gt;&lt;br /&gt;&lt;br /&gt;Servo myservo;&lt;br /&gt;int leds[] = {2,3,4,5,6,7,8,9};&lt;br /&gt;int control = 1;&lt;br /&gt;int temp = 0;&lt;br /&gt;int pos = 0;&lt;br /&gt;int sensorValue = 0;&lt;br /&gt;&lt;br /&gt;void setup(){&lt;br /&gt;  myservo.attach(10);&lt;br /&gt;  for (int i = 0; i &lt; 8; i++){&lt;br /&gt;    pinMode(leds[i],OUTPUT);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop(){&lt;br /&gt;  sensorValue = analogRead(controlc);&lt;br /&gt;  int maxTemp = sensorValue / 10 + 10; //(use F values between 10 and 112)&lt;br /&gt;  writeFF(maxTemp);&lt;br /&gt;  float temperature = analogRead(temp) * .004882814;&lt;br /&gt;  temperature = (temperature - 0.5) * 100 * 1.8 + 32; // convert to F&lt;br /&gt;  if (temperature &gt; maxTemp){&lt;br /&gt;    myservo.write(100);&lt;br /&gt;  } else {&lt;br /&gt;    myservo.write(0);&lt;br /&gt;  }&lt;br /&gt;  delay(1000);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void writeFF(int a){&lt;br /&gt;  int values[8];&lt;br /&gt;  for(int i = 0; i &lt; 8; i++){&lt;br /&gt;    values[i] = a % 2;&lt;br /&gt;    a = a / 2;&lt;br /&gt;  }&lt;br /&gt;  for (int i = 0; i&lt;8;i++){&lt;br /&gt;    digitalWrite(leds[i],values[i]);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-862650702530150848?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/862650702530150848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2010/08/thermostat.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/862650702530150848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/862650702530150848'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2010/08/thermostat.html' title='Thermostat'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Ri0vC02reOk/TGYeFgov2TI/AAAAAAAAAAU/s0xJYeUbF9w/s72-c/CIMG0015.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-2424874590900142028</id><published>2010-08-11T14:43:00.000-07:00</published><updated>2010-08-13T21:20:57.585-07:00</updated><title type='text'>CouchDB..... Relax....</title><content type='html'>I just signed up for a free account at cloudant.com to play with couchdb.&lt;br /&gt;&lt;br /&gt;I started using couchapp to manage my project.&lt;br /&gt;&lt;br /&gt;In less than 50 lines of javascript ( with lots of whitespace) I built a simple, yet functional chatroom.&lt;br /&gt;&lt;br /&gt;I didn't bother to adjust the default couchapp template.&lt;br /&gt;&lt;br /&gt;Check it out.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://hamiltop.cloudant.com/chat/_design/chat/index.html"&gt;http://hamiltop.cloudant.com/chat/_design/chat/index.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-2424874590900142028?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/2424874590900142028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2010/08/couchdb-relax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/2424874590900142028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/2424874590900142028'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2010/08/couchdb-relax.html' title='CouchDB..... Relax....'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4980628797186804242.post-7271805164463033771</id><published>2010-08-11T14:37:00.000-07:00</published><updated>2010-08-13T21:20:57.593-07:00</updated><title type='text'>New Blog</title><content type='html'>So I am starting a blog.  It's not a place for social commentary.  It's not a place for family photos.  I'll let my wife handle that.  This blog exists as a place to dump ideas.  To post about projects.  To discuss new "toys" in both the software and hardware worlds.  Feel free to tell me my idea is terrible (please include some details) or tell me what you like about it.  Please make suggestions for improvements.  Thanks!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4980628797186804242-7271805164463033771?l=www.undiscoveredfeatures.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.undiscoveredfeatures.com/feeds/7271805164463033771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.undiscoveredfeatures.com/2010/08/new-blog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/7271805164463033771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4980628797186804242/posts/default/7271805164463033771'/><link rel='alternate' type='text/html' href='http://www.undiscoveredfeatures.com/2010/08/new-blog.html' title='New Blog'/><author><name>Peter Hamilton</name><uri>http://www.blogger.com/profile/15826204436192793165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
