<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
  <title>Oh! Scope</title>
  <link href="http://www.ohscope.com/"/>
  <link type="application/atom+xml" rel="self" href="http://www.ohscope.com/atom.xml"/>
  <updated>2012-01-24T14:14:19-05:00</updated>
  <id>http://www.ohscope.com/</id>
  <author>
    <name>Kerry Snyder</name>
    <email>kerry.snyder@gmail.com</email>
  </author>

  
  <entry>
    <id>http://www.ohscope.com/2011/06/27/manos-and-spdy</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2011/06/27/manos-and-spdy/"/>
    <title>Manos wants to get SPDY, and you can help</title>
    <updated>2011-06-27T00:00:00-04:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;This summer, I've been fortunate enough to be accepted into the &lt;a href=&quot;http://code.google.com/soc/&quot;&gt;Google Summer of Code&lt;/a&gt; program to work on implementing Google's &lt;a href=&quot;http://www.chromium.org/spdy&quot;&gt;SPDY&lt;/a&gt; web protocol on top of the &lt;a href=&quot;https://github.com/jacksonh/manos&quot;&gt;Manos&lt;/a&gt; Evented IO/HTTP Application platform. As of today, I'm at the point where I'd like to share what I've built so far and hopefully get enough testing and eyes on it to get pulled into master. After reading this post, you'll have no excuse not to contribute and test out this new functionality.&lt;/p&gt;

&lt;h3&gt;Requirements&lt;/h3&gt;

&lt;p&gt;Manos installation instructions and requirements can be found &lt;a href=&quot;https://github.com/jacksonh/manos/blob/master/docs/installation.md&quot;&gt;here&lt;/a&gt;. Additionally, you will need &lt;a href=&quot;http://www.gnu.org/software/gnutls/&quot;&gt;gnutls&lt;/a&gt; if you plan to try it over SSL (Linux only at the moment).&lt;/p&gt;

&lt;h3&gt;Building&lt;/h3&gt;

&lt;p&gt;In order to build with SPDY, you'll have to clone from &lt;a href=&quot;https://github.com/kersny/manos/tree/spdy&quot;&gt;my fork&lt;/a&gt; and checkout the 'spdy' branch:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
git clone git://github.com/kersny/manos.git
cd manos
git checkout spdy
&lt;/pre&gt;


&lt;p&gt;Then, you can simply build:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
./autogen.sh (--with-gnutls if you want ssl)
make
(optional) sudo make install
&lt;/pre&gt;


&lt;p&gt;If you don't want to clobber an already installed manos, you can skip the &lt;code&gt;make install&lt;/code&gt; and invoke manostool.exe directly to try spdy.&lt;/p&gt;

&lt;h3&gt;Using it&lt;/h3&gt;

&lt;p&gt;To get your first manos app up and running check out the tutorial. Then to serve with spdy, simply set a port with -n:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
manos --server -n 8081
&lt;/pre&gt;


&lt;p&gt;Outputs:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
Running (your manos app) on port 8080.
Running (your manos app) with SPDY on port 8081.
&lt;/pre&gt;


&lt;p&gt;Now, you have to force Chrome to use SPDY because manos currently does not support protocol negotiation. To do so, invoke chrome from the command line with the switch '--use-spdy=no-ssl' This will make any non-spdy site fail, but allow us to test our own server. Then, simple head to localhost:8081 to navigate your Manos app.&lt;/p&gt;

&lt;h3&gt;Next Steps&lt;/h3&gt;

&lt;p&gt;My goal with this post is to generate discussion and intrest around manos's spdy support and more importantly get people critiquing and poking holes through my code. If you'd like to help, head to the discussion on the &lt;a href=&quot;&quot;&gt;pull request&lt;/a&gt; and tell me how terrible my code is.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2011/02/20/s3-jekyll-deployment</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2011/02/20/s3-jekyll-deployment/"/>
    <title>Even Easier S3 Jekyll deployment</title>
    <updated>2011-02-20T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;h2&gt;Simply deploying your Jekyll site to S3&lt;/h2&gt;

&lt;p&gt;Inspired by &lt;a href=&quot;http://news.ycombinator.com/item?id=2241801&quot;&gt;this&lt;/a&gt; Hacker news post, I decided to share my new blog deployment system based on Amazon's new &lt;a href=&quot;http://aws.typepad.com/aws/2011/02/host-your-static-website-on-amazon-s3.html&quot;&gt;static site&lt;/a&gt; &lt;a href=&quot;http://www.allthingsdistributed.com/2011/02/website_amazon_s3.html&quot;&gt;support&lt;/a&gt; on S3.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Set up an S3 bucket for your site, as per &lt;a href=&quot;http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?HostingWebsiteQS1.html&quot;&gt;this&lt;/a&gt; guide.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install &lt;a href=&quot;http://s3tools.org/s3cmd&quot;&gt;s3cmd&lt;/a&gt;, if you use &lt;a href=&quot;http://mxcl.github.com/homebrew/&quot;&gt;homebrew&lt;/a&gt; on OS X, it's as easy as &lt;em&gt;brew install s3cmd&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure s3cmd: simply run &lt;em&gt;s3cmd --configure&lt;/em&gt; and provide your AWS Access key and secret. You can also configure GPG at this time if so inclined.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Setup a push script:
I have a bash script located in my jekyll root directory simply named &quot;push&quot; that goes as such:&lt;/p&gt;

&lt;p&gt;jekyll&lt;/p&gt;

&lt;p&gt;s3cmd sync --delete-removed _site/ s3://&lt;i&gt;{bucketname}&lt;/i&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Now you can simply access your site from the website endpoints listed on the &lt;a href=&quot;http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?WebsiteEndpoints.html&quot;&gt;developer site&lt;/a&gt;. Of course you don't get the benefits of git like &lt;a href=&quot;http://openfoo.org/blog/jekyll-s3.html&quot;&gt;Sören's method&lt;/a&gt;, but its dead simple to set up.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2011/01/20/gpsd-plus-ruby</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2011/01/20/gpsd-plus-ruby/"/>
    <title>GPSd with Ruby</title>
    <updated>2011-01-20T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;h2&gt;GPSd&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://gpsd.berlios.de/&quot;&gt;GPSd&lt;/a&gt; is a Linux daemon that can read and parse data from various GPS recievers, and it provides a standard interface for obtaining said data. GPSd provides JSON data over a socket connection in an easy to consume stream. In this example, I'm going to read the data with &lt;a href=&quot;http://coolio.github.com/&quot;&gt;cool.io&lt;/a&gt; and parse it with Ruby bindings to &lt;a href=&quot;https://github.com/brianmario/yajl-ruby&quot;&gt;yajl&lt;/a&gt;. Cool.io brings events like &lt;a href=&quot;http://nodejs.org/&quot;&gt;Node.js&lt;/a&gt; to Ruby with the simplicity of &lt;a href=&quot;http://www.sinatrarb.com/&quot;&gt;Sinatra&lt;/a&gt;. Yajl, on the other hand, is a streaming JSON parser that's fast and reliable.&lt;/p&gt;

&lt;p&gt;First, install the required gems:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
$ (sudo) gem install yajl-ruby
$ (sudo) gem install cool.io
&lt;/pre&gt;


&lt;p&gt;Code:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
require 'rubygems'
require 'cool.io'
require 'yajl'

ADDR = '127.0.0.1'
PORT = 2947

print = lambda { |data| puts data.inspect }
parser = Yajl::Parser.new
parser.on_parse_complete = print

cool.io.connect ADDR, PORT do
    on_connect do
        puts &quot;Connected&quot;
        write &quot;?WATCH={\&quot;enable\&quot;:true,\&quot;json\&quot;:true}&quot;
    end

    on_read do |data|
        parser &lt;&lt; data
    end
end

puts &quot;Running&quot;
cool.io.run
&lt;/pre&gt;



</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2010/12/13/pagerank-for-college-basketball</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2010/12/13/pagerank-for-college-basketball/"/>
    <title>PageRank for Ranking College Basketball</title>
    <updated>2010-12-13T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;Something I have been working on lately, after obtaining a large database of
NCAA college basketball games, has been ranking teams algorithmically. One
such ranking method that I recently implemented is &lt;em&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/PageRank&quot;&gt;PageRank&lt;/a&gt;&lt;/em&gt;, Google's
method for ranking webpages.&lt;/p&gt;

&lt;h2&gt;PageRank&lt;/h2&gt;

&lt;p&gt;The PageRank algorithm itself is covered in Google's &lt;a href=&quot;http://infolab.stanford.edu/~backrub/google.html&quot;&gt;White Paper&lt;/a&gt; on the
subject. I, however, learned much more from &lt;a href=&quot;http://michaelnielsen.org/blog/lectures-on-the-google-technology-stack-1-introduction-to-pagerank/&quot;&gt;this article&lt;/a&gt; by Michael
Nielsen. It covers the math in a way that even I can understand, and provides
a concise, ~6 line example in python using matrices. This will serve as the
basis for my Ruby implementation of ranking College Basketball teams.&lt;/p&gt;

&lt;h2&gt;The Data&lt;/h2&gt;

&lt;p&gt;For this application, I am using 141,523 College Basketball Games from 1981
forward, stored in a MySQL database locally. These games have the following
data:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;| id                | int(11)      |

| date              | datetime     |

| team1             | int(11)      |

| team1score        | int(11)      |

| team2             | int(11)      |

| team2score        | int(11)      |

| team1home         | int(1)       |

| team1inconference | int(1)       |

| year              | varchar(255) |
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;team1 and team2 are Foreign Keyed to another table of teams&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I have a separate 'year' column in order to make year-by-year querying easier&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I realize team1 is unnecessary in front of 'in conference', but I don't really feel like changing it&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Gems&lt;/h2&gt;

&lt;p&gt;Since I'm doing this in Ruby, there are some (2) gems necessary to get up and
running. The first is the &lt;a href=&quot;http://www.tmtm.org/en/mysql/ruby/&quot;&gt;'mysql gem'&lt;/a&gt;, a simple way to get my data out of
the database and into code. This can be installed simply with:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
gem install mysql
&lt;/pre&gt;


&lt;p&gt;Next is the wonderful &lt;a href=&quot;http://narray.rubyforge.org/&quot;&gt;Narray&lt;/a&gt; Library, which handles arrays, matrices, and
vectors with a C backend, allowing for not native Ruby speeds (read: fast).
For this to work on my MacBook, I had to install version 0.5.9p7:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
wget http://rubyforge.org/frs/download.php/61995/narray-0.5.9p7.tar.gz

tar -xvzf narray-0.5.9p7.tar.gz

cd narray-0.5.9p7

ruby extconf.rb

make

sudo make install
&lt;/pre&gt;


&lt;p&gt;Now let us write some code...&lt;/p&gt;

&lt;h2&gt;Implementation&lt;/h2&gt;

&lt;h3&gt;Require&lt;/h3&gt;

&lt;p&gt;First, we simply pull in our libraries so that we can actually do stuff&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
require 'rubygems'

require 'mysql'

require 'narray'
&lt;/pre&gt;


&lt;h3&gt;Initialization&lt;/h3&gt;

&lt;p&gt;Next up, we initialize variables needed for the script. First up in this
process is the database class, used to query MySQL. If you want to actually
use this, you will have to put in your own host, username, password, and
database. Alternatively, you can just build up an array of hashes and
calculate PageRank on this. Next, s &amp;amp; t are used to decide whether to follow a
link or to pick a random page. This is described in more detail in &lt;a href=&quot;http://michaelnielsen.org/blog/lectures-on-the-google-technology-stack-1-introduction-to-pagerank/&quot;&gt;Michael's
post&lt;/a&gt;. After this, we use MySQL to get the number of teams in order to
create our matrices. Using this value, we create a (square) identity matrix
the with a dimension of the number of teams. Finally, we create the
probability distribution for the random jump, setting each to an equal value,
1/(the number of teams).&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
dbh = Mysql.real_connect(&quot;host&quot;, &quot;username&quot;, &quot;password&quot;, &quot;database_name&quot;)

s = 0.85
t = 1.0-s

query = &quot;SELECT COUNT(*) as count FROM Teams&quot;
res = dbh.query(query)
numteams = res.fetch_hash[&quot;count&quot;].to_i

ident = NMatrix.float(numteams, numteams)
ident.diagonal!(1.0)

p = NMatrix.float(1, numteams).fill!(1.0)
p = (1.0/numteams.to_f) * p
&lt;/pre&gt;


&lt;h3&gt;Getting Games into a Matrix&lt;/h3&gt;

&lt;p&gt;The next step is to pull the game data out of a database and into a matrix.
For this example, I am only doing games in the 2009-2010 year. I just loop
through each of these games and increment the count in a matrix depending on
which team won.&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
rawgames = NMatrix.int(numteams, numteams)

query = &quot;SELECT * FROM Games WHERE year='2009-2010' ORDER BY date&quot;
res = dbh.query(query)
res.each_hash do |row|
  team1 = row[&quot;team1&quot;].to_i
  team2 = row[&quot;team2&quot;].to_i
  if (team2 != 0 &amp;&amp; team1 != 0)
    team1 -= 1
    team2 -= 1
    if (row[&quot;team1score&quot;].to_i &gt; row[&quot;team2score&quot;].to_i)
      rawgames[team1, team2] += 1
    else
      rawgames[team2, team1] += 1
    end
  end
end
&lt;/pre&gt;


&lt;h3&gt;Making a Probability Matrix&lt;/h3&gt;

&lt;p&gt;Now that I know of all of the wins/losses for a team, I can create the
probability matrix for the chance of one team &quot;linking&quot; to another. In this
case, a loss counts as a link, so the highest ranked teams are those with the
most links from other high ranked teams. To do this, I just have to get the
total of all of the losses of a team, and then divide the losses to each other
team by this number.&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
prob = NMatrix.float(numteams, numteams)

0.upto(numteams - 1) do |i|
  sum = 0.0
  0.upto(numteams - 1) do |j|
    sum += rawgames[j, i].to_f
  end

  0.upto(numteams - 1) do |j|
    val = rawgames[j,i].to_f / sum
    prob[i, j] = val.nan? ? 0 : val
  end
end
&lt;/pre&gt;


&lt;h3&gt;Calculating&lt;/h3&gt;

&lt;p&gt;With all of the information collected so far, we can calculate the PageRank
for each team, allowing us to rank each team. You can see this calculation
below, in the first line. The code that follows simply inserts the rank data
into the database, allowing me to access and query it at my will.&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
fin = (t*((ident - (s*prob)).inverse)*p)

0.upto(numteams - 1) do |i|
  val = i + 1
  year = '2009-2010'
  rank = fin[0,i]
  dbh.query(&quot;INSERT INTO page (teamid, year, rank) VALUES (#{val},'#{year}', #{rank})&quot;)
end
&lt;/pre&gt;


&lt;h3&gt;All Together Now&lt;/h3&gt;

&lt;p&gt;Here's the final code, all put together and available for your usage. (MIT
License)&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/739754.js?file=gistfile6.rb&quot;&gt;&lt;/script&gt;


&lt;h1&gt;Problems&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I have 341 teams... with too many, memory could become an issue. For this
case, I would look into &lt;a href=&quot;http://michaelnielsen.org/blog/using-mapreduce-to-compute-pagerank/&quot;&gt;a MapReduce method&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you're having trouble understanding this code, once again I highly
reccommend &lt;a href=&quot;http://michaelnielsen.org/blog/lectures-on-the-google-technology-stack-1-introduction-to-pagerank/&quot;&gt;this blog post&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I'm not going to give you my game data, that you'll have to find for
yourself&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;Results&lt;/h1&gt;

&lt;div class=&quot;left&quot;&gt;
&lt;h3&gt;Top 25 according to ESPN:&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Kansas&lt;/li&gt;
&lt;li&gt;Kentucky&lt;/li&gt;
&lt;li&gt;Duke&lt;/li&gt;
&lt;li&gt;Syracuse&lt;/li&gt;
&lt;li&gt;Ohio State&lt;/li&gt;
&lt;li&gt;West Virginia&lt;/li&gt;
&lt;li&gt;Kansas State&lt;/li&gt;
&lt;li&gt;New Mexico&lt;/li&gt;
&lt;li&gt;Villanova&lt;/li&gt;
&lt;li&gt;Purdue&lt;/li&gt;
&lt;li&gt;Butler&lt;/li&gt;
&lt;li&gt;Temple&lt;/li&gt;
&lt;li&gt;Michigan State&lt;/li&gt;
&lt;li&gt;Georgetown&lt;/li&gt;
&lt;li&gt;Tennessee&lt;/li&gt;
&lt;li&gt;Wisconsin&lt;/li&gt;
&lt;li&gt;Brigham Young&lt;/li&gt;
&lt;li&gt;Pittsburgh&lt;/li&gt;
&lt;li&gt;Baylor&lt;/li&gt;
&lt;li&gt;Maryland&lt;/li&gt;
&lt;li&gt;Vanderbilt&lt;/li&gt;
&lt;li&gt;Gonzaga&lt;/li&gt;
&lt;li&gt;Texas A&amp;M&lt;/li&gt;
&lt;li&gt;Richmond&lt;/li&gt;
&lt;li&gt;Xavier&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;




&lt;div class=&quot;left&quot;&gt;
&lt;h3&gt;My Top 25:&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Duke&lt;/li&gt;
&lt;li&gt;West Virginia&lt;/li&gt;
&lt;li&gt;Georgetown&lt;/li&gt;
&lt;li&gt;Tennessee&lt;/li&gt;
&lt;li&gt;Syracuse&lt;/li&gt;
&lt;li&gt;Kentucky&lt;/li&gt;
&lt;li&gt;Kansas&lt;/li&gt;
&lt;li&gt;Michigan State&lt;/li&gt;
&lt;li&gt;Purdue&lt;/li&gt;
&lt;li&gt;Butler&lt;/li&gt;
&lt;li&gt;Pittsburgh&lt;/li&gt;
&lt;li&gt;Wisconsin&lt;/li&gt;
&lt;li&gt;Georgia Tech&lt;/li&gt;
&lt;li&gt;Villanova&lt;/li&gt;
&lt;li&gt;Kansas State&lt;/li&gt;
&lt;li&gt;Notre Dame&lt;/li&gt;
&lt;li&gt;Northern Iowa&lt;/li&gt;
&lt;li&gt;Maryland&lt;/li&gt;
&lt;li&gt;Louisville&lt;/li&gt;
&lt;li&gt;Ohio State&lt;/li&gt;
&lt;li&gt;Oklahoma State&lt;/li&gt;
&lt;li&gt;Minnesota&lt;/li&gt;
&lt;li&gt;Baylor&lt;/li&gt;
&lt;li&gt;Vanderbilt&lt;/li&gt;
&lt;li&gt;NC State&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;


&lt;div style=&quot;float: left; clear: left;&quot;&gt;
&lt;br&gt;
Note: My data includes March Madness games, where ESPN rankings are before the
tournament.
&lt;/div&gt;



</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2010/05/09/ipad-for-school</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2010/05/09/ipad-for-school/"/>
    <title>iPad for School?</title>
    <updated>2010-05-09T00:00:00-04:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;h2&gt;What I need&lt;/h2&gt;

&lt;p&gt;As you may or may not know of me, I am finishing up my junior year in high
school and will soon be moving into my senior year and then college. For my
career path, which will be Electronics Engineering or Computer Science,
computing will be essential. I will have to make a decision in the very near
future regarding purchasing a computer that will likely have to last
throughout my high school and college career (5 years) and allow me to take
notes, write papers, and give presentations. I'm posting some of my ideas in
order to hopefully illicit discussion regarding my choices, and maybe gain
some further ideas into my situation. If you have any ideas for me or anything
that I missed, please comment or tweet me &lt;a href=&quot;http://www.twitter.com/kersny&quot;&gt;@kersny&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;What I've got&lt;/h2&gt;

&lt;p&gt;Right now, I am running on a &lt;a href=&quot;http://www.notebookreview.com/default.asp?newsID=2154&quot;&gt;Dell Inspiron 600m laptop&lt;/a&gt; with a broken and
removed screen on either a 17&quot; or 23&quot; monitor. This has a 1.6Ghz processor,
512mb of RAM, and a 60gb hard drive... so yeah, its pretty weak. Seriously
though, I dual boot XP and Ubuntu 10.04 and it manages to handle many tasks
well, such as Visual Studio 2010 Express, but it has its problems and slows
considerably for other common tasks or any sort of multitasking.&lt;/p&gt;

&lt;h1&gt;Options&lt;/h1&gt;

&lt;h2&gt;1. MacBook&lt;/h2&gt;

&lt;p&gt;Purchasing a MacBook was my first thought when I considered buying a computer.
I have always wanted one, and they offer many advantages. I'm sure that a
MacBook would be plenty durable to last 5+ years, and I know that I could run
OSX, Windows 7, and Linux to handle anything required of me in college The
8-10 hour battery life would also be great for note-taking and college
classes. The only problems I see with this options are price and power.
Obviously, a Macbook is not cheap and would require a considerable chunk of
change. The other downside, power, is not so concrete. I was quite
disappointed in the latest refresh of the MacBook line by Apple, and although
I have read many of the reasons and justifications for doing so (&lt;a href=&quot;http://www.macrumors.com/2010/04/19/another-look-at-apples-core-2-duo-choice-for-new-13-inch-macbook-pro/&quot;&gt;one
such&lt;/a&gt;), I don't really want to buy a $1200 laptop with a Core 2 Duo chip to
last my entire college career. I just think that this would be too
underpowered for the things that I could be doing throughout college. The next
step up, a 15&quot;, is too expensive now but would have the lowest specs that I
would probably consider purchasing.&lt;/p&gt;

&lt;p&gt;tl;dr: I'd love to get a Macbook, but the power of the 13&quot; model and the price
of the 15&quot; model are whats holding me back.&lt;/p&gt;

&lt;h2&gt;2. Regular Laptop&lt;/h2&gt;

&lt;p&gt;It's hard for me to look at the MacBook and not see the huge &quot;Mac Tax&quot; imposed
on such an item. I could buy an i7 &lt;a href=&quot;http://www.newegg.com/Product/Product.aspx?Item=N82E16834220696&quot;&gt;laptop&lt;/a&gt; with 4 Gigs of RAM from any
number of PC companies for much less than even the low end MacBook. I know
that this should be plenty powerful to handle most anything I would throw at
it throughout my college years, but it has its own set of cons. The first of
such would be durability, which is important for something that has to last 5
years. I've seen many a laptop fail hardware or case wise, and that could be a
huge problem for a college kid. Another smaller concern is the fact that it is
not a Mac, meaning that I could not develop apps for the iPhone or iPad.&lt;/p&gt;

&lt;p&gt;tl;dr: A Windows Laptop would be plenty powerful but I'm scared about
durability and I couldn't do iPhone development.&lt;/p&gt;

&lt;h2&gt;3. The iPad/Mac Mini power combo&lt;/h2&gt;

&lt;p&gt;This is an interesting option that I have been looking into over the last
couple of weeks. For much less than the price that I would have to spend on a
sufficiently powerful MacBook, I could get both an iPad and a Mac Mini. I
would buy an iPad now, and use it through my senior year and onto college. I
could write papers (with an external keyboard of course), give presentations,
and do all the research required of me in my senior year. Add to this the ease
of note taking and portability in college, and it could make a great platform.
I would, however, have to buy a complementary Mac Mini in order to support
coding and other programs that won't run on an iPad. This could be pushed into
college, after a refresh or two, and give me a powerful box to anything not
supported on an iPad. The only problems in this situation would be the known
issues with content creation on the iPad and any labs or such in college that
would require real programs to be run in the classroom, such as maybe an IDE
or Compiler. I do believe, however, that a college cannot force you to have a
computer if that don't provide you with one, and will likely have them
available in any such lab situations.&lt;/p&gt;

&lt;p&gt;tl;dr: An iPad + Mac Mini combo should let me do everything I need throughout
high school and college, unless I am required to run special programs during
class.&lt;/p&gt;

&lt;p&gt;So that is my situation and those are the options that I am currently
considering. If you have any experience, advice, opinion, or idea, please let
me know.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2010/01/01/itunes-music-code-redux</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2010/01/01/itunes-music-code-redux/"/>
    <title>iTunes & Music code Redux</title>
    <updated>2010-01-01T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;It has been brought to my attention on my first &lt;a href=&quot;http://www.ohscope.com/2009/04/itunes-com-api-in-c.html&quot;&gt;iTunes COM API&lt;/a&gt; post that
some of my information in that post is currently invalid:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Lyrics: LyricWiki decided to cut off their API because of copywright
concerns, so that function will no longer work. &lt;a href=&quot;http://groups.google.com/group/lyricwiki-api/browse_thread/thread/733ccd919d654040&quot;&gt;Link&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Album Art: Amazon has implemented authentication in their album art API,
if you would still like to use this service, I recommend &lt;a href=&quot;http://explodingpixels.wordpress.com/2008/06/24/getting-album-art-using-amazon-web-services/&quot;&gt;this post&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/08/26/my-segway-works</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/08/26/my-segway-works/"/>
    <title>My Segway Works!</title>
    <updated>2009-08-26T00:00:00-04:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;Its not 100% yet, but I got my Segway ride-able. Here are some videos:&lt;/p&gt;

&lt;iframe src=&quot;http://player.vimeo.com/video/6275380&quot; width=&quot;400&quot; height=&quot;300&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;


&lt;p&gt;&lt;a href=&quot;http://vimeo.com/6275380&quot;&gt;Riding my Segway!&lt;/a&gt; from &lt;a href=&quot;http://vimeo.com/kersny&quot;&gt;Kerry Snyder&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;




&lt;iframe src=&quot;http://player.vimeo.com/video/6281681&quot; width=&quot;400&quot; height=&quot;270&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;


&lt;p&gt;&lt;a href=&quot;http://vimeo.com/6281681&quot;&gt;Riding My Segway - With Steering&lt;/a&gt; from &lt;a href=&quot;http://vimeo.com/kersny&quot;&gt;Kerry Snyder&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;I should be able to post more details and code soon.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/08/08/segway-video-and-ti-pong</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/08/08/segway-video-and-ti-pong/"/>
    <title>Segway Video and TI Pong</title>
    <updated>2009-08-08T00:00:00-04:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;Yes, its been over a month, but I have made quite a it of progress on my
Segway, and, without further adieu:&lt;/p&gt;

&lt;p&gt;Item #1:&lt;/p&gt;

&lt;iframe src=&quot;http://player.vimeo.com/video/5984793&quot; width=&quot;400&quot; height=&quot;300&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;


&lt;p&gt;&lt;a href=&quot;http://vimeo.com/5984793&quot;&gt;Initial Segway Test&lt;/a&gt; from &lt;a href=&quot;http://vimeo.com/kersny&quot;&gt;Kerry Snyder&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;It balances itself! Now all I need to do is adjust the PID constants. And put
in a big red E-Stop switch.&lt;/p&gt;

&lt;p&gt;Item #2: TI calculator Pong&lt;/p&gt;

&lt;p&gt;I made this while I was bored in math class last year, all by myself,
programmed in a BASIC-like language on our school's graphing calculators,
which I believe are TI-83+'s.&lt;/p&gt;

&lt;p&gt;Here is the calculator manual, with programming information: &lt;a href=&quot;http://docs.google.com/viewer?url=http://ec1.images-amazon.com/media/i3d/01/A/man-migrate/MANUAL000010670.pdf&quot;&gt;Chapter 16&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here is the code:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
Lbl F
ClrHome
Menu(&quot;PLAY PONG&quot;,&quot;PLAY&quot;,Z,&quot;HIGH SCORE&quot;,K,&quot;QUIT&quot;,S)
Pause
Lbl Z
1→B
0→G
1→O
1→P
0→J
Lbl U
getKey→A
If A=34
Then
B+1→B
Then
8→B
End
ClrHome
Output(B,1,&quot;[&quot;)
End
If A=25
Then
B-1→B
If B&lt;1
Then
1→B
End ClrHome
Output(B,1,&quot;[&quot;)
End
If G=0
Then
randInt(3,6)→X
randInt(6,10)→Y
Output(X,Y,&quot;+&quot;)
G+1→G
Else
Output(X,Y,&quot;+&quot;)
If P=1
Then
X+1→X
Else
X-1→X
End
If O=1
Then
Y+1→Y
Else
Y-1→Y
End
If X&gt;8
Then
8→X
0→P
End
If X&lt;1
Then
1→X
1→P
End
If Y&gt;16
Then
16→Y
0→O
End
If Y&lt;2
Then
If X=B or B-1=X or B+1=X
Then
2→Y
1→O
J+1=J
Else
ClrHome
Disp &quot;GAME OVER&quot;
Pause
Output(5,4,&quot;SCORE:&quot;)
Output(5,11,J)
Pause
If J&gt;E
Then
J→E
ClrHome
Output(5,2,&quot;NEW HIGH SCORE&quot;)
Pause
End
Pause
Menu(&quot;GAME OVER&quot;,&quot;PLAY AGAIN&quot;,H,&quot;QUIT&quot;,S)
End
End
ClrHome
Output(B,1,&quot;[&quot;)
Output(X,Y,&quot;+&quot;)
End
Goto U
Lbl H
1→B
0→G
1→O
1→P
0→J
Goto F
Lbl S
0→J
ClrHome
Stop
Lbl K
Output(5,2,&quot;HIGH SCORE:&quot;)
Output(5,14,E)
Pause
Goto F
&lt;/pre&gt;



</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/06/27/itunes-com-api-c-playlists</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/06/27/itunes-com-api-c-playlists/"/>
    <title>iTunes COM API C#: Playlists</title>
    <updated>2009-06-27T00:00:00-04:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;After a comment on my original iTunes COM API post inquiring about Playlists,
I decided to revisit that part of the project. I had originally intended to
include this in the first post, but it was more difficult than I had first
though. Here are some code snippets to get you started:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;
Create a ComboBox listing the names of all the playlists:

&lt;pre class=&quot;prettyprint&quot;&gt;
foreach (IITPlaylist pl in app.LibrarySource.Playlists)
{
    comboBox1.Items.Add(pl.Name);
}
&lt;/pre&gt;
    
Notes:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
Retrieves all playlists in iTunes
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
Playing One:

&lt;pre class=&quot;prettyprint&quot;&gt;
private void button1_Click(object sender, EventArgs e)
{
    IITPlaylist pl = app.LibrarySource.Playlists[comboBox1.SelectedIndex + 1];
    pl.PlayFirstTrack();
}
&lt;/pre&gt;

Notes:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
Could also be done on ComboBox1.SelectedIndexChanged()
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
+1 Accounts for differences in indexes
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;This is just some basic examples, for tons more information, check out &lt;a href=&quot;http://developer.apple.com/sdk/&quot;&gt;this
link&lt;/a&gt;. You have to login in with your iTunes account, but look for &quot;iTunes
COM for Windows SDK (ZIP)&quot; If you have trouble locating this file, email me
and I can get it to you. It includes iTunesCOM.chm, which is the de-facto
resource for all of this information. Between my example code (Here and
&lt;a href=&quot;http://www.ohscope.com/2009/04/itunes-com-api-in-c.html&quot;&gt;here&lt;/a&gt;), you should be able to preform many of the iTunes functions. As
always, comment if you have any troubles.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/06/16/getting-angle</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/06/16/getting-angle/"/>
    <title>Getting an Angle</title>
    <updated>2009-06-16T00:00:00-04:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;So probably the biggest part of constructing a balancing robot, or scooter, is
knowing what angle it is in relation to the ground. From this, you can
determine how much you need to compensate. The balancing system in my Segway
consists of two sensors:&lt;/p&gt;

&lt;p&gt;ADXRS614 Gyro 50 °/s&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.sparkfun.com/products/9057&quot;&gt;&lt;img src=&quot;/images/2009-06-16/gyro.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ADXL203CE Accelerometer +/- 1.5g&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.sparkfun.com/products/844&quot;&gt;&lt;img src=&quot;/images/2009-06-16/accel.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*Above pictures from &lt;a href=&quot;http://www.sparakfun.com&quot;&gt;Sparkfun Electronics&lt;/a&gt; *&lt;/p&gt;

&lt;p&gt;As I have explained in a &lt;a href=&quot;http://www.ohscope.com/2009/02/b-b-b-balancing.html&quot;&gt;previous post&lt;/a&gt;, both of these sensors are
required to determine an accurate angle measurement. In my code so far, these
are combined using a Complementary Filter. A great resource for coding a
complementary filter on the Arduino can be found &lt;a href=&quot;http://www.mikroquad.com/bin/view/Research/ComplementaryFilter&quot;&gt;here&lt;/a&gt;. The hardest part
that I found using this code is the Coefficients, which are not explained. I
have determined, however, how to calculate these and get a working angle
output. The 2 Coefficients in the program are 28.783 for the Gyro and 10.78
for the Accelerometer.&lt;/p&gt;

&lt;p&gt;To calculate this for the Gyro:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get the mv/°/s value for your Gyro from the Datasheet&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;-----25&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Divide by 1000 (Milli volts in a volt)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;-----0.025&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Divide by 5 (Voltage of the Analog Reference)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;-----.005&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Divide by .0174532925 (Radians in a Degree)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;-----0.2864789&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take the Inverse of that (1/x)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;-----3.49&lt;/p&gt;

&lt;p&gt;And there is your answer, 3.49. You would replace the 28.783 in the formula
for this.&lt;/p&gt;

&lt;p&gt;To calculate this for the Accelerometer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get the mv/g value for your Accelerometer from the Datasheet&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;-----1000&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Divide by 1000 (Milli volts in a volt)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;-----1&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Divide by 5 (Voltage of the Analog Reference)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;-----0.2&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take the Inverse&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;-----5&lt;/p&gt;

&lt;p&gt;I'm not so sure on this one, but it seems to work. You would replace the 10.78
with this.&lt;/p&gt;

&lt;p&gt;You can also replace the Voltage, in this case 5v, or the 1024 in the Formula,
depending on your supply voltage or Analog Port Resolution.&lt;/p&gt;

&lt;p&gt;When I put this all together in my test code, I get a solid, seemingly
accurate angle measurement.&lt;/p&gt;

&lt;p&gt;Next up - PID!&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/04/02/itunes-com-api-in-c</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/04/02/itunes-com-api-in-c/"/>
    <title>iTunes COM API in C#</title>
    <updated>2009-04-02T00:00:00-04:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;I decided that I would post a little guide to some of the things that I have
learned in using the iTunes COM API in C#. It's not very well documented, and
I though I could help.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Initialization:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, you have to add a Reference and Using&lt;/p&gt;

&lt;p&gt;Right click on References, and click &quot;Add Refrence&quot;&lt;/p&gt;

&lt;p&gt;Switch to the COM tab and find &quot;iTunes *.** Type Library, and click add.&lt;/p&gt;

&lt;p&gt;At the top of your code, add &quot;Using iTunesLib&quot;&lt;/p&gt;

&lt;p&gt;Finally, add these two lines of code under the class of the form, outside of
any function:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
delegate void Router(object arg);
iTunesApp app = new iTunesAppClass();
&lt;/pre&gt;


&lt;p&gt;The Router helps in handling the iTunes Events, and &quot;app&quot; is what you will use
to do anything with iTunes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Events:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You'll need to attach at least one event for a program that controls iTunes,
to see when something changes in iTunes, and here is some code for that:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
app.OnPlayerPlayEvent += new _IiTunesEvents_OnPlayerPlayEventEventHandler(delegate(object o)
  {
      this.Invoke(new Router(app_OnPlayerPlayEvent), o);
  });
&lt;/pre&gt;


&lt;p&gt;This should be put under InitializeComponent(), and will call
app_OnPlayerPlayEvent when it is activated.&lt;/p&gt;

&lt;p&gt;**Controls:&lt;/p&gt;

&lt;p&gt;**These are pretty simple, just call them to control iTunes:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
app.Play();

app.Pause();

app.NextTrack();

app.PreviousTrack();

app.Stop():
&lt;/pre&gt;


&lt;p&gt;There are a few others, but these are the big ones.&lt;/p&gt;

&lt;p&gt;**Track Information:&lt;/p&gt;

&lt;p&gt;**iTunes provides pretty much all of the information about a playing track,
there is a lot more than I mention here, I reccomend experimentation.&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
IITTrack track = app.CurrentTrack;

Albumlbl.Text = track.Album;

Artistlbl.Text = track.Artist;

Tracklbl.Text = track.Name;
&lt;/pre&gt;


&lt;p&gt;These will populate the labels with the track (at the time) that is playing or
paused. It must be refreshed to update the information.&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
IITArtworkCollection Art1 = track.Artwork;

IITArtwork Art2 = Art1[1];

Art2.SaveArtworkToFile(&quot;c:\\temp\\Album.jpg&quot;);

Stream r = File.Open(&quot;c:\\temp\\Album.jpg&quot;, FileMode.Open);

Image temp = Image.FromStream(r);

r.Close();

pictureBox1.Image = temp;

SetImage(pictureBox1);
&lt;/pre&gt;


&lt;p&gt;This is a big one, it will allow you to put the Album Art of the currently
playing track in a Picture Box. I recommend checking the Art1[] or doing this
in a Try...Catch to avoid errors when a song does not have art. You will also
need these, also, for resizing:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.dreamincode.net/code/snippet2376.htm&quot;&gt;Original Link&lt;/a&gt;&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
public Size GenerateImageDimensions(int currW, int currH, int destW, int destH)
{
    //double to hold the final multiplier to use when scaling the image
    double multiplier = 0;
    //string for holding layout
    string layout;
    //determine if it's Portrait or Landscape
    
    if (currH &gt; currW) layout = &quot;portrait&quot;;
    else layout = &quot;landscape&quot;;
    
    switch (layout.ToLower())
    {
        case &quot;portrait&quot;:
            //calculate multiplier on heights
            if (destH &gt; destW)
            {
                multiplier = (double)destW / (double)currW;
            }
            else
            {
                multiplier = (double)destH / (double)currH;
            }
            break;
        case &quot;landscape&quot;:
            //calculate multiplier on widths
            if (destH &gt; destW)
            {
                multiplier = (double)destW / (double)currW;
            }
            else
            {
                multiplier = (double)destH / (double)currH;
            }
            break;
    }
    //return the new image dimensions
    return new Size((int)(currW * multiplier), (int)(currH * multiplier));
}
//Resize the image
private void SetImage(PictureBox pb)
{
    try
    {
        //create a temp image
        Image img = pb.Image;

        //calculate the size of the image
        Size imgSize = GenerateImageDimensions(img.Width, img.Height, this.pictureBox1.Width, this.pictureBox1.Height);

        //create a new Bitmap with the proper dimensions
        Bitmap finalImg = new Bitmap(img, imgSize.Width, imgSize.Height);

        //create a new Graphics object from the image
        Graphics gfx = Graphics.FromImage(img);

        //clean up the image (take care of any image loss from resizing)
        gfx.InterpolationMode = InterpolationMode.HighQualityBicubic;

        //empty the PictureBox
        pb.Image = null;

        //center the new image
        pb.SizeMode = PictureBoxSizeMode.CenterImage;

        //set the new image
        pb.Image = finalImg;
    }
    catch (System.Exception e)
    {
        //MessageBox.Show(e.Message);
    }
}
&lt;/pre&gt;


&lt;p&gt;Another thing that you can do is a progress bar for Track Time. I have Timer1
set for 1 second intervals. This is not totally tested, your mileage may vary:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
void Timer1Tick(object sender, EventArgs e)
{
    IITTrack track = app.CurrentTrack;
    progress.Maximum = track.Duration;
    progress.Value = app.PlayerPosition;
    if (track.Duration != oldtrack)
    {
        if (track.Name != oldname)
        {
            NewSong();
        }
        else
        {
            oldname = track.Name;
        }
    }
    else
    {
        oldtrack = track.Duration;
    }
}
&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;REST Album Art and Lyrics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finally, I have these few functions that will use Amazon and LyricWiki to find
Album Art and Lyrics of a playing song. I would recommend running them in a
BackgroundWorker, to prevent a program from locking up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lyrics:&lt;/strong&gt;&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
private static string GetLyrics(string Artist, string Title)
{
    StringBuilder lyric = new StringBuilder();  //Build a new string
    lyric.Append(&quot;http://lyricwiki.org/api.php?func=getSong&amp;artist=&quot;); //Add base URL
    lyric.Append(Artist);
    lyric.Append(&quot;&amp;song=&quot;);
    lyric.Append(Title);
    lyric.Append(&quot;&amp;fmt=xml&quot;);
    WebRequest requestlyr = WebRequest.Create(lyric.ToString()); //prepare web request
    StreamReader responseStreamlyr = new StreamReader(requestlyr.GetResponse().GetResponseStream()); //prepare responese holder
    string responselyr = responseStreamlyr.ReadToEnd(); //fill up response
    responseStreamlyr.Close(); //Close stream
    string lyrics = XmlParse_general(responselyr.ToString(), &quot;lyrics&quot;); //parse the XML
    return lyrics;
}

private static string XmlParse_general(string Url, string type)    //XML parse Function
{
    XmlTextReader xmlrt1 = new XmlTextReader(new StringReader(Url));
    while (xmlrt1.Read())
    {
        //Trace.Write(&quot;Node Type&quot;, xmlrt1.NodeType.ToString());
        string strNodeType = xmlrt1.NodeType.ToString();
        string strName = xmlrt1.Name;
        if (strNodeType == &quot;Element&quot; &amp;&amp; strName == type)
        {
            xmlrt1.Read();
            return xmlrt1.Value; //Return output
        }
    } 
    return &quot;&quot;;
}
&lt;/pre&gt;


&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Album Art&lt;/strong&gt;:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
private string AlbumURL(string artist, string album)

{
    StringBuilder art = new StringBuilder();  //Build a new string
    art.Append(&quot;http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&amp;Version=2005-03-23&amp;Operation=ItemSearch&amp;ContentType=text%2Fxml&amp;SubscriptionId=09XAA8GD0PQVCC8KR5G2&amp;SearchIndex=Music&amp;Artist=&quot;);   //Add base URL

    art.Append(artist);
    art.Append(&quot;&amp;Keywords=&quot;);
    art.Append(album);
    art.Append(&quot;&amp;ResponseGroup=Images&quot;);
    WebRequest requestart = WebRequest.Create(art.ToString()); //prepare web request

    StreamReader responseStreamart = new StreamReader(requestart.GetResponse().GetResponseStream()); //prepare responese holder
    string responseart = responseStreamart.ReadToEnd(); //fill up response
    responseStreamart.Close(); //Close stream
    string url = XML_image(responseart.ToString()); //parse the XML
    return url;
}

private static string XML_image(string xml)
{
    XmlTextReader reader = new XmlTextReader(new StringReader(xml));
    reader.ReadToFollowing(&quot;LargeImage&quot;);
    reader.ReadToFollowing(&quot;URL&quot;);
    reader.Read();
    return reader.Value;
}
&lt;/pre&gt;


&lt;p&gt;If anyone has any questions or needs help getting these going, especially the
REST functions, or has any suggested improvements, contact me, I'd be glad to
help.&lt;/p&gt;

&lt;p&gt;Goodbye, and Good Luck!&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/03/18/bitly-c-api-update</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/03/18/bitly-c-api-update/"/>
    <title>Bit.ly C# API Update</title>
    <updated>2009-03-18T00:00:00-04:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;I decided to update my Bit.ly API DLL in C#, thanks to &lt;a href=&quot;http://twitter.com/codemypantsoff&quot;&gt;@codemypantsoff&lt;/a&gt;.
The only new function that I added was the ability to get the User who
shortened a URL from the Short URL or from the Hash. I figured it was also a
good time to move all my stuff from my Google Sites page onto a blog post, so
here it goes.&lt;/p&gt;

&lt;p&gt; Calls:&lt;/p&gt;

&lt;p&gt;MetaH - Retrieves the metadata from a hash&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
string a = API.Bit(&quot;bitlyapidemo&quot;, &quot;R_0da49e0a9118ff35f52f629d2d71bf07&quot;, &quot;epicdiggnation&quot;, &quot;MetaH&quot;);
Console.WriteLine(a);
&lt;/pre&gt;


&lt;p&gt;MetaU - Retrieves the metadata from a Short Url&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
string b = API.Bit(&quot;bitlyapidemo&quot;, &quot;R_0da49e0a9118ff35f52f629d2d71bf07&quot;,&quot;http://bit.ly/1RmnUT&quot;, &quot;MetaU&quot;);
Console.WriteLine(b);
&lt;/pre&gt;


&lt;p&gt;ExpandH - Returns the Expanded url from a hash&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
string c = API.Bit(&quot;bitlyapidemo&quot;, &quot;R_0da49e0a9118ff35f52f629d2d71bf07&quot;,&quot;epicdiggnation&quot;, &quot;ExpandH&quot;);
Console.WriteLine(c);
&lt;/pre&gt;


&lt;p&gt;ExpandU - Returns the Expanded url from a Short Url&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
string d = API.Bit(&quot;bitlyapidemo&quot;, &quot;R_0da49e0a9118ff35f52f629d2d71bf07&quot;,&quot;http://bit.ly/1RmnUT&quot;, &quot;ExpandU&quot;);
Console.WriteLine(d);
&lt;/pre&gt;


&lt;p&gt;Shorten - Returns a Shortened URL from a long URL&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
string e = API.Bit(&quot;bitlyapidemo&quot;, &quot;R_0da49e0a9118ff35f52f629d2d71bf07&quot;,&quot;http://cnn.com&quot;, &quot;Shorten&quot;);
Console.WriteLine(e);
&lt;/pre&gt;


&lt;p&gt;ClicksH - Returns number of clicks from a hash&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
string f = API.Bit(&quot;bitlyapidemo&quot;, &quot;R_0da49e0a9118ff35f52f629d2d71bf07&quot;,&quot;epicdiggnation&quot;, &quot;ClicksH&quot;);
Console.WriteLine(f);
&lt;/pre&gt;


&lt;p&gt;ClicksU - Returns number of clicks from a Short Url&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
string g = API.Bit(&quot;bitlyapidemo&quot;, &quot;R_0da49e0a9118ff35f52f629d2d71bf07&quot;,&quot;http://bit.ly/1RmnUT&quot;, &quot;ClicksU&quot;);
Console.WriteLine(g);
&lt;/pre&gt;


&lt;p&gt;UserU - Returns the User who shortened the URL from a Short Url&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
string h = API.Bit(&quot;bitlyapidemo&quot;, &quot;R_0da49e0a9118ff35f52f629d2d71bf07&quot;,&quot;http://bit.ly/1RmnUT&quot;, &quot;UserU&quot;);
Console.WriteLine(h);
&lt;/pre&gt;


&lt;p&gt;UserH - Returns the User who shortened the URL from a Hash&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
string i = API.Bit(&quot;bitlyapidemo&quot;, &quot;R_0da49e0a9118ff35f52f629d2d71bf07&quot;,&quot;epicdiggnation&quot;, &quot;UserH&quot;);
Console.WriteLine(i);
&lt;/pre&gt;


&lt;p&gt;Console Application sample code:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Bitly;

namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            string a = API.Bit(&quot;bitlyapidemo&quot;,&quot;R_0da49e0a9118ff35f52f629d2d71bf07&quot;, &quot;http://cnn.com&quot;, &quot;Shorten&quot;);

            Console.WriteLine(a);

            Console.Read();

        }

    }

}
&lt;/pre&gt;


&lt;p&gt;&lt;a href=&quot;http://sites.google.com/site/bitlyapp/Home/Bitly.dll?attredirects=0&quot;&gt;DLL Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://sites.google.com/site/bitlyapp/Home/bitlydll_source.zip?attredirects=0&quot;&gt;Source Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If anyone would like me to update my WPF sample app or has a feature request,
go ahead and contact me.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/03/08/quick-update</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/03/08/quick-update/"/>
    <title>Quick Update</title>
    <updated>2009-03-08T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;Well, I haven't updated recently, mostly because I'm kind of frozen in the
process. But some good things happened and I have quite a bit of money now.
Expect updates soon where I can actually get to building and debugging this
thing. I'm getting ready to order the motor controller, batteries, and a
Gyro/Accel, so I'll be able to actually start.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/02/24/serial-port-on-iphone-with-minicom</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/02/24/serial-port-on-iphone-with-minicom/"/>
    <title>Serial Port on the iPhone with Minicom</title>
    <updated>2009-02-24T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;This will be a little tutorial on how to set up Minicom on your iPhone or iPod
Touch to view incoming serial data. I hope to continue this with Python or
maybe even Obj-C. Click on (some) pictures to enlarge.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Materials&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;Jailbroken iPhone or iPod Touch&lt;/p&gt;

&lt;p&gt;Charge Connector (&lt;a href=&quot;http://www.rush2112.net/mkportal/modules/oscommerce/product_info.php?products_id=34&amp;amp;osCsid=94c3cd52467cec105ae9e565a04014c5&quot;&gt;MJS&lt;/a&gt; or &lt;a href=&quot;http://www.sparkfun.com/commerce/categories.php?c=101&quot;&gt;Sparkfun&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Serial Data Source (Arduino in my case)&lt;/p&gt;

&lt;p&gt;Computer/Wifi network&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.chiark.greenend.org.uk/%7Esgtatham/putty/&quot;&gt;Putty&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install Minicom, Terminal OpenSSH, and Toggle SSH from Cydia&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; &lt;em&gt;&lt;strong&gt;This step should be pretty self-explanitory, If you can't do this and can't
 google, then you probably shouldn't continue on.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SSH into your iPhone&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; &lt;strong&gt;Obtain your IP Address from Settings or the SBSettings App.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; &lt;img src=&quot;/images/2009-02-24/IP.png&quot; alt=&quot;ip&quot; /&gt;&lt;/p&gt;

&lt;p&gt; &lt;strong&gt;Start up the SSH Server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; &lt;img src=&quot;/images/2009-02-24/ssh.png&quot; alt=&quot;ssh&quot; /&gt;&lt;/p&gt;

&lt;p&gt; Go into Putty, enter the IP, and create a new SSH Session&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;/images/2009-02-24/putty_connect.jpg&quot;&gt;
 &lt;img src=&quot;/images/2009-02-24/putty_connect.jpg&quot; alt=&quot;Putty Connection Screen&quot; height=&quot;300&quot; /&gt;
 &lt;/a&gt;&lt;/p&gt;

&lt;p&gt; On the &quot;Potential Security Breach,&quot; click Yes&lt;/p&gt;

&lt;p&gt; And Login as Root with Password &quot;Alpine&quot;&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;/images/2009-02-24/login_as.jpg&quot;&gt;
 &lt;img src=&quot;/images/2009-02-24/login_as.jpg&quot; alt=&quot;Login Screen&quot; height=&quot;300&quot; /&gt;
 &lt;/a&gt;&lt;/p&gt;

&lt;p&gt; And Your In!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Make a Directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; Do a &quot;CD ..&quot; twice, which whould put you in the root of the filesystem at /&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;/images/2009-02-24/after_login.jpg&quot;&gt;
 &lt;img src=&quot;/images/2009-02-24/after_login.jpg&quot; alt=&quot;After Login&quot; height=&quot;300&quot; /&gt;
 &lt;/a&gt;&lt;/p&gt;

&lt;p&gt; Now do &quot;CD usr&quot;&lt;/p&gt;

&lt;p&gt; And &quot;MkDir etc&quot;&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;/images/2009-02-24/mkdir_etc.jpg&quot;&gt;
 &lt;img src=&quot;/images/2009-02-24/mkdir_etc.jpg&quot; alt=&quot;mkdir&quot; height=&quot;300&quot; /&gt;
 &lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start up Minicom in configuration mode&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; Simple: &quot;Minicom -s&quot;&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;/images/2009-02-24/minicom_dash_s.jpg&quot;&gt;
 &lt;img src=&quot;/images/2009-02-24/minicom_dash_s.jpg&quot; alt=&quot;Starting Minicom&quot; height=&quot;300&quot; /&gt;
 &lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Setup iPhone Port&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; Arrow down 2, to Serial port setup and press enter&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;/images/2009-02-24/serial_port_settings.jpg&quot;&gt;
 &lt;img src=&quot;/images/2009-02-24/serial_port_settings.jpg&quot; alt=&quot;Serial Port Settings&quot; height=&quot;300&quot; /&gt;
 &lt;/a&gt;&lt;/p&gt;

&lt;p&gt; First, press A and change &quot;/dev/ttyS1&quot; to &quot;/dev/tty.iap&quot; and press Enter&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;/images/2009-02-24/tty_dot_iap.jpg&quot;&gt;
 &lt;img src=&quot;/images/2009-02-24/tty_dot_iap.jpg&quot; alt=&quot;Changing to tty.iap&quot; height=&quot;300&quot; /&gt;
 &lt;/a&gt;&lt;/p&gt;

&lt;p&gt; Then press E and adjust to whatever serial source you are using. I used 19200
 8N1 for my Arduino.&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;/images/2009-02-24/comm_parameters.jpg&quot;&gt;
 &lt;img src=&quot;/images/2009-02-24/comm_parameters.jpg&quot; alt=&quot;Comm Parameters&quot; height=&quot;300&quot; /&gt;
 &lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Save and Exit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; Press Enter until you return to the main screen, arrow down to &quot;Save setup
 as dfl,&quot; and press enter.&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;/images/2009-02-24/save_setup.jpg&quot;&gt;
 &lt;img src=&quot;/images/2009-02-24/save_setup.jpg&quot; alt=&quot;Save Setup&quot; height=&quot;300&quot; /&gt;
 &lt;/a&gt;&lt;/p&gt;

&lt;p&gt; And press &quot;Exit from Minicom&quot;&lt;/p&gt;

&lt;p&gt; You can now close the Putty Session.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hardware Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; This will vary depending on your Serial input and iPod connector, but here's
 mine:&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;/images/2009-02-24/hardware.jpg&quot;&gt;
 &lt;img src=&quot;/images/2009-02-24/hardware.jpg&quot; alt=&quot;Hardware&quot; height=&quot;300&quot; /&gt;
 &lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;/images/2009-02-24/circuit.jpg&quot;&gt;
 &lt;img src=&quot;/images/2009-02-24/circuit.jpg&quot; alt=&quot;Circuit&quot; height=&quot;300&quot; /&gt;
 &lt;/a&gt;&lt;/p&gt;

&lt;p&gt; In this case, I have the Serial TX from the Arduino connected to the RX of the
 iPod through a 1K resistor, for 5v to 3.3v. I also have the common ground
 connected. The Arduino is reading data from a Wii nunchuck through a &lt;a href=&quot;http://store.fungizmos.com/index.php?main_page=product_info&amp;amp;cPath=65&amp;amp;products_id=212&quot;&gt;Wiichuck
 Board&lt;/a&gt; and sending it out at 19200 Bps. Remember level changing for 5v
 and 12v sources!!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Read the Data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; Power on your serial source.&lt;/p&gt;

&lt;p&gt; Open up the Terminal on the iPhone, type in &quot;Minicom,&quot; and press enter.&lt;/p&gt;

&lt;p&gt; You should see serial data streaming in.&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;/images/2009-02-24/info.png&quot;&gt;
 &lt;img src=&quot;/images/2009-02-24/info.png&quot; alt=&quot;Serial Info Coming in&quot; height=&quot;300&quot; /&gt;
 &lt;/a&gt;&lt;/p&gt;

&lt;p&gt; And your done!&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;PS. If anyone has experience with graphical Python on the iPhone, I would love
to collaborate on an app. I have tested and the Python serial library will run
on the iPhone. Contact Me.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/02/21/research-paper</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/02/21/research-paper/"/>
    <title>Research Paper</title>
    <updated>2009-02-21T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;Well, here is a research paper I wrote for English on Open Source Hardware&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://bit.ly/OpenSourceHardware&quot;&gt;Paper&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also- Google Docs sucks for this type of application.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/02/19/great-motor-controller-link</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/02/19/great-motor-controller-link/"/>
    <title>Great Motor Controller Link</title>
    <updated>2009-02-19T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.robowars.org/wikka/EscCommerical&quot;&gt;Here&lt;/a&gt; is a great link summarizing ESC's for Battlebots. The only downside
is that they all take RC Servo signals instead of PWM, which I believe will be
more precise in my application. Right now I am mostly considering the RS80D or
the IBC.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/02/19/battery-technology</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/02/19/battery-technology/"/>
    <title>Battery Technology</title>
    <updated>2009-02-19T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;So now that I have motors, I will need to purchase batteries to power this
thing. I am considering three different battery technologies for this system.&lt;/p&gt;

&lt;p&gt;A123 Lithium&lt;/p&gt;

&lt;p&gt;These are the batteries used by Daniel Fukuba in his scooter based on Trevor
Blackwell's design. Dewalt now sells 36v batteries using this technology, and
a matching charger. If I can use these batteries and charger while bypassing
the internal current limiting, I should have a fairly simple battery setup
with ample current capacity. For the final project I would plan on 3 of these
packs in parallel.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.slkelectronics.com/DeWalt/packs.htm&quot;&gt;Dissecting 36v Dewalt pack&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/maubrowncow/2959727712/&quot;&gt;Short video of Daniel Fukuba's&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sealed Lead Acid (SLA)&lt;/p&gt;

&lt;p&gt;Although these batteries are large and heavy, they allow for large amounts of
current draw and are the least expensive. They are also the cheapest to charge
and maintain.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.robotmarketplace.com/products/0B-PS-1250F1.html&quot;&gt;Example Battery&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;NiMH packs&lt;/p&gt;

&lt;p&gt;This system for batteries would be easier to charge than A123 cells and
provide ample current. This is also the type of batteries that Trevor
Blackwell recommends.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://tlb.org/scooterbuild.html&quot;&gt;Trevor Blackwell's page&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These are the basic options that I am considering, I would love to hear any
opinions on this!&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/02/18/my-motors-came</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/02/18/my-motors-came/"/>
    <title>My Motors Came!!</title>
    <updated>2009-02-18T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;Received the motors that I purchased off of Ebay Today&lt;/p&gt;

&lt;p&gt;Pics:&lt;/p&gt;

&lt;p&gt;The Box&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/images/2009-02-18/wheels_in_box.JPG&quot;&gt;
&lt;img src=&quot;/images/2009-02-18/wheels_in_box.JPG&quot; alt=&quot;Wheels in the box&quot; height=&quot;300&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Whole System&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/images/2009-02-18/system.JPG&quot;&gt;
&lt;img src=&quot;/images/2009-02-18/system.JPG&quot; alt=&quot;System&quot; height=&quot;300&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Female Motor Connector&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/images/2009-02-18/connector.JPG&quot;&gt;
&lt;img src=&quot;/images/2009-02-18/connector.JPG&quot; alt=&quot;Motor Connector&quot; height=&quot;300&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Controller&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/images/2009-02-18/controller.JPG&quot;&gt;
&lt;img src=&quot;/images/2009-02-18/controller.JPG&quot; alt=&quot;The Controller&quot; height=&quot;300&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now onto the problem. The motors are great, and definitely worth the price. It
also came with a motor controller though. This controller has 8 55V 110A
[IRFP064N][9] HEXFET's. The only thing is that I have no idea how I would go
about using this controller. Here is a Rundown:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;H8/532 Main IC][10]&lt;/p&gt;

&lt;p&gt;4 [IR2110S IC's][11]&lt;/p&gt;

&lt;p&gt;2 GPS 35DAA010AKG ?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/images/2009-02-18/joy_connector.JPG&quot;&gt;
&lt;img src=&quot;/images/2009-02-18/joy_connector.JPG&quot; alt=&quot;14 pin Joystick Connector&quot; height=&quot;300&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any help would be appreciated in this matter. Not to mention that it would
shave ~$300 off of the cost of this project. Thank You!&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/02/17/b-b-b-balancing</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/02/17/b-b-b-balancing/"/>
    <title>B-B-B-Balancing</title>
    <updated>2009-02-17T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;So first off, a Segway needs to know at what angle it is to the ground. This
can be accomplished surprisingly easily.&lt;/p&gt;

&lt;p&gt;Their are basically two types of sensor used for sensing tilt in a robotics
application, the Gyro and the Accelerometer. Both have their advantages and
disadvantages, and both must be used for reliable tilt data.&lt;/p&gt;

&lt;p&gt;Accelerometer - Used in the Nintendo Wiimote and Nunchuck&lt;/p&gt;

&lt;p&gt;Pros&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Doesn't Drift&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Outputs Acceleration due to gravity&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Cons&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Very prone to vibration&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Not very precise&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also senses the acceleration of the Scooter&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Gyro - Used in Helicopters&lt;/p&gt;

&lt;p&gt;Pros&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Very precise&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Very smooth input&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Provides angular rate&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Cons&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Drifts - A LOT!&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So what do you do?&lt;/p&gt;

&lt;p&gt;Combine these two inputs so that you can get a solid, quickly responding
signal, that doesn't drift. There are two common ways to accomplish this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Kalman_filter&quot;&gt;Kalman Filter&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The Kalman filter is a mathematically complex filter that provides a
theoretically ideal combination and smoothing of sensor signals.&lt;/p&gt;

&lt;p&gt;Implemented on the Arduino &lt;a href=&quot;http://diydrones.com/profiles/blogs/705844:BlogPost:23188&quot;&gt;Here&lt;/a&gt;&lt;/p&gt;

&lt;object width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/1DDEH2n2_hY?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/1DDEH2n2_hY?fs=1&amp;amp;hl=en_US&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;


&lt;p&gt;Might be tried, but not until a working system is created&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Angle Complementary Filter&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Uses a time bias to determine which sensor to trust&lt;/p&gt;

&lt;p&gt;Described and implemented in the SegSpecs.zip file &lt;a href=&quot;http://web.mit.edu/first/segway/&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Easier to implement and cancels out drift and vibration.&lt;/p&gt;

&lt;object width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/HzkSJKIBofs?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/HzkSJKIBofs?fs=1&amp;amp;hl=en_US&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;



</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/02/16/parts-parts-parts</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/02/16/parts-parts-parts/"/>
    <title>Parts, Parts, Parts</title>
    <updated>2009-02-16T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;So here we go. Here is a list of parts I'm planning on using for my Segway
project.&lt;/p&gt;

&lt;p&gt;Processor:&lt;/p&gt;

&lt;p&gt;Arduino Variant&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.sparkfun.com/commerce/product_info.php?products_id=8957&quot;&gt;Funnel IO&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Motors:&lt;/p&gt;

&lt;p&gt;Similar to NPC T-64&lt;/p&gt;

&lt;p&gt;Bought off of Ebay for $195 + $40 shipping&lt;/p&gt;

&lt;p&gt;With included wheels&lt;/p&gt;

&lt;p&gt;Gyro:&lt;/p&gt;

&lt;p&gt;75 degree/sec 5v&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.sparkfun.com/commerce/product_info.php?products_id=394&quot;&gt;ADXRS401&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Accel:&lt;/p&gt;

&lt;p&gt;+/- 1.5g 5v&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.sparkfun.com/commerce/product_info.php?products_id=844&quot;&gt;ADXL203CE&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wireless Programming and Debugging:&lt;/p&gt;

&lt;p&gt;Xbee pair 1mw chip antenna&lt;/p&gt;

&lt;p&gt;Bought off of Ebay for $44 Shipped&lt;/p&gt;

&lt;p&gt;Motor Controller:&lt;/p&gt;

&lt;p&gt;Dual 50 Amp with Servo inputs&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.robotmarketplace.com/products/0-IBC1.html&quot;&gt;IBC Dual Speed Controller&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Batteries:&lt;/p&gt;

&lt;p&gt;Unsure of this as of yet, NiMh, SLA, or A123 Lithium&lt;/p&gt;

&lt;p&gt;Steering:&lt;/p&gt;

&lt;p&gt;Preferably Lean, not yet solidified.&lt;/p&gt;

&lt;p&gt;Links:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://scooterlabs.org/&quot;&gt;Scooter Labs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://web.mit.edu/first/segway/&quot;&gt;MIT FIRST Team&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://tlb.org/scooter.html&quot;&gt;Trevor Blackwell Scooter 1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://tlb.org/scooter2.html&quot;&gt;Trevor Blackwell Scooter 2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://tlb.org/scooterbuild.html&quot;&gt;Trevor Blackwell Scooter Build&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://members.optusnet.com.au/a4x4kiwi/scooter/&quot;&gt;Open Source Self Balancing Scooter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.netcraft.com.au/geoffrey/meta/&quot;&gt;Meta the Self Balancing Scooter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.betterthaneveryone.com/&quot;&gt;Clint Rutkas c# Balancing Skateboard&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My inspiration for smooth balancing:
&lt;em&gt;Video has since been removed&lt;/em&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://www.ohscope.com/2009/02/16/overview</id>
    <link type="text/html" rel="alternate" href="http://www.ohscope.com/2009/02/16/overview/"/>
    <title>Overview</title>
    <updated>2009-02-16T00:00:00-05:00</updated>
    <author>
      <name>Kerry Snyder</name>
      <uri>http://www.ohscope.com</uri>
    </author>
    <content type="html">&lt;p&gt;What I'm Doing: Building a Self-Balancing Scooter (Segway) for My Senior
Project.&lt;/p&gt;

&lt;p&gt;Why: Fun, Challenge, Help get into college&lt;/p&gt;

&lt;p&gt;How: Well, I guess you'll have to just wait for that part.&lt;/p&gt;
</content>
  </entry>
  
 
</feed>

