<?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>LardBucket</title>
	<atom:link href="http://lardbucket.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://lardbucket.org/blog</link>
	<description>My Blog</description>
	<lastBuildDate>Wed, 30 Jun 2010 22:26:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Leaderboard with Movement Tracking</title>
		<link>http://lardbucket.org/blog/archives/2010/06/29/leaderboard-with-movement-tracking/</link>
		<comments>http://lardbucket.org/blog/archives/2010/06/29/leaderboard-with-movement-tracking/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 03:00:27 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lardbucket.org/blog/?p=230</guid>
		<description><![CDATA[In putting together SLV Scav with Dan Meyer, I ended up writing a (relatively) simple script for generating a scoreboard with rankings, as well as the amount the rankings had changed. It looks something like this: (picture from Dan Meyer, names blurred to protect the innocent) Dylan Faullin asked for more information, so I&#8217;m posting [...]]]></description>
			<content:encoded><![CDATA[<p>In putting together <a href="http://blog.mrmeyer.com/?p=6749">SLV Scav with Dan Meyer</a>, I ended up writing a (relatively) simple script for generating a scoreboard with rankings, as well as the amount the rankings had changed. It looks something like this: (picture from Dan Meyer, names blurred to protect the innocent)</p>
<p><img class="aligncenter size-full wp-image-235" title="SLV Scav Scoreboard" src="http://lardbucket.org/blog/wp-content/uploads/2010/06/100624_1.jpg" alt="" width="500" height="237" /></p>
<p><a href="https://twitter.com/faullindc3/status/16980821267">Dylan Faullin asked</a> for more information, so I&#8217;m posting most of the relevant code here.</p>
<p><span id="more-230"></span>It&#8217;s in PHP, and while it&#8217;s not necessarily the most efficient way of doing the scoreboard, it seems to work reasonably well. It does have a few assumptions:</p>
<ol>
<li>You&#8217;ve separated your points into a number of distinct &#8220;challenges,&#8221; and points for any of them are all assigned at the same time, and not adjusted later.</li>
<li>Your players have a first name, last name, and grade level (although any part of that can obviously be modified).</li>
<li>Your scores for every player and every challenge are in an array of $scores[$challengeNumber][$playerId] = score, and challenge numbers are sequential and start at 1.</li>
<li>You have a function getPlayerInfo() that takes a player&#8217;s ID and returns an array with keys for &#8216;last&#8217; (last name), &#8216;first&#8217; (first name), and &#8216;grade&#8217; (grade level).</li>
<li>If you want to highlight the current user, you have functions loggedIn() and getCurrentUserId() that act as one might expect.</li>
</ol>
<p>Most of these assumptions can be changed with appropriate changes in the code, but they worked for what I was doing. (Notably: no assumptions are made regarding user IDs, other than them being unique, and scores are not required to exist for any given user in any given competition.)</p>
<h2>Computing the scoreboard</h2>
<p>Note that because this code requires looping through every score every user has received, it may be slow for large competitions. Therefore, you might want to cache the output $scoreboard value, and only refresh the data every time a challenge ends. This avoids doing the intensive calculations every time someone views the scoreboard, at a cost of a little more complexity. I&#8217;ve noted one way to do this in the code.</p>
<p>So, here&#8217;s the code. It&#8217;s in PHP, and expects that $scores is already in memory, in the format listed above. (Hold your mouse over the code for options in the upper-right corner to view or copy the un-highlighted source.)</p>
<pre class="brush:php">
// Set up the scoreboard.
$scoreboard = Array();
$scoreboard['individual'] = Array(); // We'll populate this later.
// Set up the classes in the scoreboard.
$scoreboard['class'] = Array(
	9 => Array('name' => 'Freshmen', 'last' => 'Freshmen'),
	10 => Array('name' => 'Sophomores', 'last' => 'Sophomores'),
	11 => Array('name' => 'Juniors', 'last' => 'Juniors'),
	12 => Array('name' => 'Seniors', 'last' => 'Seniors'),
);

// Loop through each challenge thus far.
for($challengeNumber = 1; $challengeNumber < = $challengeTotal; $challengeNumber++) {
	if ($challengeNumber == $currentChallenge) {
		// We reached the current challenge, stop here.
		break;
	}

	// Have there been any scores from this challenge?
	if (isset($scores[$challengeNumber])) {
		// Yes, so for each one:
		foreach($scores[$challengeNumber] as $userId => $score) {
			// Get the player's information
			$userInfo = getPlayerInfo($userId);
			// If the user has a grade level (this lets us keep staff, etc. off
			//  the leaderboard):
			if ($userInfo['grade'] != 0) {
				// Set up information about this player.
				//  (Yes, this is often redundant, but this is an
				//   infrequently-run routine, so we should be okay.)
				$scoreboard['individual'][$userId]['name'] = $userInfo['first'].' '.$userInfo['last'];
				$scoreboard['individual'][$userId]['first'] = $userInfo['first'];
				$scoreboard['individual'][$userId]['last'] = $userInfo['last'];

				// Increment their score by however much they scored this time.
				$scoreboard['individual'][$userId]['score'] += $score;

				// If they are in a grade level we're tracking, add their
				//  points to their class' total score.
				if (isset($scoreboard['class'][$userInfo['grade']])) {
					$scoreboard['class'][$userInfo['grade']]['score'] += $score;
				}
			}
		}
	}

	// Sort and assign ranks to the individuals and classes.
	$scoreboard['individual'] = assignRanks($scoreboard['individual']);
	$scoreboard['class'] = assignRanks($scoreboard['class']);
}

// Here, it would be a good idea to save $scoreboard somewhere, and access it
//  as a cached value later, as scoreboard processing might take a while with
//  hundreds of students. In our case, this wasn't necessary, but it is a good
//  idea in practice.
// You can use PHP's serialize() function like so:
//  file_put_contents('scoreboard.dat', serialize($scoreboard));
// ... and then later load the scoreboard with:
//  $scoreboard = unserialize(file_get_contents('scoreboard.dat'));
// to avoid re-computing the scoreboard every time someone views it.

// Helper functions

// assignRanks assigns a rank to each contestant in the set, as well as the
//  amount they have moved in the last round, if relevant.
function assignRanks($input) {
	uasort($input, "sortByScore"); // Use sortByScore to sort everyone.
	$oldScore = -1; // Store the last player's score
	$rankOn = 0;    // The ranking we're currently on. Incremented manually,
	                //  because there may be a tie.
	$nextRank = 1;  // The next ranking that we should use if there is no tie.
	                //  We always increment this, even in a tie, so we can have
	                //  two first places, with the next highest score being
	                //  given third place.

	foreach($input as $key => $value) {
		// If the score is different than the last player's, it's not a tie.
		if ($value['score'] != $oldScore) {
			$rankOn = $nextRank;
		}

		// Save this score to detect ties, and increment the next rank.
		$oldScore = $value['score'];
		$nextRank++;

		// If there was a prior round, calculate how much the player's rank
		//  changed.
		if (isset($input[$key]['rank'])) {
			// This subtraction is counterintuitive, but we say someone moved
			//  "up" (positively) if their rank decreases (from 2nd to 1st).
			$input[$key]['move'] = $input[$key]['rank'] - $rankOn;

			if ($input[$key]['move'] == 0) {
				// If there was no movement, remove this key.
				unset($input[$key]['move']);
			}
		}

		// Finally, assign the rank.
		$input[$key]['rank'] = $rankOn;
	}
	return $input;
}

// sortByScore is used as a custom comparison operator in assignRanks() to sort
//  by score, then by last name, and finally by first name.
function sortByScore($a, $b) {
	// Pull out scores
	$aC = $a['score'];
	$bC = $b['score'];

	// If the score is equal,
	if ($aC == $bC) {
		// try comparing last names.
		if (strcmp($a['last'], $b['last']) == 0) {
			// If they're equal, compare first names.
			return strcmp($a['first'], $b['first']);
		}
		// Last names differ, so use those for sorting.
		return strcmp($a['last'], $b['last']);
	}
	// Scores are different, so we can sort by that.
	return ($aC > $bC) ? -1 : 1;
}
</pre>
<h2>Displaying the scoreboard</h2>
<p>Displaying the computed scoreboard information is a bit tricky (especially in terms of getting the CSS &#8220;just right&#8221;). If you want to make your own custom display, feel free to poke at $scoreboard. (Run a print_r($scoreboard), and look through that for the information it contains.) If you just want something that seems to work, here&#8217;s the code I use:</p>
<pre class="brush:php">
// To display the scoreboard, I used this code:
//  (written for the 960 grid system: http://960.gs/. Some extra CSS was used.)

// I use h() as a short alias for htmlentities():
function h($in) { return htmlentities($in); }

// This loops through each set of scoreboards (individual and class-based).
foreach($scoreboard as $scoreboardType => $scoreboardRows) { ?>
<div class="grid_6">
	<span style="font-weight:bold">< ?=h($scoreboardType)?></span>
	< ?
	$firstRow = true;
	// This loops through every entry on the relevant scoreboard.
	foreach($scoreboardRows as $rowUser => $row) {
		// We highlight the logged-in user, if any.
		$extraClass = (loggedIn() &#038;&#038; ($rowUser == getCurrentUserId())) ? ' me' : '';

		// We have a special CSS class for the first row (to avoid an extra
		//  border). The :first CSS pseudo-selector may be a better idea,
		//  but I didn't remember about it when I wrote this section of code.
		if ($firstRow) {
			$extraClass .= ' first';
			$firstRow = false;
		}
		?>
<div class="scoreboardRow<?= $extraClass ?>">
<div class="grid_1 alpha">
				< ? if (isset($row['move'])) { // If the rank changed, show it
					if ($row['move'] > 0) {
						echo '
<div class="movement green">'.abs($row['move']).'</div>

';
					} else {
						echo '
<div class="movement red">'.abs($row['move']).'</div>

';
					}
				} ?>
<div class="rank">< ?=h($row['rank'])?></div>
</div>
<div class="grid_3">< ?=h($row['name'])?></div>
<div class="grid_2 omega alignRight">< ?=h($row['score'])?></div>
<div class="clear"></div>
</div>

	< ? } ?>
</div>

< ? } ?>
</pre>
<p>The code above also uses bits of the <a href="http://960.gs/">960 Grid System</a> CSS, although it could be easily adapted to something else. The relevant extra CSS is below, although you&#8217;ll want to change the colors if your scoreboard doesn&#8217;t appear on a dark background.</p>
<pre class="brush:css">
.scoreboardRow {
	font-size: 50%;
	line-height: 100%;
	color: #aaa;
	border-bottom: 1px solid #aaa;
	font-family: Georgia, 'Times New Roman', Times, serif;
	padding-top: 6px;
	padding-bottom: 6px;
}

.scoreboardRow.first {
	border-top: 1px solid #aaa;
}

.scoreboardRow.me {
	color: #fff;
}

.scoreboardRow .movement {
	width: 30px;
	font-family: Helvetica, Tahoma, Arial, sans-serif;
	font-size: 80%;
	float: left;
	background-repeat: no-repeat;
	background-position: center left;
	padding-left: 17px;
	margin-right: -17px;
	padding-top: 1px;
}
.scoreboardRow .movement.red {
	background-image: url('/images/down.png');
	color: #99413f;
}
.scoreboardRow .movement.green {
	background-image: url('/images/up.png');
	color: #429756;
}

.scoreboardRow .rank {
	width: 30px;
	text-align: right;
	float: right;
	margin-top: -2px;
}

.alignRight {
	text-align: right;
}
</pre>
<p>And finally, links to the <a href="http://lardbucket.org/blog/wp-content/uploads/2010/06/up.png">up.png</a> and <a href="http://lardbucket.org/blog/wp-content/uploads/2010/06/down.png">down.png</a> images that are referenced in that CSS. Either put them in your /images/ directory, or change the CSS to match where you put them.</p>
<p>You can feel free to use any of the above code for any purpose. If you do use it, I&#8217;d appreciate a comment letting me know. And of course, if you have any questions, leave a comment and I&#8217;ll try to get back to you. (That&#8217;s more likely, however, if you provide a fair amount of information as to what&#8217;s going wrong if you&#8217;re having trouble.)</p>
<p>Thanks,<br />
Andy Schmitz</p>
]]></content:encoded>
			<wfw:commentRss>http://lardbucket.org/blog/archives/2010/06/29/leaderboard-with-movement-tracking/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VP8, WebM, and FFmpeg</title>
		<link>http://lardbucket.org/blog/archives/2010/05/19/vp8-webm-and-ffmpeg/</link>
		<comments>http://lardbucket.org/blog/archives/2010/05/19/vp8-webm-and-ffmpeg/#comments</comments>
		<pubDate>Thu, 20 May 2010 02:06:18 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://lardbucket.org/blog/?p=215</guid>
		<description><![CDATA[So, today at Google I/O 2010, Google announced that, along with a number of other groups, they were releasing WebM, a video container and codec. (WebM itself specifies the container, which is a variation of Matroska, as well as the video format, the newly-released VP8, and the audio format, Ogg Vorbis.) I won&#8217;t get into [...]]]></description>
			<content:encoded><![CDATA[<p>So, today at <a href="http://code.google.com/events/io/2010/">Google I/O 2010</a>, Google announced that, along with a number of other groups, they were releasing <a href="http://www.webmproject.org/">WebM</a>, a video container and codec. (WebM itself specifies the container, which is a variation of <a href="http://www.matroska.org/">Matroska</a>, as well as the video format, the newly-released VP8, and the audio format, <a href="http://www.vorbis.com/">Ogg Vorbis</a>.) I won&#8217;t get into the technical details of the codec, as I&#8217;m not really qualified to do so, but a developer for x264 has a reasonably thorough review of a prerelease version of the code <a href="http://x264dev.multimedia.cx/?p=377">here</a>.</p>
<p>The interesting part of VP8 / WebM is that it is a reasonably good video standard that may be theoretically free to use. (The currently popular &#8220;best&#8221; video format, H.264, is riddled with patents and requires licensing for most uses, although encoding video that&#8217;s available for free doesn&#8217;t require payments until at least 2015<sup class='footnote'><a href='#fn-215-1' id='fnref-215-1'>1</a></sup>.) It doesn&#8217;t appear as though anybody is claiming that WebM is the best video format available, but it&#8217;s reasonably good, and potentially free to use. (It&#8217;s impossible to know whether someone else has patented parts of the standard, because that would require examining every software patent ever granted, which is not going to happen.) For some background, the video codec, VP8, was produced by a company named On2 before Google bought them last year. Its predecessors, VP6 and VP7 were used for video in Flash<sup class='footnote'><a href='#fn-215-2' id='fnref-215-2'>2</a></sup> and the video in Skype<sup class='footnote'><a href='#fn-215-3' id='fnref-215-3'>3</a></sup>, respectively.</p>
<p>Most of this will be fairly boring to anyone who normally reads this blog, but if you&#8217;re interested in a way to encode WebM videos yourself in Ubuntu, read on.</p>
<p><span id="more-215"></span>So, a HOWTO on setting up FFmpeg with WebM. There are two parts that you&#8217;ll need: libvpx and ffmpeg, probably in that order. But first, we&#8217;ll go through the first part of the semi-standard <a href="http://ubuntuforums.org/showthread.php?t=786095">guide on installing ffmpeg and x264 on Ubuntu</a> (which is a great resource, I&#8217;ve copied the relevant parts here). I&#8217;ll assume you&#8217;re moderately comfortable with the command line and ffmpeg.</p>
<h1>Wait!</h1>
<p>The guide on this page is <strong>old and outdated</strong> now. It used to be the &#8220;right&#8221; way of doing things, but thanks to work by the ffmpeg and libvpx developers, things are now much easier. Please have a look at FakeOutdoorsman&#8217;s <strong>updated, working guide</strong> <a href="http://ubuntuforums.org/showthread.php?t=786095">right here</a>. I&#8217;ll keep this one around for posterity.</p>
<h2>Dependencies</h2>
<p><strong>This guide is outdated. Please see the &#8220;wait!&#8221; section above.</strong></p>
<p>You&#8217;ll want to remove any existing ffmpeg. (If you&#8217;ll be installing x264 at the same time, remove that too.)</p>
<pre class="brush:bash">
sudo apt-get remove ffmpeg x264 libx264-dev
</pre>
<p>Then you&#8217;ll need some dependencies: (and possibly the universe and multiverse repositories)</p>
<pre class="brush:bash">
sudo apt-get update
sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev
</pre>
<p>If you want, you can install x264. One of the points of VP8 is that we can now avoid using H.264, so that&#8217;s potentially counterintuitive, but the ability to decode H.264 video is useful, so you may want to do this for the moment anyway.</p>
<pre class="brush:bash">
cd
git clone git://git.videolan.org/x264.git
cd x264
./configure
make
sudo checkinstall --pkgname=x264 --pkgversion "2:0.`grep X264_BUILD x264.h -m1 | cut -d' ' -f3`.`git rev-list HEAD | wc -l`+git`git rev-list HEAD -n 1 | head -c 7`" --backup=no --default
</pre>
<h2>libvpx</h2>
<p><strong>This guide is outdated. Please see the &#8220;wait!&#8221; section above.</strong></p>
<p>The WebM site&#8217;s <a href="http://www.webmproject.org/code/">code page</a> lets you decide whether to pull from git or to grab a release. I did the former, although either one will work:</p>
<pre class="brush:bash">
cd
git clone git://review.webmproject.org/libvpx.git
</pre>
<p style="padding-left: 30px;"><strong>Note<span style="font-weight: normal;">:</span></strong> in the comments, Robert adds: &#8220;If you download libvpx-0.9.0.tar.bz2, then make sure to change VPX_IMG_FMT_I420 back to IMG_FMT_I420 in libvpxenc.c and libvpxdec.c.&#8221;</p>
<p>Then you&#8217;ll need to configure and compile libvpx. That&#8217;s fairly easy: (Change the target if you&#8217;re not compiling using GCC on an x86 Linux computer, but you probably are.)</p>
<pre class="brush:bash">
cd libvpx
./configure --target=x86-linux-gcc
make
</pre>
<p>Then you&#8217;ll need to install the headers and library from libvpx, because the makefile&#8217;s install command doesn&#8217;t seem to work at this point:</p>
<pre class="brush:bash">
sudo cp vp8/*.h /usr/include/
sudo cp vpx_codec/*.h /usr/include/
sudo cp vpx_ports/*.h /usr/include/
sudo cp libvpx.a /usr/lib/
</pre>
<p>And you&#8217;re done with libvpx!</p>
<h2>ffmpeg</h2>
<p><strong>This guide is outdated. Please see the &#8220;wait!&#8221; section above.</strong></p>
<p>Getting ffmpeg to compile properly with libvpx is a bit of a pain at the moment. Hopefully the source tree will catch up soon and the patches from WebM won&#8217;t be necessary. For the moment, do the following: (Yes, I know the svn version of ffmpeg is not what&#8217;s listed from WebM, but this one actually works. Not all the patches are applied, as the others don&#8217;t apply cleanly or are already in ffmpeg. You can use a different configure command, but this one is based on the tutorial I linked to above, the &#8211;enable-libvpx-vp8 is really the only necessary part.)</p>
<pre class="brush:bash">
cd
wget http://webm.googlecode.com/files/mplayer-vp8-encdec-support-r2.tar.bz2
tar xvjf mplayer-vp8-encdec-support-r2.tar.bz2
svn checkout -r 23197 svn://svn.ffmpeg.org/ffmpeg/trunk/ ffmpeg
cd ffmpeg
patch -p0 &lt; ../mplayer-vp8-encdec-support/allcodecs-register_VP8.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/allformats-add_webm.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/avcodec-AVCodecContext_add_VP8_specifics.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/avformat-minor_version_bump.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/libavcodec-build_VP8.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/libavcodec-new_options.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/libavformat-build_webm.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/libvpxdec.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/libvpxenc.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/matroskadec-add_webm.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/matroskaenc-add_webm.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/ffmpeg-only/configure-libvpx_test.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/ffmpeg-only/documentation-add_VP8__WEBM.diff
patch -p0 &lt; ../mplayer-vp8-encdec-support/ffmpeg-only/ffpresets-libvpx.diff
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvpx-vp8
make
sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`svn info | grep Revision | awk '{ print $NF }'`" --backup=no --default
</pre>
<p>And then you&#8217;re set! You can try out your new ffmpeg: (Here, video.y4m is your input video, and video.webm is your output file. You have to use the .webm extension for ffmpeg to create a WebM file, and use whatever input video you want. Adjust the threads number to your liking, usually the number of processor cores you have in your computer is a good place to start.)</p>
<pre class="brush:bash">
ffmpeg -i video.y4m -threads 4 video.webm
</pre>
<p>If you want to play with more options, check out libavcodec-new_options.diff in mplayer-vp8-encdec-support. (You can pass those options to ffmpeg as you would any other option.) I&#8217;m not quite clear at the moment on how to get it to run with multiple threads or on multiple cores &#8211; it currently just uses one core on my server, so if anyone has any ideas, that would be nice. Your new WebM videos should play in any of the preview builds of browsers that support WebM, and you can play them back through ffplay as well.</p>
<p>Andy Schmitz</p>
<p>(Thanks to Micheal J., Fritz, and Robert from the comments for useful suggestions.)</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 493px; width: 1px; height: 1px; overflow: hidden;">
<pre style="padding-left: 30px;">mplayer-vp8-encdec-support-r2.tar.bz2</pre>
</div>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-215-1'><a href="http://www.mpegla.com/Lists/MPEG%20LA%20News%20List/Attachments/226/n-10-02-02.pdf">The  press release PDF</a> from MPEG LA, the group licensing the patents for  H.264 <span class='footnotereverse'><a href='#fnref-215-1'>&#8617;</a></span></li>
<li id='fn-215-2'><a href="http://www.adobe.com/devnet/flash/articles/encoding_video.html">An  Adobe article</a> on encoding video for Flash using VP6. An earlier version of this post claimed VP6 was the original codec for Flash, <a href="http://en.wikipedia.org/wiki/Flash_video#File_formats">which is false</a>. <span class='footnotereverse'><a href='#fnref-215-2'>&#8617;</a></span></li>
<li id='fn-215-3'><a href="http://broadcastengineering.com/newsrooms/skype-on2-technologies-truemotion/">A  press release</a> <span class='footnotereverse'><a href='#fnref-215-3'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lardbucket.org/blog/archives/2010/05/19/vp8-webm-and-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>WordPress 2.9 Image/Media Upload Problems</title>
		<link>http://lardbucket.org/blog/archives/2009/12/27/wordpress-2-9-imagemedia-upload-problems/</link>
		<comments>http://lardbucket.org/blog/archives/2009/12/27/wordpress-2-9-imagemedia-upload-problems/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 22:45:41 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://lardbucket.org/blog/?p=211</guid>
		<description><![CDATA[So, as I just spent a half hour fixing friends&#8217; blogs after the upgrade to WordPress 2.9, perhaps this will help someone else if it gets indexed by the search engines: We were having problems with WordPress thinking that it was accepting uploads of images and trying to display them, but the files didn&#8217;t actually [...]]]></description>
			<content:encoded><![CDATA[<p>So, as I just spent a half hour fixing friends&#8217; blogs after the upgrade to WordPress 2.9, perhaps this will help someone else if it gets indexed by the search engines:</p>
<p>We were having problems with WordPress thinking that it was accepting uploads of images and trying to display them, but the files didn&#8217;t actually exist where they should have, throwing a file not found in the browser. It was a bit weird, because the only errors in the server log were that the browser couldn&#8217;t find the file, but the AJAX image editor in WordPress seemed to work. It turns out that somehow the settings got changed. If you&#8217;re having the same problem, follow these steps:</p>
<p><span id="more-211"></span></p>
<ol>
<li>Go to the WordPress Dashboard (your administration panel, where you can create new posts, etc.)</li>
<li>Click &#8220;Settings&#8221; on the sidebar.</li>
<li>Choose &#8220;Miscellaneous&#8221; as a subcategory.</li>
<li>Change &#8220;Store uploads in this folder&#8221; to something correct for your server. In general, this should be &#8220;wp-content/uploads&#8221;, which is supposedly the default.</li>
</ol>
<p>And that&#8217;s it. Image/media uploads will work again.</p>
<p>Andy Schmitz</p>
<p>(It&#8217;s not clear whether the problem was triggered by the upgrade to 2.9 or had existed for some time, but from reports that image uploading worked recently, I&#8217;m inclined to think it may indeed have been the automatic upgrade to 2.9 that caused the problems.)</p>
]]></content:encoded>
			<wfw:commentRss>http://lardbucket.org/blog/archives/2009/12/27/wordpress-2-9-imagemedia-upload-problems/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>For All the People Back on Earth</title>
		<link>http://lardbucket.org/blog/archives/2009/12/25/for-all-the-people-back-on-earth/</link>
		<comments>http://lardbucket.org/blog/archives/2009/12/25/for-all-the-people-back-on-earth/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 06:01:48 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://lardbucket.org/blog/?p=172</guid>
		<description><![CDATA[If you&#8217;re old enough (well, not that old), odds are that you watched this live, or at some point. In what, as far as I can tell, was the first human non-terrestrial Christmas greeting, Frank Borman, Jim Lovell, and William Anders, after noting the lonely view below, read off Genesis 1:1-10, then, &#8220;And from the [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re old enough (well, not <em>that</em> old), odds are that you watched this live, or at some point. In what, as far as I can tell, was the first human non-terrestrial Christmas greeting, Frank Borman, Jim Lovell, and William Anders, after noting the lonely view below, read off Genesis 1:1-10, then,</p>
<blockquote><p>&#8220;And from the crew of Apollo 8, we close with good night, good luck,  a Merry Christmas, and God bless all of you &#8211; all of you on the good Earth.&#8221;</p></blockquote>
<p>And, of course, for anyone who has been persuaded otherwise, just under three hours later, after performing the Trans-Earth Injection on the far side of the moon, Lovell reported back, &#8220;Please be informed, there is a Santa Claus.&#8221; (Houston / Mattingly accepted the information, saying, &#8220;That&#8217;s affirmative. You&#8217;re the best ones to know.&#8221;)</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="262" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="data" value="http://video.lardbucket.org/FlowPlayer.swf?config=%7Bembedded%3Atrue%2CmenuItems%3A%5Bfalse%2Ctrue%2Ctrue%2Cfalse%2Cfalse%2Ctrue%5D%2CshowFullScreenButton%3Afalse%2CplayList%3A%5B%7Burl%3A%27ctp%2Ejpg%27%7D%2C%7Burl%3A%27getVideo%2F354641874%27%7D%5D%2CbaseURL%3A%27http%3A%2F%2Fvideo%2Elardbucket%2Eorg%2F%27%2CshowPlayListButtons%3Afalse%2CshowLoopButton%3Afalse%2CinitialScale%3A%27orig%27%2Cloop%3Afalse%2CautoPlay%3Afalse%7D" /><param name="bgcolor" value="111111" /><param name="src" value="http://video.lardbucket.org/FlowPlayer.swf?config=%7Bembedded%3Atrue%2CmenuItems%3A%5Bfalse%2Ctrue%2Ctrue%2Cfalse%2Cfalse%2Ctrue%5D%2CshowFullScreenButton%3Afalse%2CplayList%3A%5B%7Burl%3A%27ctp%2Ejpg%27%7D%2C%7Burl%3A%27getVideo%2F354641874%27%7D%5D%2CbaseURL%3A%27http%3A%2F%2Fvideo%2Elardbucket%2Eorg%2F%27%2CshowPlayListButtons%3Afalse%2CshowLoopButton%3Afalse%2CinitialScale%3A%27orig%27%2Cloop%3Afalse%2CautoPlay%3Afalse%7D" /><embed type="application/x-shockwave-flash" width="320" height="262" src="http://video.lardbucket.org/FlowPlayer.swf?config=%7Bembedded%3Atrue%2CmenuItems%3A%5Bfalse%2Ctrue%2Ctrue%2Cfalse%2Cfalse%2Ctrue%5D%2CshowFullScreenButton%3Afalse%2CplayList%3A%5B%7Burl%3A%27ctp%2Ejpg%27%7D%2C%7Burl%3A%27getVideo%2F354641874%27%7D%5D%2CbaseURL%3A%27http%3A%2F%2Fvideo%2Elardbucket%2Eorg%2F%27%2CshowPlayListButtons%3Afalse%2CshowLoopButton%3Afalse%2CinitialScale%3A%27orig%27%2Cloop%3Afalse%2CautoPlay%3Afalse%7D" bgcolor="111111" data="http://video.lardbucket.org/FlowPlayer.swf?config=%7Bembedded%3Atrue%2CmenuItems%3A%5Bfalse%2Ctrue%2Ctrue%2Cfalse%2Cfalse%2Ctrue%5D%2CshowFullScreenButton%3Afalse%2CplayList%3A%5B%7Burl%3A%27ctp%2Ejpg%27%7D%2C%7Burl%3A%27getVideo%2F354641874%27%7D%5D%2CbaseURL%3A%27http%3A%2F%2Fvideo%2Elardbucket%2Eorg%2F%27%2CshowPlayListButtons%3Afalse%2CshowLoopButton%3Afalse%2CinitialScale%3A%27orig%27%2Cloop%3Afalse%2CautoPlay%3Afalse%7D"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://lardbucket.org/blog/archives/2009/12/25/for-all-the-people-back-on-earth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MIPS and spimbot</title>
		<link>http://lardbucket.org/blog/archives/2009/11/20/mips-and-spimbot/</link>
		<comments>http://lardbucket.org/blog/archives/2009/11/20/mips-and-spimbot/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 20:38:50 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://lardbucket.org/blog/?p=204</guid>
		<description><![CDATA[So, the CS232 spimbot competition was today. My partner (Connor Simmons) and I made a robot (actually just a piece of code) that came in second out of 37 (or 38?). It was a rather interesting competition. The page on it that I&#8217;ve set up (complete with MIT-licensed source code) is right here. I remain [...]]]></description>
			<content:encoded><![CDATA[<p>So, the CS232 spimbot competition was today. My partner (Connor Simmons) and I made a robot (actually just a piece of code) that came in second out of 37 (or 38?). It was a rather interesting competition. The page on it that I&#8217;ve set up (complete with MIT-licensed source code) is <a href="http://lardbucket.org/projects/spimbot/">right here</a>.</p>
<p>I remain impressed by the only team to beat us (and their come-from-behind win), whose inventive approach used an attack on the time-based seed of the random number generator to find where the tokens could be placed within the 50 minutes the competition was run. The one-second resolution used as a seed for the random number generator gave a small enough number of possible locations for tokens that they were able to accurately predict where all the tokens would be given just one token&#8217;s location. This strategy meant they lost a number of matches (I assume to slow calculations, but I may be wrong), including to our robot, but in the end, they were able to win more often (or by more tokens), so congratulations to them.</p>
<p>Andy Schmitz</p>
]]></content:encoded>
			<wfw:commentRss>http://lardbucket.org/blog/archives/2009/11/20/mips-and-spimbot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Illinois Basic Skills Test</title>
		<link>http://lardbucket.org/blog/archives/2009/11/14/the-illinois-basic-skills-test/</link>
		<comments>http://lardbucket.org/blog/archives/2009/11/14/the-illinois-basic-skills-test/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 21:28:56 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://lardbucket.org/blog/?p=200</guid>
		<description><![CDATA[The Illinois Certification Testing System&#8216;s Basic Skills Test is required for admission to any secondary education (high school, middle school) teaching program in Illinois. (Notably, I&#8217;m taking it today.) It has 126 questions: 48 Reading Comprehension Questions 42 Language Arts Questions 35 Mathematics Questions 1 Writing Assignment So, nearly everyone taking the test has also [...]]]></description>
			<content:encoded><![CDATA[<h2 style="font-size: 1.5em;"><span style="font-weight: normal; font-size: 13px;">The <a href="http://www.icts.nesinc.com/index.asp">Illinois Certification Testing System</a>&#8216;s Basic Skills Test is required for admission to any secondary education (high school, middle school) teaching program in Illinois. (Notably, I&#8217;m taking it today.) It has 126 questions:</span></h2>
<ul>
<li>48 Reading Comprehension Questions</li>
<li>42 Language Arts Questions</li>
<li>35 Mathematics Questions</li>
<li>1 Writing Assignment</li>
</ul>
<p>So, nearly everyone taking the test has also taken the ACT (required in Illinois for high school graduation in most cases). On the ACT, these sets should take:</p>
<ul>
<li>48 Reading Questions &#8211; 42 minutes (48 questions * (35 minutes / 40 questions)) [<a href="http://www.actstudent.org/testprep/descriptions/readdescript.html">reference</a>]</li>
<li>42 Language Arts [English] Questions &#8211; 25.2 minutes (42 questions * (45 minutes / 75 questions)) [<a href="http://www.actstudent.org/testprep/descriptions/engdescript.html">reference</a>]</li>
<li>35 Mathematics Questions &#8211; 35 minutes (35 questions * (60 minutes / 60 questions)) [<a href="http://www.actstudent.org/testprep/descriptions/mathdescript.html">reference</a>]</li>
<li>1 Writing Assignment &#8211; 30 minutes [<a href="http://www.actstudent.org/testprep/descriptions/writingdescript.html">reference</a>]</li>
</ul>
<p>And yes, they&#8217;re about the same difficulty (see: PDF list of tested skills for <a href="http://www.icts.nesinc.com/PDFs/IL_fld096R_FW.pdf">ICTS Basic Skills Test</a> and the <a href="http://www.act.org/standard/pdf/CRS.pdf">ACT</a>). Having looked through the materials for both, I&#8217;d put the ICTS Basic Skills Test somewhere around the middle of the ACT&#8217;s level of questions, if a bit toward the higher end in some cases. (I looked mainly at the math questions, but the same seemed to hold for the reading and English questions as well).</p>
<p>So, that&#8217;s about 132.2 minutes. So, just over two hours. Say 2.5. Except the ICTS Basic Skills Test gives twice that. 5 hours. To answer 125 questions and write a short (five-paragraph is fine) essay. That just seems wrong. And the Basic Skills Test also allows the person taking it to skip around in the sections as much as they like (so there&#8217;s no lost time in waiting for a section to end, which is effectively expected in the ACT).</p>
<p>(Notably, the ACT&#8217;s &#8220;Services for Students with Disabilities&#8221; gives time-and-a-half testing as their <a href="http://www.act.org/aap/disab/index.html">standard extended time solution</a>. The Basic Skills Test default is more than time-and-a-half, and <a href="http://www.icts.nesinc.com/IL14_altarrangements.asp">also allows time extensions</a> for test takers with disabilities.)</p>
<p>Somehow, it seems as though the Basic Skills Test doesn&#8217;t really do anything. It&#8217;s effectively &#8220;easier&#8221; than the ACT for most (all?) students who got into a college, so adding it as a requirement makes little sense. A &#8220;passing&#8221; Basic Skills Test is 240 out of a scaled 100-300 score, with lower minimum requirements on each section.  It&#8217;s unlikely to be scaled in the same way the ACT test is (which actually is scaled from 1-36 as far as I can tell, although few students score below an 11), but if it were, that would be equivalent to roughly a 24 on the ACT, assuming a quick Google calculation was correct. However, I would also say it&#8217;s easier to do well on the basic skills test, with the extra time and fewer types of questions, not to mention at least an extra year of knowledge.</p>
<p>Does anyone else see any value in this? I assume (but haven&#8217;t verified) that there are additional qualifications once one wants to actually get certified to teach (rather than simply to learn how to), so is there any reason for this requirement? I&#8217;m also not particularly happy that the website for such a supposedly impartial (and necessary) test is listed as &#8220;Copyright © 2009 Pearson Education, Inc. or its affiliate(s).&#8221;</p>
<p>Andy Schmitz</p>
]]></content:encoded>
			<wfw:commentRss>http://lardbucket.org/blog/archives/2009/11/14/the-illinois-basic-skills-test/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Notes: Time, USPS</title>
		<link>http://lardbucket.org/blog/archives/2009/11/13/notes-time-usps/</link>
		<comments>http://lardbucket.org/blog/archives/2009/11/13/notes-time-usps/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 22:30:29 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://lardbucket.org/blog/?p=199</guid>
		<description><![CDATA[Time For some reason my computer&#8217;s clock got set a good 12 minutes ahead. I&#8217;m not exactly sure why, but it appears to have happened around a restart, perhaps due to a hardware clock that&#8217;s off, and the NTP daemon didn&#8217;t correct it. To manually reset the time based on a time server in Ubuntu, [...]]]></description>
			<content:encoded><![CDATA[<h2>Time</h2>
<p>For some reason my computer&#8217;s clock got set a good 12 minutes ahead. I&#8217;m not exactly sure why, but it appears to have happened around a restart, perhaps due to a hardware clock that&#8217;s off, and the NTP daemon didn&#8217;t correct it. To manually reset the time based on a time server in Ubuntu, run</p>
<pre>sudo /etc/init.d/ntp stop
sudo ntpdate ntp.ubuntu.com
sudo /etc/init.d/ntp start</pre>
<p>If you don&#8217;t stop the NTP daemon first, you&#8217;ll get &#8220;ntpdate[<em>pid</em>]: the NTP socket is in use, exiting&#8221;. Notably, <a href="http://lists.debian.org/debian-user/2002/12/msg04091.html">don&#8217;t do this in a cron job</a>, as ntpd should be enough. (It&#8217;s not clear why ntpd didn&#8217;t resolve the issue in the first place, but I&#8217;m blaming that on some configuration bug.)</p>
<h2>BOINC and Time</h2>
<p>BOINC seems to have had a bit of a problem with the time shift. (It was normally set at 80% usage, and jumped to 100% with absurd remaining times.) That turns out to be pretty easy to fix:</p>
<pre>sudo /etc/init.d/boinc-client restart</pre>
<p>And it should be good to go. It may still have some strange estimates for time (it would likely be safer to stop boinc-client before updating the time and then start it afterward, if I realized that would be an issue), but that&#8217;ll be fixed after the current workunits complete.</p>
<h2>USPS Tracking</h2>
<p>If you have a label number for a USPS package you want to track, you can bookmark this URL (obviously, put your number at the end) or keep it open in a tab. It&#8217;s not the result of a form submission, so refreshing won&#8217;t prompt for a resubmit, and loading the page again won&#8217;t ask for the tracking number.</p>
<pre>http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?origTrackNum=[Your tracking number]</pre>
]]></content:encoded>
			<wfw:commentRss>http://lardbucket.org/blog/archives/2009/11/13/notes-time-usps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GraphSketch: 30,000 Graphs, and Parametric</title>
		<link>http://lardbucket.org/blog/archives/2009/10/03/graphsketch-parametric/</link>
		<comments>http://lardbucket.org/blog/archives/2009/10/03/graphsketch-parametric/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 15:41:15 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Ego]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lardbucket.org/blog/?p=193</guid>
		<description><![CDATA[Yesterday, GraphSketch passed over 30,000 graphs rendered. That&#8217;s quite a few. Thanks to everyone for making it so popular. It also seemed like a good time to release something I&#8217;ve been working on smoothing out for the past few weeks: Yep, you can now graph parametric equations. Just head over to http://graphsketch.com/parametric (or click the [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, <a title="GraphSketch" href="http://graphsketch.com">GraphSketch</a> passed over 30,000 graphs rendered. That&#8217;s quite a few. Thanks to everyone for making it so popular.</p>
<p>It also seemed like a good time to release something I&#8217;ve been working on smoothing out for the past few weeks:</p>
<p><img class="aligncenter size-full wp-image-192" title="GraphSketch Parametric" src="http://lardbucket.org/blog/wp-content/uploads/2009/10/graph_20091003_002500.png" alt="GraphSketch Parametric" width="300" height="300" />Yep, you can now graph parametric equations. Just head over to <a title="GraphSketch Parametric" href="http://graphsketch.com/parametric">http://graphsketch.com/parametric</a> (or click the &#8220;Parametric&#8221;mode just above the equations on the main GraphSketch page).</p>
<p>To keep things simple, you can only graph three parametric sets of equations at the same time. You can choose the range for t, and it defaults to a reasonable -10 to 10.</p>
<p>Also, while I was updating the website, I made the text a bit smaller (about the difference of going from a 12pt font to a 10pt font) and added a (hopefully unobtrusive) section pointing out the availability of posters, should anyone be interested. Polar graphing should come soon, hopefully, but it is somewhat possible using parametric equations by setting x=r*cos(t) and y=r*sin(t), too.</p>
<p>Andy Schmitz</p>
]]></content:encoded>
			<wfw:commentRss>http://lardbucket.org/blog/archives/2009/10/03/graphsketch-parametric/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Posters</title>
		<link>http://lardbucket.org/blog/archives/2009/10/02/posters/</link>
		<comments>http://lardbucket.org/blog/archives/2009/10/02/posters/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 05:29:14 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Ego]]></category>
		<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://lardbucket.org/blog/?p=194</guid>
		<description><![CDATA[A number of you who know me in real life have probably seen a number of my posters. Three of them currently adorn my dorm room. I had been offering them to friends I knew, but not to everyone, because I hadn&#8217;t gotten around to it. But that has changed now, with posters.lardbucket.org. The website [...]]]></description>
			<content:encoded><![CDATA[<p>A number of you who know me in real life have probably seen a number of my posters. Three of them currently adorn my dorm room. I had been offering them to friends I knew, but not to everyone, because I hadn&#8217;t gotten around to it. But that has changed now, with <a title="Lardbucket Posters" href="http://posters.lardbucket.org/">posters.lardbucket.org</a>.</p>
<p style="text-align: center;"><a href="http://posters.lardbucket.org/"><img class="aligncenter" title="Poster 001" src="http://posters.lardbucket.org/001/thumb.jpg" alt="" width="200" height="150" /></a></p>
<p>The website itself is (purposely) a bit sparse, but it will let you browse the four existing posters, and grab one for yourself from <a title="Zazzle" href="http://www.zazzle.com/?rf=238118109842721973">Zazzle</a> at fairly reasonable prices. (I really only make a few dollars from each one, depending on size.) Other than taking a while to ship, Zazzle&#8217;s processing has been fairly good, and the three large prints I have from them are reasonably high quality, even on their &#8220;basic poster&#8221; paper.</p>
<p>Each of the posters on <a title="posters.lardbucket.org" href="http://posters.lardbucket.org/">posters.lardbucket.org</a> was created by me, using a reasonably high-powered computer to do the rendering. Each of the posters is a mathematically-defined rendering, and could theoretically be rendered at any size and not lose any detail. Therefore, the large posters are still high quality images.</p>
<p>So, if you&#8217;d like to get a neat-looking poster and send a few dollars my way at the same time, have a look at <a title="posters.lardbucket.org" href="http://posters.lardbucket.org/">posters.lardbucket.org</a>.</p>
<p>Thanks,<br />
Andy Schmitz</p>
]]></content:encoded>
			<wfw:commentRss>http://lardbucket.org/blog/archives/2009/10/02/posters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PvPGN for a Private LAN</title>
		<link>http://lardbucket.org/blog/archives/2009/07/07/pvpgn-for-a-private-lan/</link>
		<comments>http://lardbucket.org/blog/archives/2009/07/07/pvpgn-for-a-private-lan/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 04:43:48 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://lardbucket.org/blog/?p=189</guid>
		<description><![CDATA[A few notes on setting up PvPGN (the continuation of bnetd) for a private LAN. (The reason I&#8217;m setting it up is that I don&#8217;t expect to have an Internet connection for connecting to Battle.net proper, and would like to have the capabilities it provides, especially ladder games.) This post is generally much more technical [...]]]></description>
			<content:encoded><![CDATA[<p>A few notes on setting up <a href="http://pvpgn.berlios.de/">PvPGN</a> (the continuation of bnetd) for a private LAN. (The reason I&#8217;m setting it up is that I don&#8217;t expect to have an Internet connection for connecting to Battle.net proper, and would like to have the capabilities it provides, especially ladder games.) This post is generally much more technical than most of my previous posts, so you may want to skip it if you&#8217;re not really sure what&#8217;s going on. You won&#8217;t miss much.</p>
<p>So, my setup involves a router with <a href="http://dd-wrt.com/">DD-WRT</a>, and an <a href="http://laptop.org/en/laptop/index.shtml">OLPC XO</a>. The XO is set up using <a href="http://www.olpcnews.com/forum/index.php?topic=4053.0">Ubuntu Intrepid on an SD card</a>.</p>
<p><span id="more-189"></span>XO: Installed packages &#8220;build-essential&#8221;, &#8220;libz-dev&#8221;, and &#8220;cmake&#8221;. Grabbed the latest development snapshot of PvPGN (1.99 r521), and compiled it using cmake, make, sudo make install. Configuration gets installed in /usr/local/etc, other files in /usr/local/var. The PvPGN support files (also available from their download website) need to be extracted into /usr/local/var/files. Also from /usr/local/var/files, use bnftp to grab the relevant update files for the latest version. Edit /usr/local/etc/bnetd.conf to satisfaction. I also ran &#8220;chmod -R a+w /usr/local/var&#8221; and &#8220;chmod -R a+w /usr/local/etc&#8221;, though it&#8217;s likely that only the former is necessary, and not even that if you tune users properly. This was more of a quick hack than something I&#8217;d use for a long-term server. I grabbed the newest <a href="http://cvs.berlios.de/cgi-bin/viewcvs.cgi/pvpgn/pvpgn/conf/autoupdate.conf?view=co">autoupdate.conf</a> and <a href="http://cvs.berlios.de/cgi-bin/viewcvs.cgi/pvpgn/pvpgn/conf/versioncheck.conf?view=co">versioncheck.conf</a> files from the PvPGN CVS server, and uncommented the links to the files I&#8217;d downloaded in autoupdate.conf. I also found that for the StarCraft entries, I needed to create one without the version number extension, to allow earlier versions of StarCraft to update (for some reason, it wasn&#8217;t being caught by versioncheck.conf, even after I uncommented the right sections). That meant adding a line like &#8220;IX86    STAR    STAR        STAR_IX86_1xx_1161.mpq&#8221; to autoupdate.conf. Watch out for duplicate instructions for the same version but different updates though, I&#8217;m not sure what that could do. (This last portion was only useful because I am redirecting the pre-patch battle.net server to PvPGN, and wouldn&#8217;t help most people.)</p>
<p>Router: Set up fairly trivial wireless encryption, mainly to make it clear that the AP isn&#8217;t useful to most people. Added a static lease to dhcpd under DD-WRT&#8217;s Services menu, giving the XO a fixed IP address outside the standard DHCP address range (by MAC address). Enabled dnsmasq to let me redirect battle.net domains, adding the lines &#8220;address=/europe.battle.net/192.168.1.50&#8243; and &#8220;address=/exodus.battle.net/192.168.1.50&#8243; to the dnsmasq configuration options, redirecting the Europe Battle.net server to my XO, as well as pointing the default pre-patching server (for StarCraft, anyway) to the same location. (The other battle.net subdomains are uswest, useast, and asia.) For some reason, &#8220;Apply Settings&#8221; didn&#8217;t work for me, but &#8220;Reboot Router&#8221; after applying the settings did work.</p>
<p>Clients: Nothing here was necessary, but I did perform a few tests. Things worked almost immediately. Automatic updates worked fine, even from unpatched installs (of StarCraft 1.05), after adding the lines above to autoupdate.conf.</p>
<p>So, it should work reasonably well. I don&#8217;t feel bad about redirecting the battle.net domains, because nobody would be using the router without knowing that was the case. It&#8217;s also not really allowing illegal copies of the games, because I can make sure there&#8217;s a legitimate copy of the game for everyone connecting to the router when I give out the encryption keys. Overall, it should work out reasonably well. The one thing I&#8217;m not thrilled about is the fact that the Marvell Wi-Fi  drivers on the XO don&#8217;t seem to support Master (AP) mode. If that were the case, I could have the PvPGN server and router on one laptop, and not even need power at all, but unfortunately, that doesn&#8217;t seem like it will work at the moment.</p>
<p>Andy</p>
]]></content:encoded>
			<wfw:commentRss>http://lardbucket.org/blog/archives/2009/07/07/pvpgn-for-a-private-lan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
