<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Software by Steven &#187; seneca</title>
	<atom:link href="http://sweerdenburg.wordpress.com/category/seneca/feed/" rel="self" type="application/rss+xml" />
	<link>http://sweerdenburg.wordpress.com</link>
	<description>Sometimes a square peg is a round hole</description>
	<lastBuildDate>Sat, 10 Mar 2012 18:48:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sweerdenburg.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Software by Steven &#187; seneca</title>
		<link>http://sweerdenburg.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sweerdenburg.wordpress.com/osd.xml" title="Software by Steven" />
	<atom:link rel='hub' href='http://sweerdenburg.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Working with cookies in JS</title>
		<link>http://sweerdenburg.wordpress.com/2011/09/17/working-with-cookies-in-js/</link>
		<comments>http://sweerdenburg.wordpress.com/2011/09/17/working-with-cookies-in-js/#comments</comments>
		<pubDate>Sat, 17 Sep 2011 18:12:48 +0000</pubDate>
		<dc:creator>sweerdenburg</dc:creator>
				<category><![CDATA[js]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://sweerdenburg.wordpress.com/?p=458</guid>
		<description><![CDATA[Well, it has certainly been a while since I&#8217;ve blogged. I&#8217;ve been working with data-driven tables a little bit recently, and the need came up to allow users to click on the table cells, and to persist a record of these clicks. Rather than store this in the database, it made more sense to use [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=458&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well, it has certainly been a while since I&#8217;ve blogged.</p>
<p>I&#8217;ve been working with data-driven tables a little bit recently, and the need came up to allow users to click on the table cells, and to persist a record of these clicks. Rather than store this in the database, it made more sense to use cookies. Not having worked with cookies for a while, I started playing around. I ran into a few gotchas.</p>
<p><strong>FIRST</strong> <strong>GOTCHA</strong>: Cookies can only be managed in the context of a web server.</p>
<p>Everything started great. I found some <a title="sample code" href="http://www.quirksmode.org/js/cookies.html">sample code online</a> to base the solution off of, and I began to I hooked all the events in, but data wasn&#8217;t persisting. No errors were being thrown. After some debugging work, it looked like it was never being set. Incidentally, this was because I was running the file off the file system (file://clickClick.html). No errors are thrown, no warnings are raised, it just won&#8217;t set unless you run it from a web server. After starting up Apache and running it from localhost, everything worked great. For a while.</p>
<p><strong>SECOND<strong></strong> <strong>GOTCHA</strong></strong>: With jQuery, the unload event is on &#8216;window&#8217;, not &#8216;document&#8217;</p>
<p>My plan was to save the click results to a cookie when the page leaves, either via refresh or leaving the page altogether. Not bothering to read the documentation thoroughly, I tried this and expected it to work:</p>
<pre>$(document).unload(function() {   ...   });</pre>
<p>Turns out it didn&#8217;t. After some trawling of jquery&#8217;s documentation, I discovered it was the window object I wanted to hook into, not document. As with the cookies, this didn&#8217;t fire off an error, it just hooks into a user-created event that, unsurprisingly, is never fired by the browser. Switching &#8216;document&#8217; to &#8216;window&#8217; fixed this.</p>
<p><strong>FINAL GOTCHA</strong>: Internet Explorer does not seem to support character indexing via [] operator</p>
<p>My method of saving data to a cookie is serializing a table into a string of &#8217;1&#8242;s and &#8217;0&#8242;s and storing it in a cookie, then reading that string back from the cookie and acting on it. Firefox and Chrome could handle reading individual characters fine by indexing the string like an array:</p>
<pre>if(oldCookieVal[i] === '1') {
              ...
}</pre>
<p>When testing on IE, I got an &#8220;unsupported property&#8221; error. Turns out IE treats strings like any other object, and will use indexing to perform a property lookup on the object. So if i = 3, instead of retrieving the fourth character in a string, IE was trying to do this:</p>
<pre>if(oldCookieVal.3 === '1') {
              ...
}</pre>
<p>Which broke the code. Switching to using the &#8216;charAt&#8217; js function fixed this. Another solution would&#8217;ve been to split the string into an array before processing it.</p>
<p>With these lessons learned, I successfully created a working prototype of a solution. You can see the final result <a href="https://gist.github.com/1224121">here</a>. It has been tested on Firefox 3.5.19, 6.0.2, Chrome 14, IE 9, Safari 5, and Opera 11.01/11.51. Presently there&#8217;s an issue with Opera not hooking into the unload event through jQuery, but moving the cookie setting code into the &#8216;mousedown&#8217; event handler solves this.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sweerdenburg.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sweerdenburg.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sweerdenburg.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sweerdenburg.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sweerdenburg.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sweerdenburg.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sweerdenburg.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sweerdenburg.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sweerdenburg.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sweerdenburg.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sweerdenburg.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sweerdenburg.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sweerdenburg.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sweerdenburg.wordpress.com/458/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=458&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sweerdenburg.wordpress.com/2011/09/17/working-with-cookies-in-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8cff1e259837c8584346444f0a510fbc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sweerdenburg</media:title>
		</media:content>
	</item>
		<item>
		<title>Popcorn and Soundcloud</title>
		<link>http://sweerdenburg.wordpress.com/2011/04/22/popcorn-and-soundcloud/</link>
		<comments>http://sweerdenburg.wordpress.com/2011/04/22/popcorn-and-soundcloud/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 03:24:54 +0000</pubDate>
		<dc:creator>sweerdenburg</dc:creator>
				<category><![CDATA[js]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[popcorn]]></category>
		<category><![CDATA[seneca]]></category>

		<guid isPermaLink="false">http://sweerdenburg.wordpress.com/?p=444</guid>
		<description><![CDATA[Recently, Popcorn.js began to support custom players. When Henrik Moltke started a conversation going to get Soundcloud working with Popcorn, beautiful things started to happen. Soundcloud and Popcorn developers collaborated to create a Soundcloud player as well as some great plugins. Watch out for upcoming work from Henrik, Mark Boas and more as Mozilla&#8217;s Hyper Audio [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=444&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently, <a href="http://popcornjs.org/">Popcorn.js</a> began to support custom players. When <a href="http://www.henrikmoltke.dk/">Henrik Moltke</a> started a conversation going to get <a href="http://soundcloud.com/">Soundcloud</a> working with Popcorn, beautiful things started to happen. Soundcloud and Popcorn developers collaborated to create a Soundcloud player as well as some great plugins. Watch out for upcoming work from Henrik, <a href="http://happyworm.com/">Mark Boas</a> and more as Mozilla&#8217;s <a href="http://yoyodyne.cc/hyperdisk/">Hyper Audio</a> project continues: they&#8217;ve been cooking up some great works and demos. The union of Popcorn.js, Soundcloud, <a href="http://www.radiolab.org/">Radiolab</a>, combined with Henrik, Mark and many others has produced a great <a href="http://yoyodyne.cc/radiolab/">Radiolab Player demo</a>. For my own part in the process, working with everyone has been terrific.</p>
<p>Popcorn 0.5 has also come out today, and includes some of the results of this effort. A custom player for use with Soundcloud has landed, which can be used with Popcorn simply, like so:</p>
<pre>var popcorn = Popcorn( Popcorn.soundcloud( "contentId", "http://soundcloud.com/fitn/cotton-in-the-ears" } ));</pre>
<p>Using the Soundcloud player with Popcorn like this will place Soundcloud&#8217;s player inside the HTML Element on the web page with the corresponding id &#8220;contentId&#8221;. The Soundcloud player will then play the track found at &#8220;http://soundcloud.com/fitn/cotton-in-the-ears&#8221;. This can then all be controlled through Popcorn, complete with timed track events. Be sure to check it and more out in the <a href="http://webmademovies.org/popcorn-0-5-now-with-soundcloud">new release</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sweerdenburg.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sweerdenburg.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sweerdenburg.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sweerdenburg.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sweerdenburg.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sweerdenburg.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sweerdenburg.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sweerdenburg.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sweerdenburg.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sweerdenburg.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sweerdenburg.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sweerdenburg.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sweerdenburg.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sweerdenburg.wordpress.com/444/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=444&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sweerdenburg.wordpress.com/2011/04/22/popcorn-and-soundcloud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8cff1e259837c8584346444f0a510fbc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sweerdenburg</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom HTML5 Video Objects: Timing</title>
		<link>http://sweerdenburg.wordpress.com/2011/03/18/custom-html5-video-objects-timing/</link>
		<comments>http://sweerdenburg.wordpress.com/2011/03/18/custom-html5-video-objects-timing/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 23:14:01 +0000</pubDate>
		<dc:creator>sweerdenburg</dc:creator>
				<category><![CDATA[js]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://sweerdenburg.wordpress.com/?p=402</guid>
		<description><![CDATA[In my last blog posting, I touched on defining your own implementation of an HTML5 Video. Basically all it takes is to implement the HTMLMediaElement interface on an object by defining the methods and attributes listed. It&#8217;s easy. In fact, here&#8217;s a starting skeleton I&#8217;ve whipped up: var undef; var MediaElement = {   load: function() [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=402&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://sweerdenburg.wordpress.com/2011/03/18/defining-your-own-html5-video-object/">last blog posting</a>, I touched on defining your own implementation of an HTML5 Video. Basically all it takes is to implement the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#media-elements">HTMLMediaElement interface</a> on an object by defining the methods and attributes listed. It&#8217;s easy. In fact, here&#8217;s a starting skeleton I&#8217;ve whipped up:</p>
<pre>var undef;

var MediaElement = {
  load: function() {},
  play: function() {},
  pause: function() {},

  readyState: 0,
  currentTime: 0,
  duration: 0,
  paused: 1,
  ended: 0,
  volume: 1,
  muted: 0,
  playbackRate: 1
  // These are considered to be "on" by being defined. Initialized to undefined
  autoplay: undef,
  loop: undef,
};</pre>
<p>Those are a subset of methods and attributes and a give a good start, though there is a whole lot more functionality that may be implemented if desired. Even though we have the attributes, one important mechanism is missing. Videos update at regular intervals, which is something we&#8217;ll need to account for in our video object. This is also incredibly easy to do. According to the spec, time updates should occur every &#8220;15 to 250ms&#8221;:</p>
<pre>var msDelay = 250;

function timerTick() {
  // Run code here

  setTimeout( timerTick, msDelay );
}</pre>
<p>The above code will execute the &#8220;timerTick&#8221; function every 250 ms. I&#8217;ve created a timed loop using setTimeout instead of setInterval because setInterval has the unfortunate side-effects of not firing at reliable times as well as eating errors. In other words, setTimeout is used so that the program will let me know if it&#8217;s not working properly, as well as it will not be delayed by other js code that is executing on the page.</p>
<p>With this in place, these two code snippets can be tied together (with less than 10 extra lines of code) to create a basic video wrapper:</p>
<pre>var undef;
var msDelay = 250;

var MediaElement = {
  load: function() {},
  play: function() {
    this.paused = 0;
    // So we can keep track of the instance
    timerTick.call( this );
  },
  pause: function() {
    this.paused = 1;
  },

  readyState: 0,
  currentTime: 0,
  duration: 0,
  paused: 1,
  ended: 0,
  volume: 1,
  muted: 0,
  playbackRate: 1,

  // These are considered to be "on" by being defined. Initialize to undefined
  autoplay: undef,
  loop: undef
};

function timerTick() {
  // The player was paused since the last time update
  if ( this.paused ) {
    return;
  }

  // So we can refer to the instance when setTimeout is run
  var self = this;

  // Run code here

  setTimeout( function() {
    timerTick.call( self );
  }, msDelay );
}</pre>
<p>And just like that, you have a custom HTML5 &#8220;Video&#8221;. Check out a <a href="http://matrix.senecac.on.ca/~sweerdenburg/Projects/HTMLVideo/demo.html">simple demo</a> or view the source <a href="http://pastebin.com/0LnTdTup">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sweerdenburg.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sweerdenburg.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sweerdenburg.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sweerdenburg.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sweerdenburg.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sweerdenburg.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sweerdenburg.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sweerdenburg.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sweerdenburg.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sweerdenburg.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sweerdenburg.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sweerdenburg.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sweerdenburg.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sweerdenburg.wordpress.com/402/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=402&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sweerdenburg.wordpress.com/2011/03/18/custom-html5-video-objects-timing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8cff1e259837c8584346444f0a510fbc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sweerdenburg</media:title>
		</media:content>
	</item>
		<item>
		<title>Defining your own HTML5 Video Object</title>
		<link>http://sweerdenburg.wordpress.com/2011/03/18/defining-your-own-html5-video-object/</link>
		<comments>http://sweerdenburg.wordpress.com/2011/03/18/defining-your-own-html5-video-object/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 22:04:08 +0000</pubDate>
		<dc:creator>sweerdenburg</dc:creator>
				<category><![CDATA[js]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[popcorn]]></category>
		<category><![CDATA[seneca]]></category>

		<guid isPermaLink="false">http://sweerdenburg.wordpress.com/?p=393</guid>
		<description><![CDATA[With the introduction of HTML5, the &#60;video&#62; element offers a great deal of flexibility and scriptability to web-based video technologies. Popcorn.js takes this and runs with it, allowing everything on the page to work with a video to create great interactive webpages. Just check out what secretrobotron has made to see what I&#8217;m talking about. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=393&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With the introduction of HTML5, the &lt;video&gt; element offers a great deal of flexibility and scriptability to web-based video technologies. Popcorn.js takes this and runs with it, allowing everything on the page to work with a video to create great interactive webpages. Just check out what <a href="http://robothaus.org/Popcorn-with-Brendan/3dpopcorn.html">secretrobotron has made</a> to see what I&#8217;m talking about. This can be taken further if you wrap non-HTML5 video sources so that they appear to look and act like HTML5 video.</p>
<p>I&#8217;ve been doing a lot of twiddling with this lately, and see lots of applications for it. A simple example is a slideshow, made up of an array of images timed to change every, oh, five seconds or so. This is no different from an ordinary video where thousands of images change at a rate of 24 or more times per second. If this ordinary array of images were wrapped to look like a video, it could then be tied into Popcorn and let loose. Not only could a slideshow be started, stopped and seeked through but other neat options begin to open up.</p>
<p>What if we want to dynamically caption the slide show images? What if we want to cue an &lt;audio&gt; element to play a sound for different sections of the slide show? What if we want to show additional information about the images or author like Twitter, Google Maps or more? This functionality is readily-available through Popcorn&#8217;s plugins. But if we really want to get creative&#8230;</p>
<p>We could make one of the images in the slide show actually be a &lt;canvas&gt; element hosting a <a href="http://processingjs.org/">Processing.js</a> sketch which plays for a few seconds in the middle of a slideshow. In that Processing.js sketch we could then have JavaScript that runs completely independent of Popcorn but may interact and control it to create a relationship where the player and video feed off of each other. We could also simplify things and just go back to our array of ordinary images but increase the cycling time from once every 5 seconds to once every 1/24 of a second to create fluid motion. Doing this would emulate a video in every sense, but 100% dynamic images means 100% dynamic video content.</p>
<p>Eventually, I see the only limit being imagination.</p>
<p>HTML5 Video (like HTML5 Audio) implements a standard interface called &#8220;HTMLMediaElement&#8221;. You can check out the spec <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#media-elements">here</a>. To get a video-like object going, all one has to do is have a JavaScript object define the methods and attributes of this interface. Such is the nature of open web, where innovation only requires knowledge and expectation of an interface. While some work in this area has been done for the <a href="http://webmademovies.org/popcorn-js-0-4-is-here">0.4 version of Popcorn</a> (out now), the real playground will open for the 0.5 release where it will be as easy to create custom &#8220;player plugins&#8221; as it is right now to make ordinary plugins.</p>
<p>Time to start getting inspired.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sweerdenburg.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sweerdenburg.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sweerdenburg.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sweerdenburg.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sweerdenburg.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sweerdenburg.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sweerdenburg.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sweerdenburg.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sweerdenburg.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sweerdenburg.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sweerdenburg.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sweerdenburg.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sweerdenburg.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sweerdenburg.wordpress.com/393/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=393&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sweerdenburg.wordpress.com/2011/03/18/defining-your-own-html5-video-object/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8cff1e259837c8584346444f0a510fbc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sweerdenburg</media:title>
		</media:content>
	</item>
		<item>
		<title>More subtitle formats for Popcorn.js</title>
		<link>http://sweerdenburg.wordpress.com/2011/02/06/more-subtitle-formats-for-popcorn/</link>
		<comments>http://sweerdenburg.wordpress.com/2011/02/06/more-subtitle-formats-for-popcorn/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 22:36:58 +0000</pubDate>
		<dc:creator>sweerdenburg</dc:creator>
				<category><![CDATA[js]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[popcorn]]></category>
		<category><![CDATA[seneca]]></category>

		<guid isPermaLink="false">http://sweerdenburg.wordpress.com/?p=369</guid>
		<description><![CDATA[What began as a custom subtitle command is growing into a larger amount of work on Popcorn.js. While initially work was being done to include TTXT subtitle support, support for many more standardized formats will soon be popping into Popcorn. This is inspired by the Universal Subtitles project, which supports a variety of formats. As [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=369&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What began as a custom subtitle command is growing into a larger amount of work on Popcorn.js. While initially work was being done to include <a href="http://sweerdenburg.wordpress.com/2011/01/26/popping-up-ttxt-support-for-popcorn-js/">TTXT subtitle support</a>, support for many more standardized formats will soon be popping into Popcorn. This is inspired by the <a href="http://universalsubtitles.org/en/">Universal Subtitles</a> project, which supports a variety of formats. As a combination of efforts between <a href="http://www.spectakular.com/open-source/subtitle-plugin-for-popcorn-js">Simon</a> and myself, we&#8217;re also working on creating parsers for:</p>
<ul>
<li><a href="http://www.matroska.org/technical/specs/subtitles/srt.html">SRT</a></li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/webvtt.html">WebSRT, now known as WebVTT</a></li>
<li><a href="http://www.matroska.org/technical/specs/subtitles/ssa.html">SSA</a></li>
<li><a href="http://www.matroska.org/technical/specs/subtitles/ssa.html">ASS</a></li>
<li><a href="http://www.google.com/support/youtube/bin/answer.py?hl=en&amp;answer=100077">SBV</a></li>
<li><a href="http://www.w3.org/TR/ttaf1-dfxp/">TTML</a></li>
</ul>
<p>One caveat in this wide support is that, like TTXT before them, the initial implementation will have much of the style information being ignored for now. This won&#8217;t affect SBV or standard-compliant SRT files, but the remaining will have their styling information stripped from them&#8230; for now. We hope to be supporting style information soon, however. In the mean time those formats that support HTML-compliant in-text styling information will work courtesy of the browser&#8217;s native display capabilities.</p>
<p>For example, since many media players have <a href="http://ale5000.altervista.org/subtitles.htm">expanded on</a> the basic SRT support to handle underlining with the &lt;u&gt;&lt;/u&gt; tags, existing SRT files with these tags will not break. However, SSA-style commands, which follow a syntax like this:</p>
<p>{\commandArg1} or {\command(Arg1,Arg2,&#8230;)}</p>
<p>are also found in SRT files. Even though styling these tags is not immediately supported, the commands still won&#8217;t show up as part of the subtitle text: they will be hidden from view. So if you have a subtitle file and want to use it, what do you do? Just include popcorn, the parser plugin and the subtitle plugin in the web page like so:</p>
<pre>&lt;head&gt;
   &lt;script src="../../popcorn.js"&gt;&lt;/script&gt;
   &lt;script src="../../plugins/subtitle/popcorn.subtitle.js"&gt;&lt;/script&gt;
   &lt;script src="popcorn.parserSRT.js"&gt;&lt;/script&gt;
&lt;/head&gt;</pre>
<p>These files will register all the appropriate code with popcorn, meaning all that&#8217;s left is to specify the subtitle file. This is done on the video element via the data-timeline-sources attribute:</p>
<pre>&lt;video id='video' controls data-timeline-sources="data/data.srt" &gt;
  &lt;source id='mp4' src="../../test/trailer.mp4" type='video/mp4; codecs="avc1, mp4a"'&gt;
  &lt;source id='ogv' src="../../test/trailer.ogv" type='video/ogg; codecs="theora, vorbis"'&gt;
&lt;/video&gt;</pre>
<p>And with that bit of work, Popcorn will do what it does best, which is to take care of the rest.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sweerdenburg.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sweerdenburg.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sweerdenburg.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sweerdenburg.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sweerdenburg.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sweerdenburg.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sweerdenburg.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sweerdenburg.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sweerdenburg.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sweerdenburg.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sweerdenburg.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sweerdenburg.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sweerdenburg.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sweerdenburg.wordpress.com/369/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=369&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sweerdenburg.wordpress.com/2011/02/06/more-subtitle-formats-for-popcorn/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8cff1e259837c8584346444f0a510fbc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sweerdenburg</media:title>
		</media:content>
	</item>
		<item>
		<title>Cluster size, Cache Lines and Why Old Video Games had 3-letter High Scores</title>
		<link>http://sweerdenburg.wordpress.com/2011/02/05/cluster-size-cache-lines-and-why-old-video-games-had-3-letter-high-scores/</link>
		<comments>http://sweerdenburg.wordpress.com/2011/02/05/cluster-size-cache-lines-and-why-old-video-games-had-3-letter-high-scores/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 22:13:51 +0000</pubDate>
		<dc:creator>sweerdenburg</dc:creator>
				<category><![CDATA[game programming]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[seneca]]></category>

		<guid isPermaLink="false">http://sweerdenburg.wordpress.com/?p=372</guid>
		<description><![CDATA[Like many other software developers, I&#8217;m constantly trying to deepen my understanding of things, to learn more and push myself further. As such, I took it upon myself recently to try and make a high score system for a 3D game I&#8217;d made last year. I wasn&#8217;t content with just a simple &#8220;cout &#62;&#62; score&#8221;, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=372&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Like many other software developers, I&#8217;m constantly trying to deepen my understanding of things, to learn more and push myself further. As such, I took it upon myself recently to try and make a high score system for a <a href="http://sweerdenburg.wordpress.com/2010/11/29/unravellingwin32-threads/">3D game</a> I&#8217;d made last year. I wasn&#8217;t content with just a simple &#8220;cout &gt;&gt; score&#8221;, however, I wanted to make this an academic exercise. I wanted the &#8220;perfect&#8221; high score system.</p>
<p>So I started researching. Given that this dealt with IO, I wanted to make sure I adhered to a few good practices, and to learn about others. For this, I had to consider the low-level implementation details. First consideration&#8230;</p>
<p><strong>Cluster Size</strong></p>
<p>Windows file systems (NTFS, FAT and exFAT) allocate space on the hard drive according to something called cluster size. File allocation on the hard drive must be a multiple of the cluster size. Files up to the cluster size (lets say 4 KB) will take up that much space on the disk. If the file contents amount to less (lets say a 2 KB text file), the rest of the drive space is padded. This is done for speed reasons. Files larger than the cluster size (6 KB) will have extra clusters allocated to allow for the entire file to be stored (8 KB on disk). The relationship can be generalized as:</p>
<p>disk space = round up ( file size / cluster size )</p>
<p>One downside of this is that every file which isn&#8217;t equal to exactly the cluster size has wasted space. Another is that since the OS reads in information in entire clusters, performance suffers if file size is less than the cluster size (only some of the data on the cluster is relevant). While the age of terabyte hard drives makes the first downside negligible, the second should still be a concern. However, given this being an academic exercise, I opted to make my high scores file be the cluster size.</p>
<p>So just how big might the cluster size be? Optimal cluster size varies by file system, operating system and hard drive size, but by and large a reliable figure is 4KB. According to <a href="http://support.microsoft.com/kb/140365">Microsoft</a> this is the default on NTFS for any Windows NT 4.0 machine, or anything newer than Windows 2000 with a hard drive size under 16 TB. Given that the game will require DirectX 9 and will likely run on a home computer, the Windows 4-6 family is almost certainly to be the host OS, and NTFS is a near-guarantee for the file system. So until 16 TB hard drives are common, I should be safe with a 4KB file size <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Cache Line Size</strong></p>
<p>Here&#8217;s where I had to begin to take a lot of consideration and care. With varying types of memory in computers (registers, L1 Cache, L2 Cache etc) I wanted to try and make my data structures as accommodating as possible. For this, I wanted to be sure they would fit on the L1 Cache as cleanly as possible. This way, more data could be kept there for quick transfer to the CPU rather than having to retrieve values from secondary memory like RAM. Turns out, both <a href="http://developer.amd.com/documentation/articles/pages/implementingamdcache-optimalcodingtechniques.aspx">AMD</a> and <a href="http://developer.intel.com/design/pentiumII/manuals/244001.htm">Intel</a> recommend that for this, structure size should be an integral multiple of the cache line size, and aligned on that byte boundary. In other words, an L1 Cache with a cache line size of 64 works best on a 64 (or 128) byte structure stored in memory at an address divisible by 64.</p>
<p>Turns out, nearly all modern processors are 64-bit and work off a 64 byte L1 Cache. It&#8217;s not a guarantee to say than an n-bit processor will have a n-byte L1 Cache line size, but based on my research in the Pentium family, it&#8217;s a fair assumption. So I started trying to juggle how to work with these 64 bytes. I didn&#8217;t see score going above 4 billion, so 4 bytes seemed sufficient for this. I wanted to store a date as well, which at an 8 byte value seemed enough. With 12 bytes down and 52 to go, it seemed 64 was a bit much. Aiming for 32, I then gave an extra 4 bytes for a bit field. 16 bytes down, 16 to go. And I needed a name. 16 bytes makes for an array of 8 wchar_t variables, which meant a name of 7 letters could be supported (plus 1 null byte on the end). Why wchar_t? I wanted to go beyond the 1-byte &#8220;char&#8221; to not limit myself to ASCII characters.</p>
<pre>#define CACHE_LINE_SIZE 32
#define NAME_SIZE (CACHE_LINE_SIZE - sizeof(int)*2 - sizeof(long))/2
typedef struct score_t {               // Engineered to be CACHE_LINE_SIZE bytes in size
 int score;                            // Most commonly used member first, used in ordering (4 bytes)
 int flags;                            // Score flags (4 bytes), helps natural alignment of next item (the date)
 long date;                            // Time stamp (8 bytes)
 wchar_t name[NAME_SIZE];              // Player's name, takes up remainder. Place last to ease natural alignment
};</pre>
<p>With this structure, I was able to fit 2 scores in one cache line. Upon seeing if I could fit 4, I realized something. At a 16 byte struct size, I would&#8217;ve stripped out the bit field, which if you do the math would allow for <strong>3 letters</strong> to be specified as the earner of the high score. That sounded familiar&#8230;</p>
<div class="wp-caption aligncenter" style="width: 234px"><img title="Pac-Man Hi Score" src="http://www.twobits.com/images/sabc/hiscore.gif" alt="Pac-Man Hi Score" width="224" height="288" /><p class="wp-caption-text">Pac-Man Hi Score</p></div>
<p>Notice how there&#8217;s only three letters in the name field? A lot of old 8-bit games only allowed for 3 letters&#8230; Pac-man (above), <a href="http://www.gamesdbase.com/Media/SYSTEM/Arcade/Score/big/Galaga_%2788_-_1987_-_Namco_Limited.jpg">Galaga</a>, <a href="http://gamesdbase.com/Media/SYSTEM/Arcade/Score/big/Contra_-_1987_-_Konami.jpg">Contra</a>, and <a href="http://www.arcadeshop.com/mario-kit/high-scores.gif">Mario</a> among them. Given the knowledge that they ran on an 8-bit processor and the assumption that an 8-byte cache line size was involved, along with an assumption that the character set was likely limited to ASCII characters, you have the following variation on the above:</p>
<pre>#define CACHE_LINE_SIZE 8
#define NAME_SIZE (CACHE_LINE_SIZE - sizeof(int))
typedef struct score_t {               // Engineered to be CACHE_LINE_SIZE bytes in size
 int score;                            // Most commonly used member first, used in ordering (4 bytes)
 char name[NAME_SIZE];                 // Player's name, takes up remainder. Place last to ease natural alignment
};</pre>
<p>Do the math and it works out that there is just enough room for 3 letters to be given. Sure, the size of an int wouldn&#8217;t've been 4 bytes on that processor, but I&#8217;m going to guess that based on the <a href="http://www.wired.com/science/discoveries/news/2008/07/dayintech_0703">perfect Pac-man high score</a> being realized at 3,333,360 that 4 bytes were allocated for the score field all the same. Maybe first, middle and last initials weren&#8217;t the real reason for having a 3-letter high score entry.</p>
<p>At the end of it all, I used the first code snippet in my game: 4,096 bytes of high scores at 32 bytes/score makes for a hefty 128 high scores. However the real joy I took out of this wasn&#8217;t the code but gaining new insight into some of my first games, with a  like-mindedness of trying to eke out every cycle possible. Code on.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sweerdenburg.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sweerdenburg.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sweerdenburg.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sweerdenburg.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sweerdenburg.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sweerdenburg.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sweerdenburg.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sweerdenburg.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sweerdenburg.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sweerdenburg.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sweerdenburg.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sweerdenburg.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sweerdenburg.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sweerdenburg.wordpress.com/372/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=372&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sweerdenburg.wordpress.com/2011/02/05/cluster-size-cache-lines-and-why-old-video-games-had-3-letter-high-scores/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8cff1e259837c8584346444f0a510fbc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sweerdenburg</media:title>
		</media:content>

		<media:content url="http://www.twobits.com/images/sabc/hiscore.gif" medium="image">
			<media:title type="html">Pac-Man Hi Score</media:title>
		</media:content>
	</item>
		<item>
		<title>Popping up TTXT Support for Popcorn.js</title>
		<link>http://sweerdenburg.wordpress.com/2011/01/26/popping-up-ttxt-support-for-popcorn-js/</link>
		<comments>http://sweerdenburg.wordpress.com/2011/01/26/popping-up-ttxt-support-for-popcorn-js/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 03:07:12 +0000</pubDate>
		<dc:creator>sweerdenburg</dc:creator>
				<category><![CDATA[js]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[popcorn]]></category>
		<category><![CDATA[seneca]]></category>

		<guid isPermaLink="false">http://sweerdenburg.wordpress.com/?p=361</guid>
		<description><![CDATA[In a past blog, I discussed some work I&#8217;ve had with the GPAC&#8217;s TTXT subtitle standard. I&#8217;ve begun working on Popcorn.js and after not  too much work, Popcorn is beginning to gain TTXT support. While this would&#8217;ve been much more work before the 0.2 re-engineering, plugins are now supported and it&#8217;s as simple as registering [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=361&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://sweerdenburg.wordpress.com/2010/11/10/ttxt-subtitling-for-bbb-video-player/">past blog</a>, I discussed some work I&#8217;ve had with the GPAC&#8217;s <a href="http://sourceforge.net/apps/wordpress/gpac/mp4box/ttxt-format-documentation/">TTXT</a> subtitle standard. I&#8217;ve begun working on <a href="http://popcornjs.org/">Popcorn.js</a> and after not  too much work, Popcorn is beginning to gain TTXT support. While this would&#8217;ve been much more work before the 0.2 re-engineering, plugins are now supported and it&#8217;s as simple as registering a parser function for a specific file extension.</p>
<p>What does this mean?</p>
<p><strong>For developers</strong>, it&#8217;s easy to add onto popcorn. Their page covers just about everything you could need to know, and once you learn the intuitive API it&#8217;s all systems go. For this initial TTXT support it was as simple as using the existing subtitle plugin and writing a custom parser to convert a TTXT file into subtitle objects. Probably about 40 executable lines of code needed in all.</p>
<p><strong>For Popcorn.js users</strong>, I can see this being quite advantageous as well. With the ease of adding functionality, new features are able to be developed quickly and with minimal impact on what&#8217;s already in use by Popcorn.js. This means the web pages using Popcorn can only get more dynamic as time goes on.</p>
<p><strong>Back to TTXT</strong>: It is a robust standard. I&#8217;ve studied the spec and am beginning to learn it all, but thus far only the text information from a file is processed; not the styling information One of the benefits of TTXT is it&#8217;s rich support for styles down to a per-subtitle, per-character level. This means one subtitle can be half 12pt Arial font, half 36pt Courier. Another subtitle could be all Verdana and in red, except for a desired letter to be blue. This styling information is what I&#8217;m least familiar with about the standard.</p>
<p>My friend <a href="http://annasob.wordpress.com/">Anna</a> has already put the call out if anyone has some more complicated TTXT files to contribute to be studied and run by our parser. I&#8217;d like to re-issue the call here, and would be interested in hearing from any developers or film makers who have more familiarity with this standard.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sweerdenburg.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sweerdenburg.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sweerdenburg.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sweerdenburg.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sweerdenburg.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sweerdenburg.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sweerdenburg.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sweerdenburg.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sweerdenburg.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sweerdenburg.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sweerdenburg.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sweerdenburg.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sweerdenburg.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sweerdenburg.wordpress.com/361/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=361&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sweerdenburg.wordpress.com/2011/01/26/popping-up-ttxt-support-for-popcorn-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8cff1e259837c8584346444f0a510fbc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sweerdenburg</media:title>
		</media:content>
	</item>
		<item>
		<title>Visualization and Emulation of the 6502 Processor in HTML 5</title>
		<link>http://sweerdenburg.wordpress.com/2011/01/18/visualization-and-emulation-of-the-6502-processor-in-html-5/</link>
		<comments>http://sweerdenburg.wordpress.com/2011/01/18/visualization-and-emulation-of-the-6502-processor-in-html-5/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 00:58:09 +0000</pubDate>
		<dc:creator>sweerdenburg</dc:creator>
				<category><![CDATA[js]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[seneca]]></category>

		<guid isPermaLink="false">http://sweerdenburg.wordpress.com/?p=356</guid>
		<description><![CDATA[As a student and as a software developer, I&#8217;m constantly trying to learn more, dig deeper and further educate myself on anything related to my field. What has my attention right now is lower-level software development and optimization targeted for specific hardware. There are a great many papers out there written on the subject, specifically [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=356&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As a student and as a software developer, I&#8217;m constantly trying to learn more, dig deeper and further educate myself on anything related to my field. What has my attention right now is lower-level software development and optimization targeted for specific hardware. There are a great many papers out there written on the subject, specifically optimization practices on Intel hardware and the importance of keeping cache size and cache line size in mind. What really caught my eye in this research, was a mixture of the old and the new.</p>
<p>In 1970s, there was a 8-bit CPU war going on between (amongst others) Intel and Motorola. Motorola&#8217;s team in charge of development of a new chip were soon moved to the small-time MOS company. To make a long story short, the team ended up producing the <a href="http://en.wikipedia.org/wiki/MOS_Technology_6502">6502</a>, a competing 8-bit processor at 1/6 the cost of Intel&#8217;s and Motorola&#8217;s leading designs, sparking &#8220;a series of computer projects that would eventually result in the home computer revolution of the 1980s&#8221;. How influential was the 6502? For starters, it came bundled with the wildly popular Commodore, Apple and Atari home computers of the time, with variants of the 6502 also gracing Nintendo&#8217;s NES and Atari&#8217;s 2600 video game systems.</p>
<p>Moving forward in history, we now have cutting edge HTML 5 running on web browsers on computers with 1,000,000 times the memory that the Atari 2600 could support (8 KB could still do amazing things). And now, the group from Visual6502.org has made a great <a href="http://visual6502.org/JSSim/index.html">visualization </a>of the processor in action using HTML 5&#8242;s canvas. The demo comes with a custom program which can be executed step-by-step with each instruction lighting up different transistors on the processor.</p>
<p>The best part? There&#8217;s a <a href="https://github.com/trebonian/visual6502">github repo</a>: it&#8217;s open source.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sweerdenburg.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sweerdenburg.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sweerdenburg.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sweerdenburg.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sweerdenburg.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sweerdenburg.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sweerdenburg.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sweerdenburg.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sweerdenburg.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sweerdenburg.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sweerdenburg.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sweerdenburg.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sweerdenburg.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sweerdenburg.wordpress.com/356/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=356&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sweerdenburg.wordpress.com/2011/01/18/visualization-and-emulation-of-the-6502-processor-in-html-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8cff1e259837c8584346444f0a510fbc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sweerdenburg</media:title>
		</media:content>
	</item>
		<item>
		<title>Managing js dependencies and the importance of global-scoped libraries</title>
		<link>http://sweerdenburg.wordpress.com/2010/12/15/managing-js-dependancies/</link>
		<comments>http://sweerdenburg.wordpress.com/2010/12/15/managing-js-dependancies/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 01:16:04 +0000</pubDate>
		<dc:creator>sweerdenburg</dc:creator>
				<category><![CDATA[bbb]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[seneca]]></category>

		<guid isPermaLink="false">http://sweerdenburg.wordpress.com/?p=334</guid>
		<description><![CDATA[In performing some cleanup, abstraction and upkeep on the 0.3 release of the BBB player (soon to be 0.3.1), I&#8217;ve been working on expanding the testing functionality. In doing so, I&#8217;m pushing the test code from the testing page (test.html) into its own external JavaScript file (test.js). Trouble is, I want to keep this code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=334&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In performing some cleanup, abstraction and upkeep on the 0.3 release of the BBB player (soon to be 0.3.1), I&#8217;ve been working on expanding the testing functionality. In doing so, I&#8217;m pushing the test code from the testing page (test.html) into its own external JavaScript file (test.js). Trouble is, I want to keep this code separate from the main BBB.js library, but I need to address the fact that test.js is dependent on BBB.js. It&#8217;s possible to put them all in the same file, but that&#8217;s a lot of overhead for the 99% of the time that the testing framework isn&#8217;t required. So we can put them in different files and trust that on every HTML page that test.js is loaded, BBB.js is loaded before it. <span style="color:#ff0000;">This is bad and error-prone!</span></p>
<p>What to do?</p>
<p>Turns out, we can load BBB.js dynamically as needed from other js files. As many js developers know, you can check if a variable has been used by doing this:</p>
<pre>typeof(bbb) === 'undefined'</pre>
<p>This statement will return true if bbb has not been declared or assigned to. So with this, we&#8217;re already part-way there: we know if our library (bbb) was not included on our test page. So from here, we just need to load it. Guess we&#8217;ll have to make another XMLHttpRequest to get it!</p>
<pre>if (typeof(bbb) === 'undefined') { // No record of global BBB, must've been forgotten on test page
  var xhr = new XMLHttpRequest();

  xhr.onreadystatechange = function() {
    if (xhr.readyState===4) {
      // Execute BBB.js and populate in bbb variable
    }
  }
  xhr.open("GET", '../BBB.js', false); // Not async, test code below depends on having global bbb object
  xhr.send(null);
}</pre>
<p>So now we have a way of getting BBB.js if the HTML page doesn&#8217;t do it. However, BBB.js comes back as text. if put at the top of a file, the code above will simply retrieve BBB.js from the server and have it sit there. So we&#8217;ll have to execute the text as JavaScript. And for that&#8230; we use EVAL.</p>
<p>Long-touted as <a href="http://24ways.org/2005/dont-be-eval">lazy, dangerous and inefficient</a>, eval is great for executing text as JavaScript code. It&#8217;s often misused aand security and performance almost always take a hit. If you tell someone you&#8217;re using eval in your library, the natural reaction to expect is &#8220;REALLY?&#8221;. This, of course, after the typical recoil in horror. Turns out, resolving dependencies is one of the few things it&#8217;s good for. When added to the code above, it will execute the requested js file and (in the case of a library like BBB) will have a variable stocked full with your code and ready to use. Package the whole thing into a function and you have something like this:</p>
<pre>function requireBBB(fileRef) {
  if (typeof(bbb) === 'undefined') { // No record of global BBB, must've been forgotten on test page
    var xhr = new XMLHttpRequest();

    xhr.onreadystatechange = function() {
      if (xhr.readyState===4) {
        eval(xhr.responseText); // Execute BBB.js
      }
    }
    xhr.open("GET", fileRef, false); // Not async, test code below depends on having global bbb object
    xhr.send(null);
  }
}

requireBBB('../BBB.js');</pre>
<p>And this works. Or at least it should. It didn&#8217;t for me. Convinced that it was something wrong with this function, I plugged alerts on every other line of code. I used Firebug. I used everything at my disposal to figure it out. Finally, after far too long, I got a hunch. I pulled up the BBB.js file and found the first line to be this:</p>
<pre>var bbb = (function(){</pre>
<p>Seems  innocent. Run a self-executing anonymous function and store the result in locally-scoped variable bbb. Wait, what? We&#8217;d never run BBB.js outside of global page scope, so local scope was always window and it had always worked. However, eval&#8217;ing the library code from the xhr.onreadystate function, bbb isn&#8217;t put on the global window because that&#8217;s not the context the code is executing in. Instead, bbb became a member of xhr. The function then finished and bbb blipped out of existence as quick as it blipped in. A change in BBB.js to this:</p>
<pre>bbb = (function(){</pre>
<p>And everything works. The variable is declared as implicitly global and can be accessed elsewhere. The moral of the story: always store your library at global scope if you want to manage dependencies or otherwise avoid scope-related issues.</p>
<p><span style="color:#ff0000;">There is a downside to dynamic loading</span>: performance. Every XmlHttpRequest means a hit on performance; ideally you want to put all js code in it&#8217;s own file, and the same for CSS. In fact, using this on-demand js-loading breaks #1 on Yahoo&#8217;s list of &#8220;<a href="http://developer.yahoo.com/performance/rules.html">Best Practices for Speeding Up You&#8217;re Website</a>&#8220;. However, since users won&#8217;t really be needing the testing framework (and it will just be extra JS for the browser to work with if included in BBB.js) this should be okay. While I have yet to try it, I hope to do a bevy of performance testing using (amongst other tools) the <a href="http://developer.yahoo.com/yslow/">Firefox extension YSlow</a> before formally pushing out 0.3.1. Even without formal profiling, we&#8217;ve already caught a few other minor improvements to performance!</p>
<p>Stay tuned for 0.3.1&#8230;</p>
<p>&nbsp;</p>
<p>UPDATE (Jan 20, 2011): After working on <a href="http://popcornjs.org/">popcorn</a> and learning a few things, there is a much better way than the use of eval. Seems <a href="http://insideria.com/2009/03/what-in-the-heck-is-jsonp-and.html">JSONP</a> makes use of dynamic script tags as a way of issues cross-origin requests. This works equally well to dynamically load libraries (like jQuery) and looks much cleaner than XHR:</p>
<pre>var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.src = "http://code.jquery.com/jquery-latest.min.js";
script.type = "text/javascript";
head.insertBefore( script, head.firstChild );</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sweerdenburg.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sweerdenburg.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sweerdenburg.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sweerdenburg.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sweerdenburg.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sweerdenburg.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sweerdenburg.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sweerdenburg.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sweerdenburg.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sweerdenburg.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sweerdenburg.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sweerdenburg.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sweerdenburg.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sweerdenburg.wordpress.com/334/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=334&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sweerdenburg.wordpress.com/2010/12/15/managing-js-dependancies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8cff1e259837c8584346444f0a510fbc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sweerdenburg</media:title>
		</media:content>
	</item>
		<item>
		<title>BBB Player 0.3</title>
		<link>http://sweerdenburg.wordpress.com/2010/12/08/bbb-player-0-3/</link>
		<comments>http://sweerdenburg.wordpress.com/2010/12/08/bbb-player-0-3/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 03:04:25 +0000</pubDate>
		<dc:creator>sweerdenburg</dc:creator>
				<category><![CDATA[bbb]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[seneca]]></category>

		<guid isPermaLink="false">http://sweerdenburg.wordpress.com/?p=326</guid>
		<description><![CDATA[With December upon us, it&#8217;s time for the third iteration over the BBB Player. And this one shan&#8217;t disappoint. My partner&#8217;s release notes forthcoming, I&#8217;ll be focused on discussing my own tasks. If you&#8217;ll recall, the original list of items tasked to me looked like this: Hooking up dummy server calls on chapter addition/deletion Toggle [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=326&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With December upon us, it&#8217;s time for the third iteration over the BBB Player. And this one shan&#8217;t disappoint. My <a href="http://klasconia.wordpress.com/">partner&#8217;s</a> release notes forthcoming, I&#8217;ll be focused on discussing my own tasks. If you&#8217;ll recall, the original list of items tasked to me looked like this:</p>
<ul>
<li>Hooking up dummy server calls on chapter addition/deletion</li>
<li>Toggle subtitles on/off</li>
<li>Refactor Bookmark object to optimize for memory consumption</li>
<li>Time In/Out Buttons for setting chapters rather than manual typing</li>
<li>Popcorn-formatted metadata generation (will be sent to same dummy server)</li>
</ul>
<p>With the first three being completed by my <a href="http://sweerdenburg.wordpress.com/2010/11/28/bbb-subtitle-fixes-onoff-and-remoting/">last BBB-related update</a>. Since then, the list grew to a few more to include:</p>
<ul>
<li>Refactor: Automate library loading via DOMContentLoaded event</li>
<li>Refactor: Create &#8220;storage&#8221; module from existing functions</li>
</ul>
<p>With these 7 tasks (plus minor fixes here and there) the code base underwent quit a few changes, however the core API remained unbroken with existing code. For example, while the library can hook into the DOMContentLoaded event to load automatically, one can still manually call the init() function from the onload event of the body to load all internal values. See both options below:</p>
<pre>bbb.setupWhenReady({playerId: "player", tocId: "tblOfContents", chapterStorage: "server.php", formDivId: "formDiv", statistics: true, watermark: true});

// OR
&lt;body onload="bbb.init({playerId: 'player', tocId: 'tblOfContents', chapterStorage: 'server.php', statistics: true, watermark: true});"&gt;</pre>
<p>Internally, setupWhenReady() calls the init() function with the passed parameters, but the function may be called anywhere within the HTML document. Also, setupWhenReady() will call the bbb.onReady() function when finished. Override this method to execute page-specific logic once the library has loaded. Another callback function, bbb.onChangeVideo(currChap), is called when changing chapters. Taking one argument (the new chapter), it can be used to update parts of the page with internal information about the playing video. If overriding, expect to receive a Bookmark object. <a href="http://matrix.senecac.on.ca/~sweerdenburg/Projects/DPS909/BBB/0.3/BBB/Demos/demo.html">See it all in use</a> when it&#8217;s used to autopopulate the chapter creation form.</p>
<p>Another great usability feature now implemented is optional subtitles. I discussed this at length in my last BBB blog post, but the <a href="http://videojs.com/">VideoJS library</a> we&#8217;re using (at least version 1.4) would not allow for subtitles to be optional. If a file is specified, they would play. After a bit of work on Video.js however, they&#8217;re <a href="http://matrix.senecac.on.ca/~sweerdenburg/Projects/DPS909/BBB/0.3/BBB/Demos/demoCCToggle.html">now togglable</a>. As part of implementing this, a bug was also found and fixed where subtitles will now display properly when scrolling backwards through the video. Both of these fixes have since also been forwarded to the VideoJS team.</p>
<p>The big thing about this release for me, however, is the creation of popcorn metadata (in the bbb.generator module). Presently supporting 7 command types (Wikipedia, Flickr, Google News, LastFM, Twitter, Video Tag, and Footnote), the library internally handles all form generation and functionality, however placement can be determined by supplying the library with the id of a div on the page in which to place the form. Also, using this div ID and CSS Selectors, it&#8217;s easy to style the generated form at the page level. Unfortunately, hosting limitations to the tune of no file IO in JavaScript, no PUT requests to servers, and no file writing means it&#8217;s undemoable on its current host, but feel free to <a href="http://matrix.senecac.on.ca/~sweerdenburg/Projects/DPS909/BBB/0.3/BBB/Demos/demoMetadataGen.html">check it out</a> all the same!</p>
<p>And so that being that, my portion of the 0.3 release of the BBB player is complete. Minor fixes or structural changes for this release include:</p>
<ul>
<li>Moving free-floating page-level setCookie, getCookie functions into bbb.storage module</li>
<li>Beginning of a bbb.chapters module for storing and working with chapters (though functions from 0.2 remain outside at this time to maintain a consistent API)</li>
<li>Error checking, validation and output formatting for chapter and popcorn metadata creation.</li>
</ul>
<p>See the code base on my <a href="https://github.com/stevenaw/bbb">github</a>, especially the <a href="https://github.com/stevenaw/BBB/tree/0.3">0.3 branch</a>. While this work was all done through a class with Dave, I don&#8217;t want to be done quite yet! Hopefully there&#8217;s much more work, development and contribution opportunities ahead. Luckily, with open source, that&#8217;s always the case <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sweerdenburg.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sweerdenburg.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sweerdenburg.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sweerdenburg.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sweerdenburg.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sweerdenburg.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sweerdenburg.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sweerdenburg.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sweerdenburg.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sweerdenburg.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sweerdenburg.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sweerdenburg.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sweerdenburg.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sweerdenburg.wordpress.com/326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sweerdenburg.wordpress.com&#038;blog=15762361&#038;post=326&#038;subd=sweerdenburg&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sweerdenburg.wordpress.com/2010/12/08/bbb-player-0-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8cff1e259837c8584346444f0a510fbc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sweerdenburg</media:title>
		</media:content>
	</item>
	</channel>
</rss>
