<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kyle Boddy</title>
	<atom:link href="http://www.kyleboddy.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kyleboddy.com</link>
	<description>Entrepreneur, Hacker, Biomechanics Researcher, Baseball Lover.</description>
	<lastBuildDate>Thu, 08 Sep 2011 00:33:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Why Understanding Particle Physics is Vital to Understanding Baseball Pitching</title>
		<link>http://www.kyleboddy.com/2011/09/07/why-understanding-particle-physics-is-vital-to-understanding-baseball-pitching/</link>
		<comments>http://www.kyleboddy.com/2011/09/07/why-understanding-particle-physics-is-vital-to-understanding-baseball-pitching/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 00:33:22 +0000</pubDate>
		<dc:creator>kyleb</dc:creator>
				<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[baseball pitching]]></category>
		<category><![CDATA[physics]]></category>

		<guid isPermaLink="false">http://www.kyleboddy.com/?p=449</guid>
		<description><![CDATA[Baseball coaches and gurus are constantly trying to simplify the baseball pitching motion to sell services and products. To me, this is intellectually dishonest and does a very large disservice to the chaotic nature of kinesiology and biomechanics. The best way I can explain this is by letting Richard Feynman do it. Since I can't [...]]]></description>
			<content:encoded><![CDATA[<p>Baseball coaches and gurus are constantly trying to simplify the baseball pitching motion to sell services and products. To me, this is intellectually dishonest and does a very large disservice to the chaotic nature of kinesiology and biomechanics. The best way I can explain this is by letting Richard Feynman do it. Since I can't figure out how to embed a YouTube video at a certain time, <a href="http://www.youtube.com/watch?v=DZGINaRUEkU&amp;feature=player_detailpage#t=125s">click here for the explanation in the latest Symphony of Science video</a>.</p>
<p>The transcript of his short speech is:</p>
<blockquote><p>"It's very hard to imagine all the crazy things that things really are like. 'Electrons act like waves,' no they don't exactly. 'They act like particles,' no they don't exactly."</p></blockquote>
<p>People get frustrated when statements like this are made! Feynman's rebuttal was to say that if he simplified the argument for you any further, he'd be lying to you about how it works. The same holds true in baseball pitching and kinesiology in general.</p>
<p>First of all, most baseball coaches are very ignorant when it comes to the actual, very real<strong> classical mechanics</strong> of throwing a baseball. Example statements by these coaches that are said when trying to fix someone's "mechanics" are:</p>
<ul>
<li>Bend your back when you release the ball</li>
<li>Stride farther to increase fastball velocity</li>
<li>Grab some dirt on the way down</li>
</ul>
<p>But even "enlightened" coaches will say psuedo-scientific things like:</p>
<ul>
<li>Scapular loading stretches out the muscles in the shoulder and increases the stretch-shortening cycle</li>
<li>The faster the hips and shoulders turn, the more velocity can be imparted to the baseball</li>
<li>Your muscles are like a rubber band - stretch them out before contracting them to throw harder</li>
</ul>
<p>The body is more than a series of levers, pulleys, and rope tied together, just like our universe is more than the simple answer of 12 particles of matter and 4 forces of nature. It's about the interaction between these items that we seek to understand - something we're very far away from in both disciplines, I might add. The famous <a href="http://en.wikipedia.org/wiki/Double-slit_experiment">double-slit experiment</a> demonstrates the duality of waves and particles. Feynman famously said that the entire mystery of quantum mechanics could be understood through the double-slit experiment, and there are multiple interpretations of understanding this experiment. Peter Shor put it very well when he said:</p>
<blockquote><p>Interpretations of quantum mechanics, unlike Gods, are not jealous, and thus it is safe to believe in more than one at the same time. So if the many-worlds interpretation makes it easier to think about the research you’re doing in April, and the Copenhagen interpretation makes it easier to think about the research you’re doing in June, the Copenhagen interpretation is not going to smite you for praying to the many-worlds interpretation. At least I hope it won’t, because otherwise I’m in big trouble.</p></blockquote>
<p>The same is true about the understanding of kinesiological phenomenon like the <a href="http://en.wikipedia.org/wiki/Stretch_shortening_cycle">Stretch-Shortening Cycle</a>. We think we understand how this works as exercise scientists, but the mechanism of action remains unknown. This is much simpler to understand than the double-slit experiment, of course, but the problem plagues this phenomenon as it does with many indescribable things that seem to be true.</p>
<p>Research exists that show that the forces on the elbow present when a pitcher is throwing 90+ MPH is enough force to rupture the ulnar collateral ligament, yet a pitcher can throw for years without severe damage to this ligament. We <strong>think</strong> we know how the muscles in the forearm help to protect the elbow depending on the angular velocities of the arm, but we do not <strong>know</strong>. The truth, simply put, is that the forces required to throw this hard are enough to rupture the UCL, <strong>period.</strong> So why doesn't the UCL rupture in all athletes? And why do some UCLs rupture at speeds much lower than 90 MPH? Does it have to do with the positioning of the forearm at release, or how the inertial mass of the baseball is achieved? All good questions, all without real, true answers - and it's exceedingly likely that there will <strong>never</strong> be concrete answers to these questions in my lifetime.</p>
<p>Others have said the job of coaching (and teaching) is to simplify a subject matter so that people can understand it. "The duality of waves and particles is too confusing, can't you simplify it," someone might ask? The ultimate answer, of course, is:</p>
<div class="lyte" id="WYL_iMDTcMD6pOw" style="width:420px;height:315px;"><noscript><a href="http://youtu.be/iMDTcMD6pOw"><img src="http//img.youtube.com/vi/iMDTcMD6pOw/0.jpg" alt="" width="420" height="315" /><br />Watch this video on YouTube.</a></noscript><script type="text/javascript"><!-- 
 (function(){var d=document;var w=window;if(w.addEventListener){w.addEventListener('load', insert, false)}else{w.onload=insert} function insert(){if(!d.getElementById('lytescr')){lytescr=d.createElement('script');lytescr.async=true;lytescr.id='lytescr';lytescr.src='http://www.kyleboddy.com/wp-content/plugins/wp-youtube-lyte/lyte/lyte-min.js?wylver=0.9.4';h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(lytescr, h)}};}()) 
 --></script></div>
<p>I'm not going to lie to you so you can feel good about understanding something that no one understands. If you want that, there are plenty of coaches who have never picked up a textbook on kinesiology or physics who will tell you things that will satisfy you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyleboddy.com/2011/09/07/why-understanding-particle-physics-is-vital-to-understanding-baseball-pitching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Pleasure IS Hard Work, Not the Outcome</title>
		<link>http://www.kyleboddy.com/2011/08/31/the-pleasure-is-hard-work-not-the-outcome/</link>
		<comments>http://www.kyleboddy.com/2011/08/31/the-pleasure-is-hard-work-not-the-outcome/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 23:18:54 +0000</pubDate>
		<dc:creator>kyleb</dc:creator>
				<category><![CDATA[Entrepreneurship]]></category>
		<category><![CDATA[Random Thoughts]]></category>

		<guid isPermaLink="false">http://www.kyleboddy.com/?p=447</guid>
		<description><![CDATA[I had two conversations that inspired me to make this blog post. Last night I had a lengthy conversation about some career opportunities that I may or may not have down the line in addition to various topics that always creep into our late-night conversations, and today I had a short talk with another close [...]]]></description>
			<content:encoded><![CDATA[<p>I had two conversations that inspired me to make this blog post. Last night I had a lengthy conversation about some career opportunities that I may or may not have down the line in addition to various topics that always creep into our late-night conversations, and today I had a short talk with another close friend of mine that I don't see all that often. What came up in both conversations is the fact that I like to work hard on difficult to solve problems, mostly related to baseball. The first person shares this love for hard work with me, though in a different realm - so we commiserate easily about that. The second person does not, however - he's incredibly frustrated at his job where he busts his ass and has little energy afterwards to pursue opportunities that he likes to do.</p>
<p>My second friend told me today that he's very proud of me. Knowing that he probably wasn't referring to my newborn son, I asked him: "Proud of what?" He said: "You pursue your dreams, and this opportunity that you're involved with now seems like a dream opportunity finally come to life due to all your hard work!"</p>
<p>I reflected for a bit, and it made sense why he was burnt out from hard work at his day job and frustrated with some aspects of his life. (He is generally a very positive and happy person, lest I make it sound like he's always negative.) I told him: "Achieving the goals and ends I have for myself are the least important part of my life. I take great pleasure in the hard work I do to pursue these goals that I have - I do not expect to be content when I reach these mid-term goals that I have for myself." He responded that he wished he had energy to pursue some of the goals he had but that his day job sucked much of the life out of him, and I told him: "Your day job is what it is. Leave it there. My day job often frustrates me due to its complexity, but at the end of the day, we are both employed, earning a pretty good salary, and if this is what we fall back on, then that's pretty good. Cherish the fact that you will have the opportunity to work hard on projects you love. Whether or not they bear fruit is meaningless."</p>
<p>I give my <em>Introduction to Political Science</em> professor (in junior college) a lot of credit for enlightening me to process-oriented concepts; a life philosophy that was ironed out by studying sabermetrics and the <span style="text-decoration: underline;">Moneyball</span> revolution.</p>
<p>My first friend put it very succinctly: "The opportunity to put in hours and hours of hard work on something that has meaning to you is a very rare opportunity in the world."</p>
<p>When I summed all this up for my second friend, he seemed to understand. I hope he is able to find peace and the time to find the same opportunity that I've been given, for it is the greatest gift that I have in my life.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyleboddy.com/2011/08/31/the-pleasure-is-hard-work-not-the-outcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WiiMote, Motion Plus, Accelerometers, Gyroscopes, Baseball Pitching, and What it All Means</title>
		<link>http://www.kyleboddy.com/2011/08/27/wiimote-motion-plus-accelerometers-gyroscopes-baseball-pitching-and-what-it-all-means/</link>
		<comments>http://www.kyleboddy.com/2011/08/27/wiimote-motion-plus-accelerometers-gyroscopes-baseball-pitching-and-what-it-all-means/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 06:31:28 +0000</pubDate>
		<dc:creator>kyleb</dc:creator>
				<category><![CDATA[Entrepreneurship]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[baseball]]></category>
		<category><![CDATA[biomechanics]]></category>
		<category><![CDATA[kinesiology]]></category>
		<category><![CDATA[wiimote]]></category>

		<guid isPermaLink="false">http://www.kyleboddy.com/?p=442</guid>
		<description><![CDATA[I am working on a much larger post (and page, and even separate website) to detail my work with modeling baseball biomechanics, but I made a post that I want to catalog here on my blog for sharing and archival purposes. This was originally written on a messageboard, so if the formatting is off, I [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on a much larger post (and page, and even separate website) to detail my work with modeling baseball biomechanics, but I made a post that I want to catalog here on my blog for sharing and archival purposes. This was originally written on a messageboard, so if the formatting is off, I apologize.</p>
<p>---</p>
<p>Here's a great video about accelerometers and gyroscopes:</p>
<p><a href="http://www.youtube.com/watch?v=s19W-MG-whE">http://www.youtube.com/watch?v=s19W-MG-whE</a></p>
<p>What do I <strong>really</strong> care about when I'm using the Wii parts? Well, to build a fully functioning Inertial Mass Unit (IMU) to get 1:1 motion capture/control, I need to do what they demonstrate above. However, this is very complicated and requires 6 DOF. The degrees of freedom are:</p>
<p><em>Moving up and down (heaving)<br />
Moving left and right (swaying)<br />
Moving forward and backward (surging)<br />
Tilting forward and backward (pitching)<br />
Turning left and right (yawing)<br />
Tilting side to side (rolling)</em></p>
<p>I really only care about what the forearm is doing in relation to the elbow; this eliminates the first three DOF. Fortunately for me, the first 3 DOF are handled by accelerometers and the last 3 DOF are handled by gyroscopes. What matters the most is tracking:</p>
<p>-Humeral internal rotation velocity rate of change (pitch)<br />
-Forearm pronation/supination rate of change (roll)</p>
<p>And to a lesser extent:</p>
<p>-Ulnar/radial degrees of flexion rate of change (yaw)</p>
<p>So the next step is synchronizing what I see on high-speed two-dimensional frontal plane (side view) video and what I get from the gyroscopes. By doing this, I can nearly eliminate the need to have a four or five high-speed camera system that uses Direct Linear Transformation to recreate a three-dimensional model of a pitcher. This is awesome, because DLT is both ****ing ridiculously time intensive as well as somewhat expensive due to the need for 4+ high-speed cameras ($150 each minimum with current consumer technology) and the software to handle it ($50, but it's very bare bones).</p>
<p>It's cool to be the guy doing the most to push low-cost / DIY biomechanical analysis of amateur athletics, but it also means I have no peer groups to work with. The Internet helps, but very few people are working with this kind of technology to produce the stuff I want to make. It's both exciting to be a pioneer in a field and incredibly frustrating because I have no formal education in physics or mechanical engineering, so I need to read pretty much everything I can get my hands on to understand it all.</p>
<p>I'd be remiss if I didn't mention that it's a bit terrifying that I could very well be wasting a lot of my time from an application/technology standpoint. If this product is so good (and I believe it is), then it <strong>already should exist</strong> given that the underlying technologies have been around for some time, though it can be said that it's only been affordable since the Wii and smartphones have given rise to cheap small consumer electronics for accelerometers and gyroscopes - not very long. But there's no proven market for what I want to sell, and it will never be huge.</p>
<p>Fortunately, I see this as an awesome opportunity to learn about science and to contribute - however marginally - to the field. Science and technology are two wholly separate disciplines, and as Richard Feynman famously said about his work: "I do things for the pleasure of finding things out."</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyleboddy.com/2011/08/27/wiimote-motion-plus-accelerometers-gyroscopes-baseball-pitching-and-what-it-all-means/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mass Geolocation Script (PHP)</title>
		<link>http://www.kyleboddy.com/2011/04/26/mass-geolocation-script-php/</link>
		<comments>http://www.kyleboddy.com/2011/04/26/mass-geolocation-script-php/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 23:02:12 +0000</pubDate>
		<dc:creator>kyleb</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[geocode]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[lat long coordinates]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.kyleboddy.com/?p=418</guid>
		<description><![CDATA[I recently wrote a mass geolocation script in PHP since Google seems to be taking down all the websites that offer this vital service. Right now it: Checks a table for records without lat/long coordinates Sends those records' addresses to Google's geolocation API Updates your records with the lat/long coordinates It checks for the "#" [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wrote a mass geolocation script in PHP since Google seems to be taking down all the websites that offer this vital service. Right now it:</p>
<ul>
<li>Checks a table for records without lat/long coordinates</li>
<li>Sends those records' addresses to Google's geolocation API</li>
<li>Updates your records with the lat/long coordinates</li>
</ul>
<p>It checks for the "#" sign and handles it since Google has problems with translating "2020 Anywhere Place #200" as a real address, but there are probably other errors I haven't adequately checked for.</p>
<p>At the moment it updates records that are missing lat/long coordinates and writes zeroes into those fields if it can't geolocate the address correctly. As a result, if you run the script again, it will assume those records were updated correctly and will pass over them, since they are not null. This is a known issue and is one (of many) areas of improvement for the script.</p>
<p>I didn't want to spend a ton of hours on the script to make it a full-fledged awesome service, since Google doesn't seem to like that. It's just a basic script that handles common problems and works well enough.</p>
<p>You can get it over at my <a title="GeoCode" href="https://github.com/kyleboddy/GeoCode">GitHub repo page for GeoCode</a>. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyleboddy.com/2011/04/26/mass-geolocation-script-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Football Outsiders is a Joke</title>
		<link>http://www.kyleboddy.com/2011/04/20/football-outsiders-is-a-joke/</link>
		<comments>http://www.kyleboddy.com/2011/04/20/football-outsiders-is-a-joke/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 23:29:57 +0000</pubDate>
		<dc:creator>kyleb</dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[data snooping]]></category>
		<category><![CDATA[football outsiders]]></category>
		<category><![CDATA[regression]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://www.kyleboddy.com/?p=413</guid>
		<description><![CDATA[This article is terrible and I'm not really going to explain why, but anytime you see this kind of language: -were chosen in the first two rounds -had at least 33 games started in college -completed at least 58 percent of passes in college You can be reasonably sure the author is either lying, stupid, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.footballoutsiders.com/stat-analysis/2011/introducing-lewin-career-forecast-v20">This article is terrible</a> and I'm not really going to explain why, but anytime you see this kind of language:</p>
<blockquote><p>-were chosen in the first two rounds<br />
-had at least 33 games started in college<br />
-completed at least 58 percent of passes in college</p></blockquote>
<p>You can be reasonably sure the author is either lying, stupid, and/or dishonest. Note that these three traits are not mutually exclusive from one another.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyleboddy.com/2011/04/20/football-outsiders-is-a-joke/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Humor: Recursion</title>
		<link>http://www.kyleboddy.com/2011/04/05/humor-recursion/</link>
		<comments>http://www.kyleboddy.com/2011/04/05/humor-recursion/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 18:45:11 +0000</pubDate>
		<dc:creator>kyleb</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[trolling]]></category>

		<guid isPermaLink="false">http://www.kyleboddy.com/?p=391</guid>
		<description><![CDATA[Awesome.]]></description>
			<content:encoded><![CDATA[<div class="wp-caption aligncenter" style="width: 650px"><img title="Recursion" src="http://i.imgur.com/xKqml.png" alt="" width="640" height="960" /><p class="wp-caption-text">Ah, Google.</p></div>
<p>Awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyleboddy.com/2011/04/05/humor-recursion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Newest XAMPP Doesn&#8217;t Work as Expected</title>
		<link>http://www.kyleboddy.com/2011/04/04/newest-xampp-doesnt-work-as-expected/</link>
		<comments>http://www.kyleboddy.com/2011/04/04/newest-xampp-doesnt-work-as-expected/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 06:23:36 +0000</pubDate>
		<dc:creator>kyleb</dc:creator>
				<category><![CDATA[General Tech]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://www.kyleboddy.com/?p=386</guid>
		<description><![CDATA[I was going to type up a giant thing about why the newest XAMPP doesn't work well with MySQL because it's packaged with a beta PHP version and stuff... but I honestly don't want to elaborate. Just know that I wasted 4-6 hours of my life and about an hour of Site5's support because of [...]]]></description>
			<content:encoded><![CDATA[<p>I was going to type up a giant thing about why the newest <strong>XAMPP </strong>doesn't work well with MySQL because it's packaged with a beta PHP version and stuff... but I honestly don't want to elaborate. Just know that I wasted 4-6 hours of my life and about an hour of Site5's support because of the newest XAMPP being a beta product without the label.</p>
<p>If you use Windows, don't use XAMPP 1.7.4. Use 1.7.3 and <a href="http://sourceforge.net/projects/xampp/files/">get it from the SourceForge archive</a>. Trust me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyleboddy.com/2011/04/04/newest-xampp-doesnt-work-as-expected/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minor League Splits Redux Launched</title>
		<link>http://www.kyleboddy.com/2011/04/01/minor-league-splits-redux-launched/</link>
		<comments>http://www.kyleboddy.com/2011/04/01/minor-league-splits-redux-launched/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 17:39:29 +0000</pubDate>
		<dc:creator>kyleb</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[baseball]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[minorleaguesplits]]></category>
		<category><![CDATA[mlsplits]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.kyleboddy.com/?p=380</guid>
		<description><![CDATA[I've launched yet another half-complete web application relating to baseball sabermetrics! ML Splits is a database of minor league baseball players (batters only for now) that shows their "splits" (performance against LHP and RHP) as well as park effects and major league equivalencies. The data is taken from Jeff Sackmann's old minorleaguesplits.com site where he [...]]]></description>
			<content:encoded><![CDATA[<p>I've launched yet another half-complete web application relating to baseball sabermetrics! <a title="ML Splits" href="http://mlsplits.drivelinebaseball.com/">ML Splits</a> is a database of minor league baseball players (batters only for now) that shows their "splits" (performance against LHP and RHP) as well as park effects and major league equivalencies. The data is taken from Jeff Sackmann's old minorleaguesplits.com site where he made the CSVs available for import as open source.</p>
<div id="attachment_381" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.kyleboddy.com/wp-content/uploads/2011/04/mlsplits.png" rel="lightbox[380]" title="ML Splits"><img class="size-medium wp-image-381" title="ML Splits" src="http://www.kyleboddy.com/wp-content/uploads/2011/04/mlsplits-300x266.png" alt="ML Splits" width="300" height="266" /></a><p class="wp-caption-text">ML Splits</p></div>
<p style="text-align: left;">I leaned on<strong> jQuery</strong> for front-end display purposes, as I'm getting more and more comfortable with using it for front-facing web applications. Mostly just dynamic div tagging and <em>toggle() </em>to keep the screen clear of distractions and make it easy to see what stats are really important. Wrote the entire thing in PHP 5.3.x, MySQL 5, CodeIgniter 2.0, and jQuery.</p>
<p style="text-align: left;">Enjoy!</p>
<p style="text-align: left;"><strong>EDIT:</strong> Pitchers are up as of April 4th.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyleboddy.com/2011/04/01/minor-league-splits-redux-launched/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Springloops is awesome, HeidiSQL is annoying, Site5 disappoints</title>
		<link>http://www.kyleboddy.com/2011/03/24/springloops-is-awesome-heidisql-is-annoying-site5-disappoints/</link>
		<comments>http://www.kyleboddy.com/2011/03/24/springloops-is-awesome-heidisql-is-annoying-site5-disappoints/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 16:16:14 +0000</pubDate>
		<dc:creator>kyleb</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[data analysis]]></category>
		<category><![CDATA[heidisql]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[springloops]]></category>
		<category><![CDATA[version control]]></category>
		<category><![CDATA[web dev]]></category>

		<guid isPermaLink="false">http://www.kyleboddy.com/?p=377</guid>
		<description><![CDATA[I've started to use Springloops RC2 for my version control efforts, which is really awesome. They support SVN and git (no Mercurial yet), have a great interface with easy deployments to multiple servers so you can split them up into production/staging/development, a solid ticketing system, and a good code browser. Also, it's completely free! HeidiSQL [...]]]></description>
			<content:encoded><![CDATA[<p>I've started to use <a title="Springloops" href="http://www.springloops.com/v2/">Springloops RC2</a> for my version control efforts, which is really awesome. They support SVN and git (no Mercurial yet), have a great interface with easy deployments to multiple servers so you can split them up into production/staging/development, a solid ticketing system, and a good code browser. Also, it's completely free!</p>
<p><img class="aligncenter" title="Springloops" src="http://www.springloops.com/v2/i/relase.png" alt="Springloops" width="246" height="189" /></p>
<p><a title="HeidiSQL" href="http://www.heidisql.com/">HeidiSQL</a> has been my Windows MySQL GUI of choice ever since I switched to it from Toad. It's generally very good, it's FOSS, and it handles most operations fairly well - except for CSV importing. <a title="Site5" href="http://www.site5.com/in.php?id=26638">Site5</a> is my current webhost, and I'm very happy with them 99.9% of the time, but they caused me a bit of pain recently. I have a lot of CSVs to import that are about 10-15 MB in size each, and I tried importing them through the very handy phpmyadmin tool. However, phpmyadmin has some memory leaks and issues with importing larger CSVs, so it ended up crashing due to memory problems on the larger files (even though it theoretically can handle up to 105MB CSVs). I sent Site5 a ticket to have them import the CSVs manually (they said they would), but they responded with "there's no table structure in your DB so we can't do it." Well, uh, that's what phpmyadmin does and why I wanted to use it over the 7 tables I need to make with 20 or so CSV files. They refused again without providing me an alternative, so I had do it myself.</p>
<p>I fired up HeidiSQL, manually created the tables, and imported the CSV. And... it didn't work. I ignored the first row (column headers), but it still responded with "invalid data." The fields were correctly cast for the rest of the data, so I didn't know what was up. A bit of Googling tells me that even if you ignore the first row, HeidiSQL still checks it against the data types in your table. This is idiotic and annoying for any number of reasons, all of which I leave up to you to figure out.</p>
<p>At any rate, deleting the first row and ignoring 0 rows ended up working just fine. Now to do this repetitive task over and over again...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyleboddy.com/2011/03/24/springloops-is-awesome-heidisql-is-annoying-site5-disappoints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced Injury Database: RESTful Web Service Launched</title>
		<link>http://www.kyleboddy.com/2011/03/17/advanced-injury-database-restful-web-service-launched/</link>
		<comments>http://www.kyleboddy.com/2011/03/17/advanced-injury-database-restful-web-service-launched/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 06:22:08 +0000</pubDate>
		<dc:creator>kyleb</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[baseball]]></category>
		<category><![CDATA[injury database]]></category>
		<category><![CDATA[pitchf/x]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://www.kyleboddy.com/?p=360</guid>
		<description><![CDATA[I've launched a RESTful web interface for my Advanced Baseball Injury Database. A major problem with PITCHf/x and injury databases are that people are building them over and over against on their local (or hosted) servers, and this is a huge amount of overhead for the sabermetric community. The way to properly do this is [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_297" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.kyleboddy.com/wp-content/uploads/2010/10/injurydb.png" rel="lightbox[360]" title="Advanced Injury Database"><img class="size-medium wp-image-297" title="Advanced Injury Database" src="http://www.kyleboddy.com/wp-content/uploads/2010/10/injurydb-300x177.png" alt="Advanced Injury Database" width="300" height="177" /></a><p class="wp-caption-text">Advanced Injury Database</p></div>
<p>I've launched a RESTful web interface for my <a href="http://injurydb.drivelinebaseball.com">Advanced Baseball Injury Database</a>. A major problem with PITCHf/x and injury databases are that people are building them over and over against on their local (or hosted) servers, and this is a huge amount of overhead for the sabermetric community. The way to properly do this is to have one giant amalgamated database with a few trusted caretakers that deal with the updating/maintenance/feature requests while everyone else accesses the data using RESTful web services.</p>
<p>This makes updating and standardizing a dataset much easier and gives end users a much easier back-end interface into the database.</p>
<p>To access the RESTful service, you must first authenticate with the Advanced Baseball Injury Database over Facebook. (Anti-Facebook users: <strong>Get over it. </strong>I'm not going to spam your wall or steal your info, and I made this database entirely open for you to use.) You can do that on the <a href="http://injurydb.drivelinebaseball.com/index.php/injurydb/detailedinjuries">Detailed Injuries Service</a> page. This stores a unique key in my database and grants you access to make RESTful requests.</p>
<div id="attachment_361" class="wp-caption aligncenter" style="width: 691px"><img class="size-full wp-image-361" title="Example of the key" src="http://www.kyleboddy.com/wp-content/uploads/2011/03/restful.jpg" alt="Example of the key" width="681" height="289" /><p class="wp-caption-text">Example of the key</p></div>
<p>Easy enough. Copy that key down. You will need this going forward.</p>
<h3>Making the Request: High-Level Overview</h3>
<p>All you have to do to get injury information about ANY player from 2002-2010 is to go to this URL:</p>
<p>http://injurydb.drivelinebaseball.com/index.php/injurydb/injuryservice/<span style="color: #0000ff;"><strong>eliasid</strong></span>/<span style="color: #ff0000;"><strong>key</strong></span></p>
<p><em>(I've been told that "eliasID" is the wrong term and I'm supposed to use mlbAMID. However, I've already coded it like "eliasid" and that's what I call it in real life, so you'll just have to deal with it if it bothers you.)</em></p>
<p>For example, if you use Jered Weaver's eliasID (450308) and my key (66- wait a minute, nice try), you get this in your web browser (squashed for easier reading):</p>
<div id="attachment_363" class="wp-caption aligncenter" style="width: 482px"><a href="http://www.kyleboddy.com/wp-content/uploads/2011/03/results.jpg" rel="lightbox[360]" title="Jered Weaver"><img class="size-full wp-image-363" title="Jered Weaver" src="http://www.kyleboddy.com/wp-content/uploads/2011/03/results.jpg" alt="Jered Weaver" width="472" height="320" /></a><p class="wp-caption-text">Jered Weaver</p></div>
<p>Looks pretty ridiculous, right? Well, that's JavaScript Object Notation - JSON. You can easily parse <strong>that </strong>to get <strong>this</strong>:</p>
<div id="attachment_364" class="wp-caption aligncenter" style="width: 640px"><a href="http://www.kyleboddy.com/wp-content/uploads/2011/03/results1.jpg" rel="lightbox[360]" title="Jered Weaver - See!"><img class="size-full wp-image-364" title="Jered Weaver - See!" src="http://www.kyleboddy.com/wp-content/uploads/2011/03/results1.jpg" alt="Jered Weaver - See!" width="630" height="137" /></a><p class="wp-caption-text">Jered Weaver - See!</p></div>
<p>So, how do you do that? Good question.</p>
<h3>Making the Request: Low-Level Overview</h3>
<p>If you've read this far, you probably want some code examples. No problem. I am a PHP/CodeIgniter/MySQL kind of guy, so those are the examples I'm going to give to you. However, I'm including both the simple way - <em>file_get_contents()</em> - and the tougher (but more universal) way - cURL. They should be all you need to get going.</p>
<p>Here's how you can use <em>file_get_contents()</em> in PHP to decode the JSON and echo it out to the browser:</p>
<pre class="brush: php; title: ; notranslate">
function testinjuryservice()
	{
		// point it to Jered Weaver's eliasID and return it to the browser
		$contents = file_get_contents('http://injurydb.drivelinebaseball.com/index.php/injurydb/injuryservice/450308/YOURKEYHERE');

		// decode the json returned from the service
		$info = json_decode($contents);

		// count number of injury movements
		// must cast object into an array to accurately count the number of injuries
		$injuries = count((array)$info);
		$x = 1;

		while ($x &lt;= $injuries)
		{
		      // echo $info-&gt;{$x}-&gt;{'DateOn'};
		      // you would use the above line to get the &quot;DateOn&quot; value for the xth injury
		      // repeat this with DateOff, injury, injury_type, etc

		      // dump contents of the given injury out
		      print_r($info-&gt;{$x});
		      echo '&lt;br /&gt;';
		      $x++;
		}
	}
</pre>
<p>And here's the cURL example:</p>
<pre class="brush: php; title: ; notranslate">
function testinjuryservice()
	{
		// open cURL
		$ch = curl_init();

		// point it to Jered Weaver's eliasID and return it to the browser
		curl_setopt($ch, CURLOPT_URL,
		'http://injurydb.drivelinebaseball.com/index.php/injurydb/injuryservice/450308/YOURKEYHERE');
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

		// assign it to $contents
		$contents = curl_exec ($ch);

		// close cURL
		curl_close ($ch);

		// decode the json returned from the service
		$info = json_decode($contents);

		// count number of injury movements
		// must cast object into an array to accurately count the number of injuries
		$injuries = count((array)$info);
		$x = 1;

		while ($x &lt;= $injuries)
		{
		      // echo $info-&gt;{$x}-&gt;{'DateOn'};
		      // you would use the above line to get the &quot;DateOn&quot; value for the xth injury
		      // repeat this with DateOff, injury, injury_type, etc

		      // dump contents of the given injury out
		      print_r($info-&gt;{$x});
		      echo '&lt;br /&gt;';
		      $x++;
		}
	}
</pre>
<p><strong>VERY IMPORTANT: </strong>I start the JSON array at <strong>1, </strong>not <strong>0</strong>. Don't be a slave to default counting. Humans start at 1 when they count up.</p>
<p>If you screw up the eliasID or your authentication key, you will get this error in the array's first position:</p>
<blockquote><p>{"1":{"1":"Invalid key or eliasID given."}}</p></blockquote>
<p>Alternatively, I may have banned you from the service for too many requests, which segues well into the next point: Don't abuse this system. This is not meant for you to spider my entire database by requesting every player's information from eliasID 10 (Kris Benson: fun fact) to eliasID 9999999999. Can't we all get along?</p>
<h3>Where Do We Go From Here?</h3>
<p>Well, if you like the service, drop me a line - <em>kyle at driveline baseball dot com</em>. I'd love to hear from you, and if you want to collaborate, that's cool too.</p>
<p>You can keep an eye out for <a title="Kyle Boddy's THT Articles" href="http://www.hardballtimes.com/main/authors/kyle/2011/">my articles at The Hardball Times</a>, where I write about PITCHf/x stuff and exercise science things. Or check out my baseball training company's site, <a title="Driveline Baseball - Developing the Elite Athlete" href="http://www.drivelinebaseball.com/">Driveline Baseball</a>.</p>
<p>I plan on developing a RESTful PITCHf/x interface in the future depending on interest, my motivational levels, free time, and how much I think this is going to wreck my bandwidth costs. Ideally a bunch of us pitch in, rent a cheap VPS, and we serve it up to all sabermetricians who are interested in this kind of stuff. We write tutorials and make it open source and grant freedom of information. Is that feasible? Who knows!</p>
<p>Have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyleboddy.com/2011/03/17/advanced-injury-database-restful-web-service-launched/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

