<?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>David Seifried &#187; school</title>
	<atom:link href="http://dseifried.wordpress.com/category/school/feed/" rel="self" type="application/rss+xml" />
	<link>http://dseifried.wordpress.com</link>
	<description>Open Source and some more</description>
	<lastBuildDate>Tue, 22 May 2012 16:16:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dseifried.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>David Seifried &#187; school</title>
		<link>http://dseifried.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dseifried.wordpress.com/osd.xml" title="David Seifried" />
	<atom:link rel='hub' href='http://dseifried.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Beautifying using JSON.stringify and useCapture</title>
		<link>http://dseifried.wordpress.com/2012/05/18/beautifying-using-json-stringify-and-usecapture/</link>
		<comments>http://dseifried.wordpress.com/2012/05/18/beautifying-using-json-stringify-and-usecapture/#comments</comments>
		<pubDate>Fri, 18 May 2012 21:07:07 +0000</pubDate>
		<dc:creator>dseifried</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[popcorn maker]]></category>
		<category><![CDATA[popcorn.js]]></category>
		<category><![CDATA[school]]></category>

		<guid isPermaLink="false">http://dseifried.wordpress.com/?p=380</guid>
		<description><![CDATA[This week I&#8217;ve been getting back into the swing of things at work after having a week off due to an injury.  Once I got back I began working on two small bugs in Popcorn Maker, bug #519 and bug #619.  Both of these bugs involved 1 or 2 line fixes, but were quite interesting in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=380&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This week I&#8217;ve been getting back into the swing of things at work after having a week off due to an injury.  Once I got back I began working on two small bugs in Popcorn Maker, <a href="https://webmademovies.lighthouseapp.com/projects/65733/tickets/519-resizing-a-track-event-does-not-select-it">bug #519</a> and <a href="https://webmademovies.lighthouseapp.com/projects/65733/tickets/619-fix-spacing-in-html-export">bug #619</a>.  Both of these bugs involved 1 or 2 line fixes, but were quite interesting in the fact that I learned a lot about two JavaScript methods that I use almost regularly, JSON.stringify and addEventListener.</p>
<p>Bug #519 was about making sure that trackevent handles ( used to resize a trackevent ) made the trackevent gain focus. Currently, clicking on a trackevent would give it focus, but clicking on the handles ( which are a child element of the trackevent ) would not.  After digging into the code a bit nothing jumped out a me that was glaringly wrong, so I figured it was an event bubbling issue.  I remember that the third arguement of addEventListener ( the one everyone forgets about ) had something to do with event bubbling so I went and <a href="https://developer.mozilla.org/en/DOM/element.addEventListener">looked it up on MDN</a>.  The third arguement, also called userCapture, basically specifies if you want events to bubble as they normally do, from a child element up to it&#8217;s parent ( which means it would have a value of false, which I&#8217;m sure everyone is used to seeing ) or create what is called an event reflow ( I think ) and change the way an event gets triggered. By setting userCapture to true I noticed that events now fire from the parent element first and then to each of it&#8217;s children ( pending they have an event listener for the given event ).  This seemed to do the trick and the trackevent handles were now recognizing a click event and everything was being handled as it should.  The fix that I just explained worked because the event must have been getting captured and thrown away somewhere before it bubbled up to the parent element.  Doing what I did allows us to make sure that the event gives priority to it&#8217;s parent first ensuring that it get&#8217;s fired there and then fires the event on each of it&#8217;s children.  It was pretty cool playing around with how userCapture works and the difference it makes on events that get fired.  I don&#8217;t see setting userCapture to true to be something I will use very often, as an event that bubbles from a child up is typically what you want, but knowing how to change the flow and use it accordingly is definitely a powerful tool to remember we have in our arsenal as coders.</p>
<p>The other neat thing I learned this week was that I could use JSON.stringify to beautify JSON. Up until now I have only ever used JSON.stringify to do convert a JavaScript object into a string and never even bothered looking up what other arguements it took.  For bug #619 I wrote a recursive JSON beautifying function to do what I needed and put it up for review.  Bobby Ricther then asked me why I didn&#8217;t use something that was built in to do this already, like JSON.stringify.  I had no idea what he was talking about so I looked it up and was pretty amazed at <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/JSON/stringify">what I found out</a>.  I learned that JSON.stringify actually takes 3 arguements, the first being the source object, the second is a replacer function which lets you customize how you handle various data types, and the third being a spacer which lets you specify how the JSON is printed out. My fix went from a 25 line function to a 1  line fix once I found this out, which looked like the following:</p>
<p>var beautifiedObject = JSON.stringify( obj, null, 2 );</p>
<p>And that was it, I have beautified JavaScript in 24 less lines of code.  This is one of those things that you have to do the hard before you can learn the easy way and how awesome it is. Unless someone told me, I probably would have went on writing my own JSON beautifier functions until the end of time, so thanks for sharing that knowledge Bobby!</p>
<p>This week in general has been great for getting back into the swing of things again and refreshing myself with Popcorn Maker again, it&#8217;s crazy how fast the project is moving now a days. You don&#8217;t realize the crazy amount of bug mail you get until you take a week off and let it pile up.  Also with a project moving as fast as Popcorn Maker it&#8217;s also hard to stay up to date after taking that much time off, the code is changing so much everyday it&#8217;s crazy.  I&#8217;m looking forward to next week and getting ready to release 0.5 of Popcorn Maker!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dseifried.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dseifried.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dseifried.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dseifried.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dseifried.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dseifried.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dseifried.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dseifried.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dseifried.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dseifried.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dseifried.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dseifried.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dseifried.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dseifried.wordpress.com/380/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=380&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dseifried.wordpress.com/2012/05/18/beautifying-using-json-stringify-and-usecapture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c071ab21e5f797c63058fdf862a5f0f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dseifried</media:title>
		</media:content>
	</item>
		<item>
		<title>Teaching is hard</title>
		<link>http://dseifried.wordpress.com/2012/05/04/teaching-is-hard/</link>
		<comments>http://dseifried.wordpress.com/2012/05/04/teaching-is-hard/#comments</comments>
		<pubDate>Fri, 04 May 2012 22:15:50 +0000</pubDate>
		<dc:creator>dseifried</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cdot]]></category>

		<guid isPermaLink="false">http://dseifried.wordpress.com/?p=376</guid>
		<description><![CDATA[This week was the start of a new summer semester at CDOT ( Centre for Development of Open Technology ) and each of the various projects had new hires. Robert Stanica, a fifth semester student in the BSD program at Seneca joined our team and will be primiarily focusing on getting Butter to work on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=376&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This week was the start of a new summer semester at <a href="http://zenit.senecac.on.ca/wiki/index.php/Main_Page">CDOT</a> ( Centre for Development of Open Technology ) and each of the various projects had new hires. <a href="http://twitter.com/#!/tr0p">Robert Stanica</a>, a fifth semester student in the <a href="https://scs.senecac.on.ca/BSD">BSD</a> program at Seneca joined our team and will be primiarily focusing on getting <a href="https://github.com/mozilla/butter">Butter</a> to work on mobile devices. This means phones and tablets running various OS&#8217;, such as Android, iOS, and even Mozilla&#8217;s new <a href="http://www.mozilla.org/en-US/b2g/">Boot to Gecko</a>. Having someone focused on mobile development will be great as we&#8217;ve definitely been lacking on mobile front. Robert, however, is pretty new to JavaScript so he&#8217;s been spending the past few days reading and researching how it works. He&#8217;s been going through <a href="http://shop.oreilly.com/product/9780596517748.do">&#8220;JavaScript: The good parts&#8221;</a> by <a href="http://www.crockford.com/">Douglas Crockford</a> as well as doing <a href="http://www.codecademy.com/">Code Academy</a>. Even tho these are great resources for learning JavaScript, Robert inevitably still had questions so I&#8217;ve been doing my best to answer them.</p>
<p>Now I&#8217;m no teacher, not by a long shot. I tend to stumble over my words when trying to explain things, it ends up coming out as a jumbled mess that I have to piece together again after. Despite this I&#8217;ve been doing my best to explain concepts to Rob such as the difference between == and ===, how scoping works in JavaScript, objects, and closures. One thing that I&#8217;ve noticed doing this over the past few day&#8217;s is how hard it can be to concisely explain something and it has really got me thinking how under appreciated a good teacher can be. One of my bigger pitfalls when explaining concepts, as I explained before, is how I tend to stumble through an explanation. I jump back and forth between points making it difficult to understand what I&#8217;m trying to say. This is also evident in the way I give presentations. I tend to add lib a bit and whenever I do I tend to ramble on. I&#8217;m trying to make a conscious effort to slow down when explaining things and take a brief pause if needed to collect my thoughts. It&#8217;s difficult to do ( for me at least ) because I always attribute pauses of any sort to someone not knowing the content, when in reality I probably look worse trying to rush.</p>
<p>I think the funniest moment over the past few days has been when Rob wanted me to explain something from the book he was reading. There was an example about closures that had the following piece of code ( might not be exact but close enough ):</p>
<p><code>var i = 20;</code></p>
<p>console.log( i.toString( 16 ) );</p>
<p>At first Rob asked me what the arguments were that toString took. Without even thinking I&#8217;m pretty sure I blurted out <em>&#8220;none&#8221;</em> and didn&#8217;t think anything of it. &#8220;<em>But it&#8217;s in the book, look&#8221;</em>, I didn&#8217;t believe him at first, so I had to see for myself. I ended up looking at it dumbfounded for a while trying to figure out what was going on. My response was &#8220;<em>Well, let&#8217;s see what it does&#8221;</em> which I don&#8217;t know if I looked dumb for not knowing that toString took an aruguement or not, but regardless this was an opportunity for both of us to learn something together. I busted open my console and began playing with it and we soon realized that if a number was passed into toString it would convert the value to a base-X value. This meant passing in 16 for our value of 20 returned 14, and passing in 2 gave us 10100. It just goes to show that there is always an opportunity to learn something new and I think teaching is a perfect example of this.</p>
<p>Being forced to explain your ideas in more depth than normal can be really difficult and truly is an art. I did my best over the past week to help Rob and I hope some of what I was saying was useful. Teaching someone is really hard and we should appreciate the teachers that we&#8217;ve had that we&#8217;re good at explaining concepts and helping us ( everything always seems easy until you try and do it ). This was a great experience for me and I learned a lot about how do communicate more effectively and realized I&#8217;ve got some brushing up to do myself. Even tho I use most of these concepts daily, it was hard for me to explain things at times and teaching really forces you to know your content inside and out, as you will always get questions that you weren&#8217;t expecting. Being able to teach is an art that we all tend to take for granted and until you try and do it, never fully appreciate how hard, draining, and complicated it can be.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dseifried.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dseifried.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dseifried.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dseifried.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dseifried.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dseifried.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dseifried.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dseifried.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dseifried.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dseifried.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dseifried.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dseifried.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dseifried.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dseifried.wordpress.com/376/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=376&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dseifried.wordpress.com/2012/05/04/teaching-is-hard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c071ab21e5f797c63058fdf862a5f0f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dseifried</media:title>
		</media:content>
	</item>
		<item>
		<title>Hot Hacks!</title>
		<link>http://dseifried.wordpress.com/2012/05/02/hot-hacks/</link>
		<comments>http://dseifried.wordpress.com/2012/05/02/hot-hacks/#comments</comments>
		<pubDate>Wed, 02 May 2012 04:28:24 +0000</pubDate>
		<dc:creator>dseifried</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[popcorn.js]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[Hot Docs]]></category>
		<category><![CDATA[Hot Hacks]]></category>
		<category><![CDATA[Living Docs]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[The Message]]></category>

		<guid isPermaLink="false">http://dseifried.wordpress.com/?p=374</guid>
		<description><![CDATA[Over the past weekend the CDOT crew and I were invited to participate in Hot Hacks, which is a two day long hack-a-thon centered around creating a web native portion to existing documentaries.  This meant the Popcorn team would be paired up with the various documentarians and we would help them create a working demo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=374&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Over the past weekend the CDOT crew and I were invited to participate in <a href="http://livingdocs.org/hothacks/">Hot Hacks</a>, which is a two day long hack-a-thon centered around creating a web native portion to existing documentaries.  This meant the Popcorn team would be paired up with the various documentarians and we would help them create a working demo over the two days that could later be iterated on.  The 6 documentaries were as follows:</p>
<p><strong>The Message: the (r)evolutionary power of climate change</strong><br />
<em>“The Message is a multi-platform (book + documentary + web + events) project by Naomi Klein and Avi Lewis.</em></p>
<p><strong>Turcot</strong><br />
<em>“Turcot looks at Montreal’s largest highway Interchange, currently scheduled for a complete demolition and rebuild. The interactivity of the documentary project will allow the residents a direct voice, so that their concerns and opinions are heard by others. The voices will build on each other to develop alternative designs and solutions while there is still time to influence the actual Interchange construction.”</em></p>
<p><strong>Following Wise Men (working title)</strong><br />
<em>“The film will tell an evergreen story about a 50th anniversary reunion road trip with four friends who are astronomers; the interactive project will be an evergreen, searchable, expandable, community-sourced science web site charting astronomers and their discoveries in the context of their professors, mentors and students in an astronomer’s family tree. “</em></p>
<p><strong>Looking at Los Sures</strong> <em>“We will use an archival documentary (Los Sures by Diego Echeverria, 1984) about the South Williamsburg neighborhood as the inspiration as well as the primary online navigation for a set of new documentary projects that approach the same place and themes, now nearly thirty years later. New short interactive projects created by thirty different artists over three years will annotate and expand on the original film in ways previously unexplored.&#8221;</em></p>
<p><strong>The Last Hijack</strong><br />
<em>“For over 20 years Somalis have faced the horror of famine and war. The Last Hijack is a story about survival in this failed state. It is about the rise of piracy and how it affects the people around it.&#8221;</em></p>
<p><strong>Immigrant Nation</strong></p>
<p><strong></strong><em><a href="https://twitter.com/#!/k88hudson">Kate Hudson</a> and I were paired up with <a href="https://twitter.com/#!/ktmckenna">Katie McKenna</a> and began understanding what the project was about and what Katie wanted to accomplish.  The nice thing about this experience was the Brett and Ben had all of the teams create a concise idea before coming to Hot Hacks, so we had a good idea to begin with and rolled with it.  What Katie envisioned was a way to showcase the different perspectives of various speakers regarding our environment. To do this, we wanted to use a parallax effect and separate the project into different sections that the user could scroll through and experience each perspective independently with its own unique theme. Another issue that we had to address early on was the fact that Popcorn has a tendency to throw a lot of information at you very abruptly. To combat this we used various transitions and effects to blur content that wasn&#8217;t the primary focus at the moment and ease it in when it was relevant. In doing so we created an experience that allows the user to focus on what the speaker is saying but also annotate important information when it made sense.  Another unique aspect of our project was the fact that we utilized scrolling to drive the Popcorn experience throughout the demo. This meant that the user could freely explore the page with the opportunity to jump between perspectives seamlessly. This meant that the user could navigate as they saw fit and not feel like we were spoon feeding them a linear experience.</em></p>
<p>The experience in general was great. Katie, Kate, and I gelled quite well in my opinion and got on the same page pretty fast. Kate and really got into the groove of things on day two. We were able to both collaboratively work off of a <a href="https://github.com/dseif/theMessage">single Github repo</a> and merge with one another pretty painlessly. In typical hack-a-thon fashion, a lot of ideas were tried, didn&#8217;t necessarily work, and were thrown away, which was one of our groups strengths in my opinion. Since we weren&#8217;t afraid to try things we were able to create a tonne of small prototypes and were able to see what worked and what didn&#8217;t very fast. Some of the prototypes that we created and threw away were things like pulling in an RSS feed on relevant information and displaying it across the background of a page, a map of the world that lit up various regions as you scrolled through the page, and many more. It was awesome that Katie was on board with all of this as well, as I&#8217;m sure it had to seem quite hectic and scary at times!</p>
<p>All in all the weekend was great and <a href="http://dseif.github.com/theMessage/">the demo</a> was a success. We created what we set out to do for the weekend and have a cool prototype for a web native version of The Message. I think events like this are an awesome idea as it bridges the gap between two very different professions. Just like <a href="http://mozillaopennews.org/">Mozilla Journalism</a> is bridging the gap between Journalists and Programmers, <a href="http://livingdocs.org/">The Living Docs</a> project and Popcorn is doing the same for Film Makers and Programmers and it&#8217;s great to be a part of.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dseifried.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dseifried.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dseifried.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dseifried.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dseifried.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dseifried.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dseifried.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dseifried.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dseifried.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dseifried.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dseifried.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dseifried.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dseifried.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dseifried.wordpress.com/374/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=374&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dseifried.wordpress.com/2012/05/02/hot-hacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c071ab21e5f797c63058fdf862a5f0f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dseifried</media:title>
		</media:content>
	</item>
		<item>
		<title>Reflecting on OSD700</title>
		<link>http://dseifried.wordpress.com/2012/04/16/reflecting-on-osd700/</link>
		<comments>http://dseifried.wordpress.com/2012/04/16/reflecting-on-osd700/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 15:31:50 +0000</pubDate>
		<dc:creator>dseifried</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[osd700]]></category>
		<category><![CDATA[seneca]]></category>

		<guid isPermaLink="false">http://dseifried.wordpress.com/?p=369</guid>
		<description><![CDATA[For the last 4 months I have been working on various Firefox bugs. A few of them have gotten landed, I&#8217;m still working on others and some were too hard to finish, so it&#8217;s been an interesting ride. The tickets that I&#8217;ve worked on have been the following: Bug 702161 &#8211; videocontrols.xml has anonymous function [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=369&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For the last 4 months I have been working on various Firefox bugs. A few of them have gotten landed, I&#8217;m still working on others and some were too hard to finish, so it&#8217;s been an interesting ride. The tickets that I&#8217;ve worked on have been the following:</p>
<ul>
<li><strong>Bug 702161</strong> &#8211; videocontrols.xml has anonymous function event listeners that are added but never removed</li>
<li><strong>Bug 680321</strong> &#8211; Media preload state should reset in resource selection algorithm</li>
<li><strong>Bug 708814</strong> &#8211; Should fade out videocontrols even if there&#8217;s no mouse movement</li>
<li><strong>Bug 686370</strong> &#8211; Implement video playback statistics proposed in WHATWG</li>
<li><strong>Bug 722788</strong> &#8211; JSON number parsing is slower than it needs to be</li>
<li>Boot to Gecko working on my phone</li>
</ul>
<p>Overall I&#8217;m happy with what I was able to accomplish so far and I&#8217;m still working towards finishing the video statistics ticket. Even tho my tickets haven&#8217;t been very high profile yet, it&#8217;s still a great feeling being able to get some code into Firefox, and really changes your perspective on how much hard work goes into making a browser.  I was working on tickets that involved things such as cleaning up event listeners, making sure controls for video elements got hidden when in fullscreen mode, and making sure the preload state reset properly, so I can only imagine how much work goes into other aspects such as security, the JavaScript engine, and so on. It really gave me a new respect for everyone doing this kind of work and I felt was a great experience.  It&#8217;s always funny when you hear someone say something along the lines of &#8220;Why doesn&#8217;t browser X just fix problem Y, it&#8217;s so easy&#8221; as once you get into the code it&#8217;s never easy and it&#8217;s never something that you can just write and then ship the next day, there is a ton of behind the scenes work that goes into making this a reality. Things like testing always go un-noticed by end users and is a really under appreciated portion of work that goes into development. I know from attempting to write my own tests on various projects that trying to prove that your fix is correct can sometimes be that hardest part of a patch. In addition to this I also continue to be amazed by the community and how helpful they can be.</p>
<p>Since I began working on open source projects over a year ago in OSD600 one of the biggest barriers to entry for me has been IRC. It always sounds simple to just go into IRC and ask for help but a lot of the time it can be a pretty nerve racking experience. It can be scary to just throw yourself into the middle of a chatroom full of sometimes hundreds of developers better than you and ask what is probably a trivial question. When I first began doing this I ended up being afraid almost every time, thinking I would be labeled as an idiot for asking such an easy question and from that point on that no one would take me seriously. In reality my experience has been quite the opposite, in that everyone is friendly and willing to help out a newcomer. I don&#8217;t know why this is, but I attribute it to the pay it forward mentality, someone helped you in the past so you are likely to do the same for a newcomer that comes to the channel looking for help.  I&#8217;ve actually taken this to heart and try to do it when I can, whether it be in Popcorn.js/Butter.js or Firefox bugs, I try to help people/newcomers whenever I can because I know I was once in the exact same position. I&#8217;m sure it&#8217;s just as hard to them to come into channel and ask a question as it was for me and I want to do whatever I can to make that experience more pleasant.</p>
<p>I have learned quite a bit this semester, from being more humble and stepping aside from my ego, to gaining confidence in both my coding and public speaking.  It&#8217;s taught me some interesting lessons when it comes to coding. Until this semester I have always tried to rush through things, brute forcing my way through code in fast trial and error type approach. I would figure out what the problem was and then begin frantically removing, altering, and adding code as I went along. Most of the time when I figured out what was wrong I was left with a warpath of broken and ugly code in my wake, something I&#8217;m sure my reviewers in Popcorn.js/Butter.js can attest to as I&#8217;m notrious for leaving things like <strong>console.log( &#8220;ASDASDASDASDASDFAS&#8221; ); </strong>in my code.  I learnt this lesson the hard way in one of the more recent bugs I was working on, 708814, which needed to be fixed up as it bit rotted for almost a month. I took a quick glance over my code and from what I could see it looked fine, I mean I also got an r+ on it, so it can&#8217;t be wrong, right? I went on what was a 20+ hour journey in the wrong direction, looking for a bug that didn&#8217;t exist.  It was a stressful experience to say the least, one where you just want to grab your computer, shake it violently, and yell &#8220;WHY AREN&#8217;T YOU WORKING&#8221;. I asked for help in channel and no one else was able to see a bug either. At this point I was spinning in circles in my chair and looking at the same 8 lines of code over and over again not understanding what could be wrong. Sort of jokingly I switched my listener from &#8220;mozfullscreenchange&#8221; to &#8220;mouseover&#8221; and changed the if condition to check if the video was fullscreen or not. This was basically the same approach as I was doing, just in a different fashion. To my surprise it worked, as it looked like a fullscreenchange event was being fired before a mouseover event, and this was why it wasn&#8217;t working. In the end it boiled down to me having 0 patience and rushing into the code. I didn&#8217;t even take a second look at my code and began smashing my face into other code and assumed to problem was there. If I took 10 minutes to go over my code and think about it again I probably wouldn&#8217;t have done this. The only real reason I figured this problem out was because I am stubborn and didn&#8217;t give up, but if I learned to be patient before hand I probably could have saved a day worth of work. In order to work on code as large as Firefox you are going to need to be able to persevere and be stubborn, the code is going to beat you down over and over again and you need to show it who&#8217;s boss. I&#8217;ve been pretty good at not giving up this semester, but I didn&#8217;t really learn how important it can be to take a step back and be patient with my approach until I saw how far off I went in the wrong direction with 708814 ( and it was really far ).</p>
<p>In general the semester was great, I got to write in a language that I am far from comfortable with, engage with an unfamiliar community, and land fixes in Firefox. I continually tried to challenge myself with the bugs I undertook and I learned a lot because of it. I&#8217;m working on getting the video statistics ticket up for review by thursday and then working on review failures from then on. I think being able to say &#8220;I wrote feature X for Firefox&#8221; is a pretty awesome and is definitely another notch on my programming belt, so that&#8217;s what I&#8217;m striving for.</p>
<p>I had a great semester with everyone from class and I can&#8217;t thank everyone enough for the great feedback during class presentations and the help on irc. It was also great to witness everyone else step it up a notch and see what they got done, it definitely motivated me throughout the course to keep going and not give up.  I wish everyone who graduated this semester ( I think everyone except me haha ) the best of luck with whatever you have planned for post graduation and hopefully we can all stay in touch via the seneca irc channel. To those who I&#8217;ll be working with over the summer at CDOT and Mozilla, I can&#8217;t wait to see what we make, it&#8217;s gonna be awesome!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dseifried.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dseifried.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dseifried.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dseifried.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dseifried.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dseifried.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dseifried.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dseifried.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dseifried.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dseifried.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dseifried.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dseifried.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dseifried.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dseifried.wordpress.com/369/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=369&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dseifried.wordpress.com/2012/04/16/reflecting-on-osd700/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c071ab21e5f797c63058fdf862a5f0f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dseifried</media:title>
		</media:content>
	</item>
		<item>
		<title>Firefox Bug 708814</title>
		<link>http://dseifried.wordpress.com/2012/04/11/firefox-bug-708814/</link>
		<comments>http://dseifried.wordpress.com/2012/04/11/firefox-bug-708814/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 02:36:02 +0000</pubDate>
		<dc:creator>dseifried</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[708814]]></category>
		<category><![CDATA[fullscreen controls]]></category>

		<guid isPermaLink="false">http://dseifried.wordpress.com/?p=365</guid>
		<description><![CDATA[Over the last few days I have been working on attempting to finish Firefox Bug 708814. The bug is that when the video goes fullscreen the controls are not hidden when there is no mouse movement. I had a patch to fix this just over a month ago but I let it sit for too [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=365&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Over the last few days I have been working on attempting to finish Firefox Bug 708814. The bug is that when the video goes fullscreen the controls are not hidden when there is no mouse movement. I had a patch to fix this just over a month ago but I let it sit for too long before coming back to it and it no longer works.  Currently I&#8217;m trying to figure out why it is failing, which is proving to be quite difficult.</p>
<p>One of the new issues that is popping up is that Util&#8217;s is not defined from the following <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/videocontrols.xml#815">block of code</a>. I briefly asked Jaws about it but he didn&#8217;t seem to know why this was happening either, so I am still investigating as to why this is happening. I also tried using |this| instead of Utils as they seemed to be the same thing, but I think the context of |this| was being miscontrued as well seeing as it was coming from inside a setTimeout.  After compiling and testing this again it wasn&#8217;t complaining about Utils not existing coming from my listener, but rather from when it was called inside <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/videocontrols.xml#820">onMouseMove</a>. I did the same thing I did as before and wrapped the function reference in an anonymous function and called |self._hideControlsFn( self )| ( obviously gross code, but for testing purposes it was fine ). Finally I was seeing some progress! At this point the controls were hiding after a mousemove over the video, but not if there wasn&#8217;t one. This was good because I was now back to a state where everything was working the way it should be before my patch got applied, so I knew I was headed in the right direction.</p>
<p>The only thing that I figured could be the cause here was if for some reason the scubber was being dragged, as that was the only check being done inside of _hideControlsFn, so I figured I would make sure that we were getting inside there, which it turns out wasn&#8217;t the issue. Back to the drawing board. I decided to look deeper into what was going on, as the issue obviously wasn&#8217;t present in _hideControlsFn, so I went looking in the <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/videocontrols.xml#887">startFade</a> function itself. After reading through the startFade function a bit it was pretty obvious where I needed to monitor, which was <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/videocontrols.xml#911">this block of code</a>.  I throw some console.logs in there to check out what the values were and if for some reason anything weird was going on and it turns out that still looked pretty normal. The only difference that I could spot was that whenever the controls succesfully hid it would enter the <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/videocontrols.xml#913">last block inside of the else</a>. I did some more logging before that block executed and got some interesting values. It turns out that the controls were not the only one calling startFade, but also an element called clickToPlay ( maybe the start button? ) so I decided to allow clickToPlay or controls to be the element for the condition to pass, but didn&#8217;t seem to make a difference. Looked like there was no option, I had to go deeper.</p>
<p>After playing around with some stuff for about an hour and realized that I missed something super obvious from the get go, that the listener for fullscreen had a check in it for hover, which always came up false initially, which really wasn&#8217;t what we wanted. I made it so the listener was for mouseover and checked to see if the video was in fullscreen or not, and what do you know it worked!  After looking at my fix a bit more this made sense ( I think ). I&#8217;m happy that I finally figured this bug out, as it was a super subtle and tricky one to figure out, I got led off track quite a bit and went down a ton of deadends. As we speak I&#8217;m creating a new patch and making sure that it works fine, so fingers crossed!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dseifried.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dseifried.wordpress.com/365/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dseifried.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dseifried.wordpress.com/365/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dseifried.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dseifried.wordpress.com/365/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dseifried.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dseifried.wordpress.com/365/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dseifried.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dseifried.wordpress.com/365/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dseifried.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dseifried.wordpress.com/365/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dseifried.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dseifried.wordpress.com/365/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=365&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dseifried.wordpress.com/2012/04/11/firefox-bug-708814/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c071ab21e5f797c63058fdf862a5f0f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dseifried</media:title>
		</media:content>
	</item>
		<item>
		<title>OSD700 0.9</title>
		<link>http://dseifried.wordpress.com/2012/04/08/osd700-0-9/</link>
		<comments>http://dseifried.wordpress.com/2012/04/08/osd700-0-9/#comments</comments>
		<pubDate>Sun, 08 Apr 2012 21:39:27 +0000</pubDate>
		<dc:creator>dseifried</dc:creator>
				<category><![CDATA[B2G]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[school]]></category>

		<guid isPermaLink="false">http://dseifried.wordpress.com/?p=360</guid>
		<description><![CDATA[For my 0.9 release I worked on a few different things, such as revisiting an old patch, more work on the video statistics bug, and even began fooling around with Boot to Gecko. It was an interesting 2 weeks as I experienced various ups and downs throughout the different things I was working, particularly Boot [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=360&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For my 0.9 release I worked on a few different things, such as revisiting an old patch, more work on the video statistics bug, and even began fooling around with Boot to Gecko. It was an interesting 2 weeks as I experienced various ups and downs throughout the different things I was working, particularly Boot to Gecko ( B2G ). Initially I wanted to clean up the old code for 708814 and finally get it landed, tho it wasn&#8217;t as clear cut as it sounded.</p>
<p>Over the course of the <a href="http://dseifried.wordpress.com/wp-admin/post.php?post=270&amp;action=edit">semester I have been working on and off</a> on bug<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=708814"> 708814</a> and I even posted a<a href="https://bugzilla.mozilla.org/attachment.cgi?id=590984&amp;action=diff"> patch</a> a few weeks back. I got a &#8220;feedback looks good&#8221; from Jaws and thought I was essentially done, so I didn&#8217;t worry about it much.  I wanted to finally finish this ticket and get it landed so I could get it off my back.  I began by attempting to write some unit tests, but after about 2 days of driving myself nuts I realized that there really wasn&#8217;t a good way to test the feature that I added after Chris Pearce mentioned it on IRC. Awesome, I thought I was done at this point so I put the patch back up for a formal review and thought I had wiped my hands of this ticket, which sadly wasn&#8217;t the case.  Before I did this Chris asked me to re-base my code off of master as it had been sitting for a while and then put it up for review. I did this and threw it up, at which time Chris began playing with it.  It turns out that I few edge cases have turned up since I initially wrote the patch and the fix was no longer sound, which sucked pretty hard. I realized that through my neglect the code sat long enough that Mozilla Central had progressed far enough that my patch no longer fixed what it once did and that I needed to go back to the drawing board. It sucks because through my laziness I actually created more work for myself in the long run and should have just followed through with this patch from the get go, as this probably wouldn&#8217;t have happened. I am making this my first priority for my 1.0 release and want to get this done ASAP, even before I begin playing with the video statistics again.</p>
<p>The first ticket I was assigned to do this year was<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=686370"> 686370</a>, which was to finish implementing the <a href="http://wiki.whatwg.org/wiki/Video_Metrics">video playback statistics</a>.  I wrote about some of my <a href="http://dseifried.wordpress.com/wp-admin/post.php?post=313&amp;action=edit">earlier</a> <a href="http://dseifried.wordpress.com/wp-admin/post.php?post=316&amp;action=edit">experiences</a> with this and have been building on what I have been doing since. Mathew Schranz has also been helping me on this and has been writing about his experiences implementing the playback jitter portion of the stats.  There is still quite a bit left to do here and since this is the main feature I am planning on getting done for the end of the semester I am going to have my work cut out for me over the next few weeks.</p>
<p>The last but probably most interesting thing I have been working on is attempting to get <a href="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Building_B2G_for_Samsung_Galaxy_S2">Boot to Gecko</a> working on my phone, the Samsung Galaxy SII. Currently my phone is running android and I thought it would be interesting to be able to play with the new mobile OS that Mozilla has been developing. Boot to Gecko ( or b2g for short ) is developing on top of core android libraries that control things such as the camera, wifi, and various other essential parts of the phone experience. On top of the Mozilla has made it so the web is the OS, meaning that everything is written in HTML, CSS, and JavaScript. This was really appealing to me as I work with the web on a daily basis, so being able to create apps without having to play with Java or objective C sounded pretty appealing. The only problem here was that the version of my phone wasn&#8217;t currently supported, so I knew I was in for a quite a bit of work. I wrote about some<a href="http://dseifried.wordpress.com/wp-admin/post.php?post=348&amp;action=edit"> earlier</a> <a href="http://dseifried.wordpress.com/wp-admin/post.php?post=357&amp;action=edit">experiences</a> I had working with b2g, but it I never actually got it working which sort of sucks. The farthest I got into the build was getting to the point of flashing the kernel and having it fail at 98%, which really sucks. I did some more research and analyzed the logs a bit over the weekend and found that when I was creating the ROM it was actually failing in a few spots but I never noticed. I am going to research these issues in the future, but probably won&#8217;t be able to revisit my b2g work until after I have finished 708814 and 686370.</p>
<p>The next two weeks are going to be pretty busy and I am going to have to work like crazy in order to get these patches ready for the end of the semester, so it should be pretty interesting.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dseifried.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dseifried.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dseifried.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dseifried.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dseifried.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dseifried.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dseifried.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dseifried.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dseifried.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dseifried.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dseifried.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dseifried.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dseifried.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dseifried.wordpress.com/360/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=360&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dseifried.wordpress.com/2012/04/08/osd700-0-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c071ab21e5f797c63058fdf862a5f0f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dseifried</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Boot to Gecko – Part 2</title>
		<link>http://dseifried.wordpress.com/2012/03/29/installing-boot-to-gecko-part-2/</link>
		<comments>http://dseifried.wordpress.com/2012/03/29/installing-boot-to-gecko-part-2/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 13:40:27 +0000</pubDate>
		<dc:creator>dseifried</dc:creator>
				<category><![CDATA[B2G]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[b2g]]></category>
		<category><![CDATA[boot to gecko]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://dseifried.wordpress.com/?p=357</guid>
		<description><![CDATA[Earlier this week I wrote about my initial experience with attempting to install Boot to Gecko on my Samsung Galaxy S II.  Previously I went through setting up the OS, installing the required dependencies, making a backup of your current installation in case something goes wrong ( which is pretty likely in my case ).  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=357&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://dseifried.wordpress.com/2012/03/27/installing-boot-to-gecko-part-1/">Earlier this week</a> I wrote about my initial experience with attempting to install Boot to Gecko on my Samsung Galaxy S II.  Previously I went through setting up the OS, installing the required dependencies, making a backup of your current installation in case something goes wrong ( which is pretty likely in my case ).  The installation for the most part went pretty smoothly until I ended up hitting a problem when I actually began building.</p>
<p>The problem that I initially ran into was build fails due to the fact that my specific model/version isn&#8217;t supported yet.  The solution here was to modify one of the build scripts to reflect my device, which wasn&#8217;t all that bad.  What I had to do was add in a case for my specific version and account for file names that may be different on my version compared to what is already used.  In a lot of the cases it just turned out to be modifying IF statements or appending an &#8216;M&#8217; to some files ( as that is my specific version &#8211; the GT-I9100M, and the build &#8211; GINGERBREAD.UGKG2 ). After I had done this my <code>make config-galaxy-s2</code> was passing now, which was awesome.</p>
<p>Now it was time to begin building gonk, which from what I understand is the backend of Boot to Gecko.  So I built that and it actually ended up going pretty smoothly.  I then simply ran |make| after that and this is when I began seeing some errors. On a side node it looks just like building Firefox from source, which is pretty cool. The errors were pretty cryptic and about stuff that I didn&#8217;t understand so I did what I normally do under these circumstances and went to ask someone smarter than me. I went into the IRC channel and started asking about the error and I immediatley got some responses. I was told to run |make sync| and to pastebin the output. What make sync does is update all of git submodules and makes sure everything is up to date with master.  I ran it and the output looked clean and fine to me, so I pastebined it to the channel. Someone quickly spotted where I went wrong. In my logs it said I that it was updating from my remote, so dseif/b2g ( which looked ok to me ) but apparently was wrong.  The problem here was that I forked and then cloned instead of just cloning.  The reason I shouldn&#8217;t have done this is it screws up the submodule updating apparently and I am not getting the most up to date files.  The errors I was seeing were old issues that had already been fixed and what I needed to do at this point was set my origin&#8217;s remote url as the url I forked from.  After I did this I re-ran make sync and I started getting updates! I went through the commands that I ran previously and they seemed to be passing now <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  The make command took a while to finish but it did so without any errors.</p>
<p>Now it was time to begin flashing! To do so all I had to do was run |make flash|.  This ended up taking a while and once it was done it rebooted my phone. The moment of truth came and it didn&#8217;t boot at all, which scared me a bit <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  I went back and reflashed my device by running the following:</p>
<p>adb reboot recovery</p>
<p>and then selected my backup that I made earlier and reflash my phone. Luckily the backup worked just fine and my phone was back in a working state <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Tonight I plan on trying to figure out why my flash was failing and I will hopefully have a running boot to gecko phone by the end of the night <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dseifried.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dseifried.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dseifried.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dseifried.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dseifried.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dseifried.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dseifried.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dseifried.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dseifried.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dseifried.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dseifried.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dseifried.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dseifried.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dseifried.wordpress.com/357/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=357&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dseifried.wordpress.com/2012/03/29/installing-boot-to-gecko-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c071ab21e5f797c63058fdf862a5f0f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dseifried</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Boot to Gecko &#8211; Part 1</title>
		<link>http://dseifried.wordpress.com/2012/03/27/installing-boot-to-gecko-part-1/</link>
		<comments>http://dseifried.wordpress.com/2012/03/27/installing-boot-to-gecko-part-1/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 13:36:56 +0000</pubDate>
		<dc:creator>dseifried</dc:creator>
				<category><![CDATA[B2G]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[b2g]]></category>
		<category><![CDATA[boot 2 gecko]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://dseifried.wordpress.com/?p=348</guid>
		<description><![CDATA[For the past month or so Stefan Reese and I have been talking about various things mobile, from what&#8217;s new and cool on Android to the various devices coming to market.  Stefan is basically my source for everything mobile and keeps a fresh stream of info coming my way.  When I heard about Boot to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=348&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For the past month or so <a href="https://twitter.com/#!/StefanRees">Stefan Reese</a> and I have been talking about various things mobile, from what&#8217;s new and cool on Android to the various devices coming to market.  Stefan is basically my source for everything mobile and keeps a fresh stream of info coming my way.  When I heard about <a href="https://wiki.mozilla.org/B2G">Boot to Gecko</a> I obviously had to show Stefan about it and he seemed pretty stoked about it.  Once Mozilla demoed B2G at the <a href="http://www.youtube.com/watch?v=OAaH5vikEOM"><em>Mobile</em> World Congress 2012</a> and I saw what it was really about I wanted it pretty bad. I&#8217;ve been playing with idea of installing it on my device ( luckily I have a Samsung Galaxy S II, which seems to be what most of the demos are on ) and when Stefan mentioned he was interested in trying it out as well, I figured I may as well do it.</p>
<p>First thing&#8217;s first, it seems to be recommended that you do the build on Linux ( the latest version of Ubuntu seems to be what most guides are recommending ) so that&#8217;s what I did.  Since I was already running Windows on my desktop I used Ubuntu&#8217;s Window&#8217;s installer, which allows you to install Ubuntu right alongside an already existing Windows install ( no reformatting/partitioning needed! ).  Once I installed Ubuntu I installed the usual things that I would on a fresh install ( flash, vim, git, got all my music up and running, set up thunderbird, ect ) and begin following the guides that I found online.  One of the great things about the Mozilla community is how well they document things. I was able to follow the steps for the most part with no hiccups. I followed <a href="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Setting_Up_Boot_to_Gecko_Build_Environment">these </a><a href="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Building_B2G_for_Samsung_Galaxy_S2">guides</a> and they seemed to do the trick, so I also recommend them! Just and FYI, I accept no responsibility if you brick your phone by following my steps <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><a href="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Setting_Up_Boot_to_Gecko_Build_Environment">Setting up my enviroment</a> so it was ready to install B2G was pretty simple.  It involved getting adb up and running ( which I had prior experience with from some Android development I&#8217;ve done ). You can do this by installing the <a href="http://developer.android.com/sdk/index.html">Android SDK</a> ( once installed you may need to run <code>android-sdk-linux/tools/android</code> and update the SDK ). Once that is done, you will need to add adb ( inside android-sdk-linux/platform-tools/ ) to your path ( done in your ~/.bashrc ).  You can test this easily by going to your terminal and typing adb, you should see something like the following:</p>
<p><a href="http://dseifried.files.wordpress.com/2012/03/adb.png"><img class="aligncenter size-medium wp-image-349" title="adb" src="http://dseifried.files.wordpress.com/2012/03/adb.png?w=289&h=300" alt="" width="289" height="300" /></a></p>
<p>Now I was ready to backup my phone, which required installind <a href="http://www.glassechidna.com.au/products/heimdall/">heimdall</a>, which is a cross-platform tool used to flash firmware onto Samsung Galaxy S devices. After installing heimdall you are going to need make sure it has access to your phone ( which is done via udev ). I did this by editting /etc/udev/rules.d/android.rules ( if it doesn&#8217;t exist create it ) and adding the following line:</p>
<div id="LC15"> SUBSYSTEM==&#8221;usb&#8221;, ATTRS{idVendor}==&#8221;04e8&#8243;, MODE=&#8221;0666&#8243;</div>
<div>After doing this I made sure the file was readable and I was ready to move onto the next step, which was installing a whole slew of build dependencies.</div>
<div></div>
<div>To install the build dependencies I essentially coped some commands that were listed on the wiki and it seemed to work out just fine for me.  The commands were as follows:</div>
<div></div>
<div><code>sudo apt-get build-dep firefox</code></div>
<div><code>sudo apt-get install git mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13</code></div>
<div><code>sudo apt-get install ia32-libs gcc-multilib g++-multilib bison flex gperf lib32z-dev lib32ncurses5-dev lib32ncursesw5-dev libidl-dev lib32gomp1 autoconf2.13 ccache libx11-dev lib32readline-gplv2-dev</code></div>
<div><code>sudo apt-get install default-jdk</code></div>
<div></div>
<div>Now it&#8217;s time to back up our phone and make sure if shit hits the fan that we have something to fall back on. Make sure your phone is connected to your computer via USB. To do this we are going to use heimdall ( which we installed earlier ).  First what I did was cd into my tmp directory. I then ran the following commands:</div>
<div></div>
<div><code>wget cmw.22aaf3.com/c1/recovery/recovery-clockwork-4.0.1.4-galaxys2.tar</code></div>
<div><code>tar xvf recovery-clockwork-*tar</code></div>
<div></div>
<div>Next I ran:</div>
<div></div>
<div><code>adb reboot download</code></div>
<div></div>
<div>Which puts the device into download mode.  You should know your phone is in download mode if your screen is now showing a green android character and telling you not to disconnect your device because it&#8217;s in download mode haha.  Now we are going to flash the phone by running the following:</div>
<div></div>
<div><code><code>heimdall flash --kernel zImage</code></code></div>
<div></div>
<div>And then boot our phone back into recovery mode:</div>
<div></div>
<div><code>adb reboot recovery</code></div>
<div></div>
<div>Follow the on screen directions to create a back up and so on ( use your volume buttons and home button to navigate ). Once you&#8217;ve done this back up your phones filesystem onto your computer by running the following:</div>
<div></div>
<div><code>mkdir sgs2-android</code></div>
<div><code>cd sgs2-android</code></div>
<div><code>adb pull /system system</code></div>
<div><code>adb pull /vendor vendor</code></div>
<div></div>
<div>My console looked like the following during the pull command:</div>
<div><a href="http://dseifried.files.wordpress.com/2012/03/pull-adb.png"><img class="aligncenter size-medium wp-image-350" title="pull" src="http://dseifried.files.wordpress.com/2012/03/pull-adb.png?w=246&h=300" alt="" width="246" height="300" /></a></div>
<div>and looked like the following after the vendor command:</div>
<div><a href="http://dseifried.files.wordpress.com/2012/03/vendor-adb.png"><img class="aligncenter size-medium wp-image-351" title="vendor-adb" src="http://dseifried.files.wordpress.com/2012/03/vendor-adb.png?w=300&h=40" alt="" width="300" height="40" /></a></div>
<div></div>
<div>Alright, finally we can clone our git repo! I forked mine from https://github.com/andreasgal/B2G ( which from what I can tell is the main one ) and then cloned into a local repository called B2G.  Once you&#8217;ve done this run the following commands ( NOT as root, it was strongly advised not to do so on the guide I used ):</div>
<div></div>
<div><code>cd B2G</code> ( or wherever you have it as )</div>
<div><code>make sync</code> ( from what I can tell it updates a ton of submodules that are in the project. Depending on how fast your connection is this may take a while, as it did for me. ).</div>
<div><code>export ANDROIDFS_DIR=sgs2-android</code> ( should be exported to the same PATH that you updated earlier )</div>
<div><code>make config-galaxy-s2</code></div>
<div></div>
<div>Once I ran make config-galaxy-s2 I got some build errors mentioning that it couldn&#8217;t find a directory.  This was the extent of my night last yesterday and I am going to have to do some more googling or speak to someone in #b2g on irc.mozilla.org.  So far the only real problem that I have encountered was this, which is pretty good I guess. Since B2G is still so young it&#8217;s expected that I was going to run into a few issues, who knows, maybe I&#8217;ll even get to file a bug or two. Expect another post tonight with hopefully a running version of B2G!</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dseifried.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dseifried.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dseifried.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dseifried.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dseifried.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dseifried.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dseifried.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dseifried.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dseifried.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dseifried.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dseifried.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dseifried.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dseifried.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dseifried.wordpress.com/348/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=348&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dseifried.wordpress.com/2012/03/27/installing-boot-to-gecko-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c071ab21e5f797c63058fdf862a5f0f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dseifried</media:title>
		</media:content>

		<media:content url="http://dseifried.files.wordpress.com/2012/03/adb.png?w=289" medium="image">
			<media:title type="html">adb</media:title>
		</media:content>

		<media:content url="http://dseifried.files.wordpress.com/2012/03/pull-adb.png?w=246" medium="image">
			<media:title type="html">pull</media:title>
		</media:content>

		<media:content url="http://dseifried.files.wordpress.com/2012/03/vendor-adb.png?w=300" medium="image">
			<media:title type="html">vendor-adb</media:title>
		</media:content>
	</item>
		<item>
		<title>OSD700 0.8</title>
		<link>http://dseifried.wordpress.com/2012/03/23/osd700-0-8/</link>
		<comments>http://dseifried.wordpress.com/2012/03/23/osd700-0-8/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 13:51:32 +0000</pubDate>
		<dc:creator>dseifried</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[video statistics]]></category>

		<guid isPermaLink="false">http://dseifried.wordpress.com/?p=345</guid>
		<description><![CDATA[This release I finally got time to sit down and focus on the first bug I was assigned this semester, which was 686370 ( Implement video playback statistics proposed in WHATWG ).  The playback statistics were already started earlier and a few portions of it have already been implemented ( mozParsedFrames, mozDecodedFrames, mozPresentedFrames, mozPaintedFrames, and mozPaintDelay ). [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=345&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This release I finally got time to sit down and focus on the first bug I was assigned this semester, which was <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=686370">686370</a> ( Implement video playback statistics proposed in WHATWG ).  The playback statistics were already started earlier and a few portions of it have already been implemented ( mozParsedFrames, mozDecodedFrames, mozPresentedFrames, mozPaintedFrames, and mozPaintDelay ). What I was to do for this ticket was to finish off the <a href="http://wiki.whatwg.org/wiki/Video_Metrics">remaining statistics</a> that needed to be implemented ( scroll down to the bottom ). <a href="http://mschranz.wordpress.com/">Mathew Schranz </a>also expressed interest in helping with this so I&#8217;m sure you&#8217;ll catch him blogging about his experiences as well.</p>
<p>To get things started I was fortunate enough to have some class time allocated to go over how we would begin working on this bug.  Dave went over what would need to be done in order to get this implemented and how we would go from the decoder level all the way up to the DOM.  We began by taking a look at the already implemented portions of the spec and began tracing a route that they took from an idl file all the way down into the decoder. This was invaluable to me as I got input from the class on what they would do, thoughts from others who have worked with idl files before, as well as an understand of the scope of what I would be working on.  After we traced a path through the code it was time to begin coding.</p>
<p>I <a href="http://dseifried.wordpress.com/2012/03/14/implementing-video-playback-statistics-in-firefox/">went home that night</a> and basically didn&#8217;t know which statistics I wanted to do first, so I just chose the one at the top of the list, which was bytesReceived. bytesReceived is described as &#8220;The raw bytes received from the network for decode. Together with the downloadTime, this can be used to calculate the effective bandwidth. Includes container data.&#8221; which basically means that we need a way to measure all of the data that we are downloading for a given media element. I took a similar approach to what was done before in the  video idl file and applied it to the media element idl file.  I began forging my own path down to the decoder and began seeing some results. Once I got into the decoder I found a portion of the code that looked like what I needed to monitor and got access to the data I needed.  I battled with making this correct for the <a href="http://dseifried.wordpress.com/2012/03/15/implementing-video-playback-statistics-in-firefox-part-ii/">next few nights</a> and it actually turned out that I wasn&#8217;t even in the right code, as I&#8217;m confident now the data that I need is hidden within the media cache somewhere. I took the weekend off to work on my car and think about this and it dawned on me that what I actually found and created was bytesDecoded.  I ended up renaming things accordingly and testing it again and it seemed like exactly what I needed.  1 down, 5 to go <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Next I decided to work on dropped frames, as I scrambled my brain a bit trying to comprehend some of the media cache code. droppedFrames is defined as &#8220;The number of frames of video that have been dropped due to performance reasons. This does not include (for example) frames dropped due to seeking.&#8221;. This means that we need a way to measure any frames that are not displayed, which will provide developers with a way to measure the speed of the decoding pipeline ( at least a portion of it, more accurate results would be achieved is used in conjunction with other media statistics ). Since this particular statistic was referencing frames I knew it would be directly related video only, and we could ignore the audio portion of the media element.  This enabled me to do some caro culting and copy what I could from earlier implementation of the video statistics.  Once I reached the decoder I did some searching and read through the code a bit and ended up finding the following snippet in the <a href="http://mxr.mozilla.org/mozilla-central/source/content/media/nsBuiltinDecoderStateMachine.cpp#1958">nsBuiltinStateMachine.cpp</a> and added in a small piece of code that would keep track of all of the frames that were skipped and report them to a setter that I created in nsMediaDecoder for mozDroppedFrames. The setter would simply increment a value that I had stored in the nsMediaDecoder and I also had a getter that would be able to reach in and get the value of droppedFrames.  It looked like a pretty solid first attempt and I rolled with it and all seemed to be working well.  The problem that I am having is finding out if I did it right, because I seem to be getting the same results for both high-def videos and low-def videos ( 1080 vs 480 ).  This doesn&#8217;t seem like it should be the case and I should probably look into this further.</p>
<p>The next steps for the statistics are to get the remaining few implemented and get this up for review as soon as possible. I&#8217;m sure that I&#8217;ve done a few things the wrong way, or it isn&#8217;t optimized enough, so I&#8217;m looking forward to getting some feedback.  Until then, expect a few more blog posts about this and expect these stats to be landing in one of the upcoming Firefox Nightlies <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/dseifried.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dseifried.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dseifried.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dseifried.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dseifried.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dseifried.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dseifried.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dseifried.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dseifried.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dseifried.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dseifried.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dseifried.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dseifried.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dseifried.wordpress.com/345/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=345&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dseifried.wordpress.com/2012/03/23/osd700-0-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c071ab21e5f797c63058fdf862a5f0f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dseifried</media:title>
		</media:content>
	</item>
		<item>
		<title>Implementing video playback statistics in Firefox</title>
		<link>http://dseifried.wordpress.com/2012/03/14/implementing-video-playback-statistics-in-firefox/</link>
		<comments>http://dseifried.wordpress.com/2012/03/14/implementing-video-playback-statistics-in-firefox/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 05:20:02 +0000</pubDate>
		<dc:creator>dseifried</dc:creator>
				<category><![CDATA[audio]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[bytesDownloaded]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[firefox statistics]]></category>
		<category><![CDATA[playback statistics]]></category>

		<guid isPermaLink="false">http://dseifried.wordpress.com/?p=313</guid>
		<description><![CDATA[Early this year I began my second course in Open Source development taught by David Humphrey.  I have been working on various Firefox bugs since the beginning of the semester and have landed 2 tickets so far, with a 3rd on the way.  The 3rd ticket that I am working on is almost done and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=313&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Early this year I began my second course in Open Source development taught by <a href="http://vocamus.net/dave/">David Humphrey</a>.  I have been working on various Firefox bugs since the beginning of the semester and have landed 2 tickets so far, with a 3rd on the way.  The 3rd ticket that I am working on is almost done and just requires a few tests to be written then it should be good to go.  While I muster up some motivation to write the tests I figured I may as well begin working on the biggest ticket I took on this semester, which is implementing the rest of the <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=686370">video playback statistics in Firefox</a>.  I was initially going to work on it alone, but <a href="http://mschranz.wordpress.com/">Mathew Schranz</a> expressed interest in working on it as well, so why not, the more the merrier!</p>
<p>We began by dividing up the <a href="http://wiki.whatwg.org/wiki/Video_Metrics">remaining features</a> that were still needed which included the following:</p>
<ul>
<li>bytesReceived &#8211; the number of raw bytes received from the network for decode</li>
<li>downloadTime &#8211; the time since first HTTP request is sent until now or the download stops/finishes/terminates (whichever is earlier)</li>
<li>networkWaitTime &#8211; the total duration of time when a playback is stalled, waiting to receive more data from network</li>
<li>videoBytesDecoded &#8211; the number of bytes of video data that have been decoded</li>
<li>audioBytesDecoded &#8211; the number of bytes of audio data that have been decoded</li>
<li>droppedFrames &#8211; the number of frames of video that have been dropped due to performance reasons</li>
<li>playbackJitter &#8211; it is useful for applications to be able obtain an overall metric for perceived playback quality and smoothness</li>
</ul>
<p>I decided that I would take bytesReceived, downloadTime, networkWaitTime, and dropped frames while Mathew would take on videoBytesDecoded, audioBytesDecoded, and playbackJitter.  I decided to simply start at the top of the list and work my way down, so bytesReceived was first. Since Humph went over this in class last week I had a good idea of where to start, so I picked up where we left off. Using MXR I looked up where the other parts of the playback statistics had been implemented and worked out from there.  My guess was that I wouldn&#8217;t need to do too much heavy lifting, as much of the work was probably done for me ( I mean, they must keep track of what they are downloading somehow ) so I began digging through various mediaElement, decoder, and mediaStream files. I eventually ended up pieces of code for each of the various video encoding formats and began sifting through what was there. Eventually I found a function that seemed like something I wanted:</p>
<pre><a href="http://mxr.mozilla.org/mozilla-central/source/content/media/nsBuiltinDecoder.cpp#701">void nsBuiltinDecoder::NotifyBytesConsumed(PRInt64 aBytes)</a></pre>
<p>After looking at the function a bit closer I noticed that it called another function, AddBytes on the mPlaybackStatistics object, which seemed liked something that was related to what I was doing here ( not to mention it was referencing playback statistics! ). Looking closer at <a href="http://mxr.mozilla.org/mozilla-central/source/content/media/MediaResource.h#96">AddBytes</a> I noticed it was adding the number of bytes passed into it to a local variable in the decoder called mAccumulatedBytes. I was pretty confident at this point that what we wanted for bytesDownloaded was simply all of the bytes that we have downloaded so far, which im pretty confident is mAccumulatedBytes.  Now I was ready to start coding!</p>
<p>I started by defining the attribute, mozBytesDownloaded, inside of the idl file located at dom/interfaces/html/nsIDOMHTMLMediaElement.idl inside mozilla-central. I made it a readonly attribute that was an unsigned long ( as i&#8217;m pretty sure that there will be no negative values here, so why not ).  Next I needed to find a way to reach into the decoder and access the value of mAccumulatedBytes, so I took a look at the route that was currently being taken by similar functions to get to the decoder.  I decided to look at how Chris Pearce originally did this for the already existing portions of the video playback statistics ( mozParsedFrames, mozDecodedFrames, mozPresentedFrames, mozPaintedFrames, mozPaintDelay ). After doing another search on MXR I found that this was being done inside <a href="http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/nsHTMLVideoElement.cpp#188">nsHTMLVideoElement.cpp</a> .  Seeing as the bytesDownloaded attribute applied to both audio AND video, I couldn&#8217;t do this in here but told me it needed to be done in the <a href="http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/nsHTMLMediaElement.cpp">nsHTMLMediaElement.cpp</a> file instead.</p>
<p>Inside the nsHTMLMediaElement file I saw similar getters and setters to those that were in the videoElement file, such as GetMozSampleRate, GetMozFrameBufferLength, and many more. I figured a good place for my new function, GetMozBytesDownloaded, would be at home with these guys. I did a bit of <a href="http://en.wikipedia.org/wiki/Cargo_cult_programming">cargo culting</a> and stole what logic I could from GetMozFrameBufferLength as it was also accessing the decoder so seemed ok to me.  What I needed to do from here was find my way into the decoder and it looked like GetMozFrameBufferLength was doing so also ( it was calling <a href="http://mxr.mozilla.org/mozilla-central/search?string=GetFrameBufferLength%28%29&amp;find=&amp;findi=&amp;filter=%5E%5B%5E%5C0%5D*%24&amp;hitlimit=&amp;tree=mozilla-central">GetFrameBufferLength()</a> ) so I decided to look where I could write my own function to access the data that I needed. The method was being defined in nsMediaDecoder.h so I figured it was a good place to put mine as well.  After doing a bit of poking around and checking out what else was in here I found the function that brought me down this path, NotifyBytesConsumed! I was feeling even more confident now in my function placement and created my own, getBytesDownloaded. I did some more cargo culting here and stole what I could from NotifyBytesConsumed.  I figured I didn&#8217;t need the check that NotifyBytesConsumed had for mIgnoreProgressData as it looked like it was pertaining to whether the video seeked or moved the play position; we only cared about how many bytes were downloaded. Instead of calling AddBytes on mPlaybackStatistics I figured I would yet again write my own function, getBytes. Just like I did previously, I looked up how AddBytes was implemented and followed suit where I could( which was done in <a href="http://mxr.mozilla.org/mozilla-central/source/content/media/MediaResource.h#96">MediaResource</a> ).  All my function did was ensure that the video had started ( if it wasn&#8217;t started, return early ) and if it had started then return the number of bytes that we have downloaded. Alright great, now lets compile this and see what happens. Anddddd build failures <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>I managed to fix a few failures but I am currently stuck on one that looks like the following:</p>
<p>Undefined symbols for architecture x86_64:<br />
&#8220;nsMediaDecoder::bytesDownloaded()&#8221;, referenced from:<br />
nsHTMLMediaElement::GetMozBytesDownloaded(unsigned int*)in nsHTMLMediaElement.o<br />
ld: symbol(s) not found for architecture x86_64</p>
<p>It&#8217;s gotten pretty late now, so I am going to tackle this in the morning and hopefully I figure it out then.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dseifried.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dseifried.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dseifried.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dseifried.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dseifried.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dseifried.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dseifried.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dseifried.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dseifried.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dseifried.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dseifried.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dseifried.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dseifried.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dseifried.wordpress.com/313/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dseifried.wordpress.com&#038;blog=19041028&#038;post=313&#038;subd=dseifried&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dseifried.wordpress.com/2012/03/14/implementing-video-playback-statistics-in-firefox/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c071ab21e5f797c63058fdf862a5f0f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dseifried</media:title>
		</media:content>
	</item>
	</channel>
</rss>
