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

<channel>
	<title>PRX Labs</title>
	<atom:link href="http://labs.prx.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.prx.org</link>
	<description>Technology and innovation at PRX</description>
	<lastBuildDate>Mon, 07 May 2012 21:29:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>PBS Frontline QR Code Hack</title>
		<link>http://labs.prx.org/2012/05/07/pbs-frontline-qr-code-hack/</link>
		<comments>http://labs.prx.org/2012/05/07/pbs-frontline-qr-code-hack/#comments</comments>
		<pubDate>Mon, 07 May 2012 21:29:35 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Node.js]]></category>

		<guid isPermaLink="false">http://labs.prx.org/?p=553</guid>
		<description><![CDATA[Hey everyone! I recently built a system which was designed to turn your phone into a sort of smart remote control which works over the internet. This is the first part of a two-part post about that system, where I discuss what I built. In a future post, I will discuss how everything was put [...]]]></description>
			<content:encoded><![CDATA[<p>Hey everyone! I recently built a system which was designed to turn your phone into a sort of smart remote control which works over the internet. This is the first part of a two-part post about that system, where I discuss what I built. In a future post, I will discuss how everything was put together from a much more technical side.</p>
<p>A couple of weeks ago, I participated in a hackfest which was thrown by the folks at Frontline. The goal was to spend a few hours putting together a glimpse of the future of documentary storytelling. Four projects came out of the day, but I would like to talk about the project I worked on.</p>
<p>As far as I could tell, I was the only developer resource on the team I was on, which resulted in a bit more focus on the technical aspects of things than is typical. As such, I can tell you that the documentary I worked with was:</p>
<ol>
<li>Already slated to receive some level of interactive work.</li>
<li>About the abuses of our economic system by Wall Street.</li>
<li>A Frontline documentary.</li>
</ol>
<p>There&#8217;s really not much else I could say. I did end up watching the trailer a bunch of times, but even that started blurring, as my primary goal was to get something that sort of worked ready for demo.</p>
<p>The point of all of this context is that it seems very clear to me that this could be used in a variety of situations &#8211; not just those where a documentary is concerned. Anyway, on to the demo.</p>
<p>The first interaction you will have with the system is a QR code, which you are invited to scan with your phone. This QR code points at a mobile-optimized website.</p>
<p><a href="http://labs.prx.org/wp-content/uploads/2012/04/Screen-Shot-2012-04-27-at-1.00.59-PM.png"><img class="size-medium wp-image-554 aligncenter" title="The QR Code" src="http://labs.prx.org/wp-content/uploads/2012/04/Screen-Shot-2012-04-27-at-1.00.59-PM-300x230.png" alt="" width="300" height="230" /></a></p>
<p style="text-align: left;">When the website loads in your mobile browser, the QR code disappears and a video begins playing on your computer. The video on the computer screen is deliberately uncluttered, as the point is to allow you to watch the video in a lean-back manner, with no need to interact with your computer.</p>
<p><a href="http://labs.prx.org/2012/05/07/pbs-frontline-qr-code-hack/device-2012-04-27-130558ggg/" rel="attachment wp-att-556"><img class="size-medium wp-image-556 aligncenter" style="margin-left: 10px;" title="device-2012-04-27-130558ggg" src="http://labs.prx.org/wp-content/uploads/2012/04/device-2012-04-27-130558ggg-200x300.png" alt="" width="200" height="300" /></a></p>
<p style="text-align: left;">In your mobile browser, you are given a big green button which also acts as an indicator for your progress through the film. Pressing the button causes a bookmark to be saved of where you are in the film, including context for the segment you were watching and, in some cases, additional content and research. During our demo, one segment of the film, when bookmarked, provided access to watch additional raw footage.</p>
<p><a href="http://labs.prx.org/2012/05/07/pbs-frontline-qr-code-hack/screen-shot-2012-04-27-at-1-05-06-pm/" rel="attachment wp-att-557"><img class="size-medium wp-image-557 aligncenter" title="Screen Shot 2012-04-27 at 1.05.06 PM" src="http://labs.prx.org/wp-content/uploads/2012/04/Screen-Shot-2012-04-27-at-1.05.06-PM-300x230.png" alt="" width="300" height="230" /></a></p>
<p style="text-align: left;">When the bookmark button is pressed, a small indication is shown on the main screen that the bookmark has been saved.</p>
<p style="text-align: left;">The goal for the project was to provide a way to augment a viewing experience while in no way compromising the narrative created by the filmmaker. There were a number of additional features which I would have loved to have implemented, such as controls for the onscreen content, and a dashboard showing your bookmarks on the main screen when the video has finished. That having been said, I believe that the goals for the project were shown off well, and am proud of what we walked out with.</p>
<p style="text-align: left;">Next time, I&#8217;ll go into the actual guts of how this system worked, and maybe some other uses for the technology.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.prx.org/2012/05/07/pbs-frontline-qr-code-hack/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hacking Open Education with the Berkman Center</title>
		<link>http://labs.prx.org/2012/04/30/hacking-open-education-with-the-berkman-center/</link>
		<comments>http://labs.prx.org/2012/04/30/hacking-open-education-with-the-berkman-center/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 17:06:43 +0000</pubDate>
		<dc:creator>rebecca</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://labs.prx.org/?p=544</guid>
		<description><![CDATA[On April 13th PRX sent me to represent at the Berkman Center Open Education Resources hack day.  The hack day was a one-day event on the final day of a three-day conference about Open Education Resources among the Hewlett OER grantees.  SJ Klein and Erhardt Graeff led a crew of ~60 OER enthusiasts&#8211;perhaps only 10-15% [...]]]></description>
			<content:encoded><![CDATA[<p>On April 13th PRX sent me to represent at the Berkman Center Open Education Resources hack day.  The hack day was a one-day event on the final day of a <a href="http://blogs.law.harvard.edu/oer2012/about/">three-day conference about Open Education Resources</a> among the Hewlett OER grantees.  <a href="http://cyber.law.harvard.edu/node/169">SJ Klein</a> and <a href="http://erhardtgraeff.com/">Erhardt Graeff</a> led a crew of ~60 OER enthusiasts&#8211;perhaps only 10-15% of whom were coders&#8211;through a process of generating and winnowing ideas, planning, execution, and an ultimate two-minute presentation to a panel of judges.  Although I&#8217;m no expert on hackdays, the relatively low ratio of coders seemed notable to me.  It resulted in a selection of hacks that mostly did not involve running code but comprised a set of projects with potential for real future value in the OER community.</p>
<p>SJ and Erhardt divided us into four groups and asked us to winnow the big list of ideas brainstormed the night before down to our top ten, adding any new ones we had on the way.  Once we&#8217;d done this we combined with another group and did another round of winnowing.  Then we joined all together and did two rounds of straw polls on the remaining projects to help us self-select into working teams.  I&#8217;m not sure I can recall every project, but here&#8217;s my best stab:</p>
<p>* Revising the Wikipedia page about OER.</p>
<p>* Designing a Webby- or Oscar-like awards contest for the best OER of the year.</p>
<p>* Designing software to help present a personal gallery/portfolio of OER accomplishments.</p>
<p>* Creating an online course to teach strategic thinking using Poker</p>
<p>* Using git as the basis for a collaborative OER repository</p>
<p>* Creating an open-source web application that works like <a href="http://freerice.com">Free Rice</a> but can be implemented with local standardized test questions and local sponsorships</p>
<p>The open-source Free Rice project was an idea I contributed in the first round.  It&#8217;s an idea that <a href="http://cyber.law.harvard.edu/people/cnesson">my father</a> and I have been interested in for years and it seemed like a good fit for the day.  I was happy to see it progress through the rounds of winnowing.  Ultimately <a href="http://metalab.harvard.edu/people/">Matthew Battles</a> of Metalab and <a href="http://www.maine.gov/tools/whatsnew/index.php?topic=MLTIContact&amp;v=MLTI_IM&amp;id=65271">Jeff Mao</a> of the Maine Department of Education chose to work on it with me.  We spent some time discussing how we could make the project into something that school systems would be able to use and decided that ideally the system would be able to hook into an API provided by the testing company with which a school system contracts.  While Matthew and Jeff worked on ideas about the API and a presentation of the idea, I started to hack.  The time for actual hacking was short: about two and a half hours.  So I was happy to have gotten enough up and running just to do a short demo.  You can see the results of that here: <a href=" http://freepencils.herokuapp.com"> http://freepencils.herokuapp.com</a>.  Jeff and Matthew did an excellent presentation while I clicked around the app on the big screen behind them.  And lo and behold we were selected as winners of the day along with the Academy Awards for OER project.</p>
<p>The hack day organizers are working on a write-up of the day for the conference blog that will give more information about all the projects.  In preparation for that Jeff wrote up a short text version of our pitch.  Here it is:</p>
<p style="padding-left: 30px;">Many states (48 including DC and 2 US Territories) have adopted the Common Core State Standards for English Language Arts and Mathematics. This is the first time in the history of US Public Education that we will see common learning standards across so many States. Part of this effort is the development of a shared assessment platform that seeks to provide an open source adaptive assessment system that will support formative and summative assessment for classroom, school, district, and state-level use.</p>
<div style="padding-left: 30px;"></div>
<div style="padding-left: 30px;">Building upon the success of the World Food Programme&#8217;s <a href="http://freerice.com/" target="_blank">FreeRice.com</a> site, we proposed to build a tool that would mimic the style of FreeRice&#8217;s educational and fundraising process. Answer questions correctly, and earn tokens that would have real-world value toward a local or national good cause. We called our effort &#8220;FreePencils&#8221;, and would use the pencil as a token similar to FreeRice&#8217;s 10 grains of rice per question. The tool would sit between the end user and the Smarter Balanced Assessment Consoritia (SBAC) adaptive testing engine, and use released items shared through that system. Schools would be able to localize this tool so that as students answered questions correctly, they earned pencils. These pencils would have an equivalent real world value based on the school&#8217;s local fundraising efforts. For example, a school could get local sponsorships from families, local business, and others. These funds would be distributed to the school or any identified good cause based on correct answers to actual released items from the SBAC assessment engine. This would provide practice to students and at the same time, provide a method of fundraising.</div>
<div style="padding-left: 30px;"></div>
<div style="padding-left: 30px;">In addition, the tool could be set up at a national level with national sponsorships. Funds from this effort could be directed to a national cause, educational or otherwise.</div>
]]></content:encoded>
			<wfw:commentRss>http://labs.prx.org/2012/04/30/hacking-open-education-with-the-berkman-center/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Announcing PlayerHater. Hate the Player, not the Game.</title>
		<link>http://labs.prx.org/2012/03/27/announcing-playerhater-hate-the-player-not-the-game/</link>
		<comments>http://labs.prx.org/2012/03/27/announcing-playerhater-hate-the-player-not-the-game/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 14:11:33 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://labs.prx.org/?p=490</guid>
		<description><![CDATA[TL; DR: Happy Tuesday! I wrote a library for working with background audio in Android apps. PRX is letting me give it away. Yay Android! Yay PRX! Let&#8217;s talk a little history, shall we? PRX makes mobile apps for public radio programs and stations. When we were asked to make an Android app for This [...]]]></description>
			<content:encoded><![CDATA[<p>TL; DR: Happy Tuesday! I wrote a library for working with background audio in Android apps. <a href="http://prx.org">PRX</a> is letting me <a href="http://github.com/PRX/PlayerHater">give it away</a>. Yay Android! Yay PRX!</p>
<p>Let&#8217;s talk a little history, shall we?</p>
<p>PRX makes mobile <a href="http://apps.prx.org">apps</a> for public radio programs and stations. When we were asked to make an Android app for This American Life, we found that the Android ecosystem was just a little bit fractured. We built a very large and somewhat messy chunk of code to help us work through the issues of supporting 4 different major versions of an operating system, including handling weird and widely covered bugs and device/os interactions.</p>
<p>But no more! We found that by dropping support for the <strong>very very old</strong> versions of Android, we were able to lock into a much more stable API. There&#8217;s still a whole bunch of work that needs to be done in order to start playing audio in the background properly, though (think foreground notifications, the prepare/play api, and handling audio session changes). So I set to work building something completely from scratch which tackles these problems. We even thought long and hard about what should happen if your audio is interrupted with a phone call (we start back up again when you hang up if the call took less than 5 minutes. Otherwise, we kill the session.)</p>
<p>There are a whole bunch of goals for the player moving forward, including a default player widget and notification with play/pause buttons where they&#8217;re supported. For now, we hope that the dramatically simplified API and sensible default behavior will be useful to some people, and we can gain enough traction to make PlayerHater the de-facto way to play background audio on Android.</p>
<p>Check out <a href="http://github.com/PRX/PlayerHater">PlayerHater on GitHub</a> and let us know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.prx.org/2012/03/27/announcing-playerhater-hate-the-player-not-the-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Out with the Flash, in with the flashy</title>
		<link>http://labs.prx.org/2012/03/20/out-with-the-flash-in-with-the-flashy/</link>
		<comments>http://labs.prx.org/2012/03/20/out-with-the-flash-in-with-the-flashy/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 20:26:19 +0000</pubDate>
		<dc:creator>farski</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://labs.prx.org/?p=507</guid>
		<description><![CDATA[FlowPlayer has been PRX&#8217;s audio player of choice (ok, not really a choice) for a very long time. Even without a mobile-specific version of PRX.org, we&#8217;ve seen a dramatic increase in the number of requests for a way to audition pieces on an iPad. It&#8217;s simply a matter of people&#8217;s usage habits changing. While an [...]]]></description>
			<content:encoded><![CDATA[<p>FlowPlayer has been PRX&#8217;s audio player of choice (ok, not really a choice) for a very long time. Even without a mobile-specific version of PRX.org, we&#8217;ve seen a dramatic increase in the number of requests for a way to audition pieces on an iPad. It&#8217;s simply a matter of people&#8217;s usage habits changing. While an HTML5 audio player has been on our radar since browsers began supporting the technology, demand finally reached a point where the transition became necessary.</p>
<p>There are several fairly robust open source projects out there to help with the switch. MediaElement.js and jPlayer were the two main contenders, with jPlayer winning out do to internal familiarity. Both work by having a Flash fallback option when the native HTML5/JavaScript handling in a given browser can support the file. jPlayer allows you to define multiple source files to help with browser coverage. Currently our catalog is mp3, which IE8 (and lower), Firefox, and Opera do not support natively. We would need to re-encode our entire catalog to ogg or WebM to provide native support there, which may happen at some point, but for now relying on the Flash fallback in jPlayer is a perfectly acceptable solution.</p>
<p>One major advantage of having a single player UI and having it built in HTML that will be consistent across all platforms and browsers regardless of what&#8217;s handling the audio is extensibility. Whereas previously we had slightly different Flash widgets for the main player, the popup window player, and the embeddable player, we now need to only maintain a single HTML file. The player is fluid, so it will resize to fit whatever space it is given. Adding additional features or elements to the player down the road will be an extremely simple process.</p>
<p>The move hasn&#8217;t been without issue. jPlayer has a few shortcomings that we&#8217;ve had to work around. The most significant being an issue with the way in which the Flash player reports file duration when the file is loading. It often fails to accurately estimate the total duration before the entire file loads. This can cause some unexpected behavior with large files. It was fairly trivial to work around, but it shows that supporting two vastly different technologies at the same time is not an exact science. There are a handful of finicky UI limitations with jPlayer as well. Want a vertical volume bar? Get ready to fork.</p>
<p>Performance as a whole, though, has been good. Even on some of our playlist pages which load up dozens of individual players, results from our testing has on par with or better than FlowPlayer.</p>
<p>We&#8217;re very excited about the prospects of having this new player out in the wild. Aside from the obvious benefits of iOS support, and the boost in street cred for having using more HTML5, there are likely some advantages we haven&#8217;t even considered yet. PRX hopes to help drive innovation in this space, so expect to see any improvements we make flow back into the community.</p>
<p>Old vs New:</p>
<p><img src="http://labs.prx.org/wp-content/uploads/2012/03/Screen-Shot-2012-03-02-at-4.29.28-PM.png" alt="" width="560" /><br />
<img src="http://labs.prx.org/wp-content/uploads/2012/03/Screen-Shot-2012-03-02-at-4.29.42-PM.png" alt="" width="560" /></p>
<p><strong>Demo</strong></p>
<p><script id='prx-p74200-embed' src='http://www.prx.org/p/74200/embed.js?size=full'></script></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.prx.org/2012/03/20/out-with-the-flash-in-with-the-flashy/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>A graphical pseudo-3D environment in an Android app</title>
		<link>http://labs.prx.org/2012/03/13/a-graphical-pseudo-3d-environment-in-an-android-app/</link>
		<comments>http://labs.prx.org/2012/03/13/a-graphical-pseudo-3d-environment-in-an-android-app/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 16:00:42 +0000</pubDate>
		<dc:creator>rebecca</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://labs.prx.org/?p=493</guid>
		<description><![CDATA[At PRX we&#8217;re lucky to get to work with creative, fun-loving clients who want their apps to be more interesting to play with than the average app made from iOS standard components or Android widgets.  In one app we&#8217;re currently developing, we&#8217;re creating an engaging and fun pop-up book style environment in which the user [...]]]></description>
			<content:encoded><![CDATA[<p>At PRX we&#8217;re lucky to get to work with creative, fun-loving clients who want their apps to be more interesting to play with than the average app made from iOS standard components or Android widgets.  In one app we&#8217;re currently developing, we&#8217;re creating an engaging and fun pop-up book style environment in which the user encounters the program content as she navigates through an imaginary world.  It&#8217;s beautiful and fun and a real programming challenge.  On the iOS side, Devin created the 3D-ish environment using native iOS layers positioned in 3D space.  It&#8217;s my job to create the same effect in the Android version of the app.  The native views in Android don&#8217;t support this kind of positioning in z space and there isn&#8217;t a build in &#8220;camera&#8221; <a href="http://watchingapple.com/2008/04/core-animation-3d-perspective/">that can be transformed to give the illusion of depth</a>.  OpenGL could provide the 3D environment, but it would be a steep learning curve for me and it would make it harder to use the usual Android widgets and activities for performing the basic functions of the app like presenting lists of content and playing audio.  Enter <a href="http://www.andengine.org/">AndEngine</a>.</p>
<p>AndEngine is a free 2D game engine for Android.  It allows the creation of a game activity that I could combine with other Android activities to present content.  (I use <a href="http://developer.android.com/guide/topics/fundamentals/fragments.html">Android Fragments</a> via the <a href="http://developer.android.com/reference/android/support/v4/app/Fragment.html">Android Support V4 library</a> to incorporate traditional Android views into the game environment.)  Although AndEngine is intended for 2D games, a <a href="http://www.andengine.org/forums/tutorials/3d-perspective-tutorial-t1790.html">forum thread</a> demonstrated how to do the same perspective trick to the camera we&#8217;re doing on the iOS side:</p>
<pre class="brush: java; title: ; notranslate"> private void setFrustum(GL10 pGL)
 {
    // set field of view to 60 degrees
   float fov_degrees = 60;
   float fov_radians = fov_degrees / 180 * (float)Math.PI;

   // set aspect ratio and distance of the screen
   float aspect = this.getWidth() / this.getHeight();
   float camZ = this.getHeight()/2 / (float)Math.tan(fov_radians/2);

   // set projection
   GLHelper.setProjectionIdentityMatrix(pGL);
   GLU.gluPerspective(pGL, fov_degrees, aspect, camZ/10, camZ*10);

   // set view
   GLU.gluLookAt(pGL, 0, 0, camZ, 0, 0, 0, 0, 1, 0); // move camera back
   pGL.glScalef(1,-1,1); // reverse y-axis
   pGL.glTranslatef(-CAMERA_WIDTH/2,-CAMERA_HEIGHT/2,0); // origin at top left
}</pre>
<p>What&#8217;s happening here is that the camera is being pulled back away from the scene and a perspective transform is being applied that causes things in the distance to appear farther away.  I can&#8217;t explain it any better than the cryptic m34 transform that is applied to the camera on the iOS side, but the effect is the same.</p>
<p>The only other modification I had to make to AndEngine was to create a 3D sprite class that wraps the provided Sprite class and allows the user to set the z position of sprites as well as their x,y position.  In our app world the user doesn&#8217;t interact directly with the scene but rather with an scrolling mechanism that moves the scene &#8220;on rails&#8221; as the user scrolls.  The effect is beautiful but also somewhat hard to capture in screenshots.  You&#8217;ll just have to buy the app when it comes out!</p>
<p><a href="http://labs.prx.org/2012/03/13/a-graphical-pseudo-3d-environment-in-an-android-app/png/" rel="attachment wp-att-499"><img class="aligncenter size-medium wp-image-499" title="png" src="http://labs.prx.org/wp-content/uploads/2012/03/png-171x300.png" alt="" width="171" height="300" /></a></p>
<p><a href="http://labs.prx.org/2012/03/13/a-graphical-pseudo-3d-environment-in-an-android-app/png-1/" rel="attachment wp-att-496"><img class="aligncenter size-medium wp-image-496" title="png-1" src="http://labs.prx.org/wp-content/uploads/2012/03/png-1-171x300.png" alt="" width="171" height="300" /></a></p>
<p><a href="http://labs.prx.org/2012/03/13/a-graphical-pseudo-3d-environment-in-an-android-app/png-3/" rel="attachment wp-att-498"><img class="aligncenter size-medium wp-image-498" title="png-3" src="http://labs.prx.org/wp-content/uploads/2012/03/png-3-171x300.png" alt="" width="171" height="300" /></a></p>
<p><a href="http://labs.prx.org/2012/03/13/a-graphical-pseudo-3d-environment-in-an-android-app/png-2/" rel="attachment wp-att-497"><img class="aligncenter size-medium wp-image-497" title="png-2" src="http://labs.prx.org/wp-content/uploads/2012/03/png-2-171x300.png" alt="" width="171" height="300" /></a></p>
<div style="clear: both;"></div>
<p>The good news is, the app is shaping up beautifully and AndEngine has really come through for what we needed to do.  But there&#8217;s a big remaining issue that I&#8217;d like to solve.  AndEngine takes care of all of the touches on the scene and passes them to the sprites.  But it does it based on their x,y coordinates.  Unfortunately, the x,y coordinates it calculates based on the touches of the screen do not correspond to the location of the sprites within the scene because of the perspective transformation based on depth.  Under the covers OpenGL knows where the sprites are because it drew them correctly on the screen, but AndEngine itself does not know.  Additionally, I can only get access to a GL10 instance which does not provide the functions I need to project and unproject coordinates.  For now I&#8217;m working around this issue, but theoretically I should be able to do the math to convert 2D screen coordinates into 3D scene coordinates using the ratio of the scene size to the screen size, the position of the camera, the angle of view, and the distance of the object in question from the camera.  So far I haven&#8217;t succeeded in doing it, but when I get a few days to step back from the project I&#8217;ll turn to it again.  If you think you know how it should be done, please comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.prx.org/2012/03/13/a-graphical-pseudo-3d-environment-in-an-android-app/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pledge your support for mobile</title>
		<link>http://labs.prx.org/2012/02/29/pledge-your-support-for-mobile/</link>
		<comments>http://labs.prx.org/2012/02/29/pledge-your-support-for-mobile/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 19:53:30 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://labs.prx.org/?p=479</guid>
		<description><![CDATA[Hi, I wanted to make a quick plug for a session that I&#8217;m organizing at the 2012 Integrated Media Association conference next week. The session is titled: Pledge your support for mobile and it will be both an overview of current pledge/donation practices and also a hands on working session. We&#8217;ll review existing pledge and donation practices, [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>I wanted to make a quick plug for a session that I&#8217;m organizing at the <a href="http://www.integratedmedia.org/conference">2012 Integrated Media Association conference</a> next week. The session is titled: <strong>Pledge your support for mobile</strong> and it will be both an overview of current pledge/donation practices and also a hands on working session. We&#8217;ll review existing pledge and donation practices, what works and where people get hung up and then both the session panelists and attendees will attempt to streamline and significantly improve the pledge process for public radio and television stations.</p>
<p>The major themes for the IMA conference this year are:</p>
<ol>
<li>Motivate attendees to take individual ownership for innovation</li>
<li>Provide the attendees with knowledge that they can take home and use immediately</li>
</ol>
<p>I&#8217;m really excited about our session panelists and facilitators, I&#8217;ve worked with each of them in the past on mobile and tablet projects. <a href="http://www.doormouse.org">Devin Chalmers</a> (<a href="http://musicmine.kcrw.com">KCRW Music Mine</a> iPad, <a href="http://www.radiolab.org">Radiolab</a> iPhone), <a href="http://www.effectiveui.com/">Dan Saltzman from Effective UI</a> (KCRW Music Mine iPad) and <a href="http://www.wnyc.org">Marine Boudeau from New York Public Radio</a> (WNYC, WQXR, Radiolab iPhone and Android). Each has worked outside of public media and has extensive experience in user centered design and interfaces.</p>
<p>I&#8217;m also excited to try out a hybrid session with both a conference panel and then a hands on <a href="http://en.wikipedia.org/wiki/Hackathon">hackathon</a> approach. My hope is that we all learn some new things, then create something new and all leave with actionable steps. This will be a session where attendees will be encouraged to participate, one where we use our collective strengths to improve a process that is ripe for revamp. If you are attending IMA I&#8217;m hoping you can join us.</p>
<p><strong>Our session is on Thursday March 8th starting at 2pm.</strong></p>
<p>I&#8217;ve uploaded my in-progress slides for the session in an attempt to entice people to come checkout our session.</p>
<div id="__ss_11802870" style="width: 450px;"><object id="__sse11802870" width="450" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=ima-mobile-pledge-120229132117-phpapp01&amp;stripped_title=ima-2012-pledge-your-support-for-mobile&amp;userName=neocMatt" /><param name="allowscriptaccess" value="always" /><param name="allowfullscreen" value="true" /><embed id="__sse11802870" width="450" height="355" type="application/x-shockwave-flash" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=ima-mobile-pledge-120229132117-phpapp01&amp;stripped_title=ima-2012-pledge-your-support-for-mobile&amp;userName=neocMatt" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" /></object></div>
]]></content:encoded>
			<wfw:commentRss>http://labs.prx.org/2012/02/29/pledge-your-support-for-mobile/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Benjamen Walker Is Listening</title>
		<link>http://labs.prx.org/2012/01/13/benjamen-walker-is-listening/</link>
		<comments>http://labs.prx.org/2012/01/13/benjamen-walker-is-listening/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 20:10:38 +0000</pubDate>
		<dc:creator>Andrew Kuklewicz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://labs.prx.org/?p=459</guid>
		<description><![CDATA[It&#8217;s his birthday, go leave him a message. If you are too lazy for that link, just call: (877) 815-3013 How does it work? Here is the secret formula: @benjamenwalker + 40 * ( twilio + heroku + three.js + jplayer) = happy birthday I worked on this over the course of a day and [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s his birthday, <a href="http://benjamenwalker.com" target="_blank">go leave him a message</a>.</p>
<p>If you are too lazy for that link, just call: (877) 815-3013</p>
<p>How does it work? Here is the secret formula:</p>
<p><a href="https://twitter.com/#!/BenjamenWalker">@benjamenwalker</a> + <a href="http://en.wikipedia.org/wiki/January_12">40</a>  * ( <a href="http://www.twilio.com/">twilio</a> + <a href="http://www.heroku.com/">heroku</a> + <a href="http://mrdoob.github.com/three.js/">three.js</a>  + <a href="http://jplayer.org/">jplayer</a>) = <a href="http://www.easy-birthday-cakes.com/images/toilet-40th-birthday-cake-21322529.jpg">happy birthday</a></p>
<p>I worked on this over the course of a day and a half; the tools are out there people to make incredible stuff, and fast, even if you are an aging coder like me.  <a href="http://codeyear.com/">Go make something</a>!</p>
<p>(I also got some design inspiration from <a href="http://loveandradio.org/">@loveandradio</a>, but I lined everything up on the other side of the screen, so it is <b>completely different</b>.  Also, I&#8217;ve only seen Nick&#8217;s head spin around like that when I got a concussion.)</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.prx.org/2012/01/13/benjamen-walker-is-listening/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook Open Graph and Public Radio</title>
		<link>http://labs.prx.org/2011/09/24/facebook-open-graph-and-public-radio/</link>
		<comments>http://labs.prx.org/2011/09/24/facebook-open-graph-and-public-radio/#comments</comments>
		<pubDate>Sat, 24 Sep 2011 17:09:44 +0000</pubDate>
		<dc:creator>Andrew Kuklewicz</dc:creator>
				<category><![CDATA[Big Data]]></category>
		<category><![CDATA[Social Media]]></category>

		<guid isPermaLink="false">http://labs.prx.org/?p=419</guid>
		<description><![CDATA[Watch what you&#8217;re doing Love it or mock it, Facebook&#8217;s on to something with the latest beta features for Open Graph. I&#8217;m not saying they are the first to realize there is more to the world than liking, as scrobbling on last.fm has been going on for awhile, and we even worked with Doc Searls [...]]]></description>
			<content:encoded><![CDATA[<h3>Watch what you&#8217;re doing</h3>
<p>Love it or mock it, <a href="https://developers.facebook.com/docs/beta/" target="_blank">Facebook&#8217;s on to something with the latest beta features for Open Graph</a>.  I&#8217;m not saying they are the first to realize there is more to the world than liking, as <a href="http://www.last.fm/help/faq?category=Scrobbling" target="_blank">scrobbling on last.fm</a> has been going on for awhile, and we even worked with Doc Searls to do <a href="http://cyber.law.harvard.edu/projectvrm/ListenLog" target="_blank">listen log</a>, which has the added (and hopefully inevitable) twist that you own your own data about what you hear/read/like/hate.  Imagine that, not just giving that kind of useful, private information away to some company?  But I digress.</p>
<p>Many have seen the writing on the wall that personal analytics (i.e. my latest favorite is <a href="http://runkeeper.com/" target="_blank">RunKeeper</a>) is a natural outcome (or accomplice) of the  big data and social networking trends, but Facebook is in a position to take it to 11.  Not to mention they have real motivation, with the competition at google+ looking for a differentiator or twenty.  I embrace personal analytics as providing a new perspective on one&#8217;s self, and a way to know each other better.</p>
<p>In public media, during pledge drives, stations often ask listeners to imagine how many hours they listen in a year, and what value that has to them. Why imagine or guess at that when we can actually answer the question with data?</p>
<blockquote><p><a href="http://cyber.law.harvard.edu/projectvrm/ListenLog">&#8220;With ListenLog data, listeners can make fully informed choices about how they support streams, podcasts and on-demand sources of programming.&#8221;</a></p></blockquote>
<p>&#8230;and that is every bit as true for what Facebook wants to start logging.  I don&#8217;t know who&#8217;s version of media logging will &#8216;win&#8217;, and as we&#8217;ve learned from friendster and myspace, winning is not a permanent condition, but the concept is powerful, and the potential effect on our behavior profound.  Or at least, I hope it is.  I also hope to find a way to have my cake and eat it too; own my data, but share intentionally.  Facebook may not be there yet (not extreme understatement), but it can&#8217;t be ignored in the meantime.</p>
<h3>And now what?</h3>
<p>For listeners to public radio, what we listen to is as much a part of our lives as the TV and movies we watch, the music we hear, and the books we read.  No one is forcing anyone to log this stuff, but if someone should want to, be it for their own curiosity, what it says about them, or just amusement, we should make sharing this easy, and as complete as other commercial media.  In fact, we should do better &ndash; folks should be proud to share public media, and lead others to that experience as well.  </p>
<p>While I have focused so far on media logging, we have another action besides &#8216;listen&#8217; that we want to encourage and shout from the pixelated rooftops: &#8216;support&#8217;.  I want to see that early and often, whether it is supporting a broadcast, stream, program, episode, network, host or even <a href="http://spot.us/" target="blank">a program that hasn&#8217;t been made yet</a>.</p>
<h3>Brass tacks</h3>
<p>I can&#8217;t write a labs blog without getting to something more technical, they&#8217;ll take away my public keys.</p>
<p>Here&#8217;s some ideas I think come next, and I hope others in public media think and will do the same. Hopefully we can even agree and work together (it has been known to happen):</p>
<ol>
<li>There are movie, video and TV <a href="http://developers.facebook.com/docs/beta/opengraph/objects/builtin/", target="_blank">action and object types already defined<a/>.  I think these should be adopted by public/community TV, with perhaps some embroidery over time.  As they say, &#8220;adopt and extend&#8221;, not analysis seems like the way to go.</li>
<li>Audio is lacking standard definition of simple actions (e.g. listen), though for video/TV <a href="http://developers.facebook.com/docs/beta/opengraph/actions/builtin/" target="_blank">there is a built-in &#8216;watch&#8217; action defined</a> that is a good basis. We also need to define action types for public media (e.g. &#8216;support&#8217; leaps to mind).</li>
<li>We also need to define audio media objects for radio programs, episodes, stories, segments, streams, and podcasts.  Probably others have started to do this as well in their facebook apps, but wouldn&#8217;t be nice if at least in public media we could agree? Audio is where we need to do work; news stories (e.g. Articles) and video/TV are <a href="http://developers.facebook.com/docs/beta/opengraph/objects/builtin/", target="_blank">pretty well covered in the built-in object types.</a></li>
<li>With these standard objects and actions, then we need to make this easy to log.  That means adding this to however users listen.  For PRX, that means integrating optional Facebook open graph listen logging to our station and program mobile <a href="http://apps.prx.org" target="_blank">apps</a> and the <a href="http://apps.prx.org/our-apps/public-radio-player/" target="_blank">Public Radio Player</a>, and websites like <a href="http://www.prx.org" target="_blank">prx.org</a>.</li>
<li>We also need to make it easier for station websites to log this listening activity, just as they do facebook and other kinds of sharing now.  Integrating listen logging into the media players via open source drupal and wordpress plugins seems to be the easiest way to do that, since between those two you seen a majority of new work, especially with the drupal work by NPR on <a href="http://core.digitalservices.npr.org/">Core Publisher</a>, PBS on <a href="http://www.pbs.org/services/open/applications/bento/">bento</a>, APM using Drupal for the new Marketplace site, and PRI shows like <a href="http://ttbook.org/">To The Best Of Our Knowledge</a> developing their new site on drupal with a talented team at <a href="http://wpr.org/" target="_blank">Wisconsin Public Radio</a>.  And that&#8217;s just to name a few.  Figure out how to integrate with these drupal distros, and you get a big bang for your buck.</li>
<li><a href="http://www.integratedmedia.org/" target="_blank">IMA</a> launched <a href="http://publicmediametrics.org/">Public Media Metrics</a> to combine traffic data from all public media websites.  This worked because we all have learned to share, and when we all use Google Analytics, it is comparing apples to apples.  If we can standardize on the actions and objects used in Facebook&#8217;s open graph, not only is it less confusing, but there is a similar opportunity for aggregating social media metrics.</li>
</ol>
<p>Some commercial and start-up media companies already have a jump on us with integrating these facebook beta features, and that&#8217;s fine, but let&#8217;s not wait too long to catch up and exceed them.  Our capacity or cooperation also means we have a unique chance to combine our efforts across public media for design, implementation and measurement. We have millions of listeners and viewers; we should let them prove it.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.prx.org/2011/09/24/facebook-open-graph-and-public-radio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploring The Depths Of KCRW Music Mine: Part One</title>
		<link>http://labs.prx.org/2011/09/19/exploring-the-depths-of-kcrw-music-mine-part-one/</link>
		<comments>http://labs.prx.org/2011/09/19/exploring-the-depths-of-kcrw-music-mine-part-one/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 21:28:47 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[iPad]]></category>
		<category><![CDATA[KCRW]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://labs.prx.org/?p=394</guid>
		<description><![CDATA[KCRW Music Mine launched recently to rave reviews. The free iPad app is the result of a collaboration between KCRW, RoundArch and PRX, which led the project and development efforts. Music Mine pushes the limits of the tablet platform to create a truly unique music discovery experience. Daniel Gross interviews Matt MacDonald, PRX’s Director of Project Management, [...]]]></description>
			<content:encoded><![CDATA[<p><em><a href="http://www.kcrw.com/about/musicmine-for-ipad">KCRW Music Mine</a> launched recently to rave reviews. The free iPad app is the result of a collaboration between <a href="http://www.kcrw.com">KCRW</a>, <a href="http://www.roundarch.com">RoundArch</a> and <a href="http://www.prx.org">PRX</a>, which led the project and development efforts. Music Mine pushes the limits of the tablet platform to create a truly unique music discovery experience. Daniel Gross interviews <a href="http://www.prx.org/users/30890-mattmac">Matt MacDonald, PRX’s Director of Project Management</a>, about the app.</em></p>
<h3>What can Music Mine do?</h3>
<p>The app is a iPad music player that opens up to a grid of 100 songs from artists that played on KCRW shows in the last week. What the app does is highlight these tracks that have been hand-picked by a KCRW DJ who wanted you to hear it. You might find odd pairings, maybe TV on the Radio right next to the newest Jeff Bridges country song. What they have in common is that these are all great songs that were picked by humans with taste and a point of view, not selected by an algorithm. The app lets you explore each of these artists in greater depth and we use software to add supporting songs, videos, photos, bios and blog posts.</p>
<h3>How did it all get started?</h3>
<p>We started talking with KCRW in the summer of 2010 about building an iPad app. PRX has been doing iOS development since late 2008 with apps including the <a href="http://apps.prx.org/our-apps/public-radio-player/">Public Radio Player for iPhone</a> and <a href="http://apps.prx.org/our-apps/this-american-life/">This American Life app for iPhone, iPad and Android</a>. So we knew we could make this project ambitious.</p>
<p>As a public radio station, KCRW produces a ton of content. But we wanted to build an app tightly focused on their music. Anil Dewan at KCRW helped us understand their online music identity. But given the existing competition facing KCRW and listening platforms, we were asking: how the heck do we stand out and differentiate ourselves?</p>
<h3>And? What makes Music Mine so different from other apps?</h3>
<p>The biggest difference is Music Mine’s human touch. Other music apps like Pandora, Discover, Spotify or Last.fm are designed to provide access to every song and every artist in their huge catalogs. When you’re listening to Wilco, say, those apps use an algorithm to automatically recommend the next 5 or 6 &#8216;related&#8217; artists. KCRW has a huge and diverse catalog but we wanted to amplify and highlight the work that the DJs do by narrowing what you should be listening to.</p>
<p>The user interactions in the app have an attitude and a point of view like the KCRW DJs. One goal for us was to encourage, musical exploration and delight so some of our interaction decisions basically force you to try out music that you might not be familiar with. We made sure to encourage that by not adding features like search or sorting and filtering tools. We also could have directly presented the underlying ordered list that backs the grid layout but we felt that doing so would have made you less likely to try out new songs and that you might only search and tap those you know.</p>
<h3>So you want an app with people behind it – but you still want to take advantage of technology, right? What do you need to do that?</h3>
<p>Yep, we definitely want to use technology to help us out here. Our office is in Harvard Square, and the local tech scene here is pretty amazing. One of the companies we’d wanted to work with for a long time was <a href="http://the.echonest.com">The Echo Nest</a> over in Somerville. When we started dreaming up the Music Mine idea we went straight to them.</p>
<p><a href="http://developer.echonest.com/">The Echo Nest provides APIs</a> that allow us to request a ton of information about artists and songs, found audio, video, relevant blog posts, bios and photos. We knew that merging the KCRW playlists with Echo Nest data sources would give us the ability to create a unique window into the KCRW music universe. Rebecca Nesson here at PRX led the effort to merge the data sources from KCRW and Echo Nest. While each of the songs available in the grid is initially picked by a human, PRX wrote software to help narrow down the thousands of tracks that could be available to the 100 available on the grid.</p>
<h3>How did the project evolve as you built and rebuilt the product?</h3>
<p>A big question early in the project was: should the primary experience for how people listen in the app be focused on the long, multi-hour DJ sets, or center on playback of individual tracks? PRX and <a href="http://www.roundarch.com">RoundArch</a> interviewed people specifically about what they might want in a music discovery app from KCRW and after hearing from them we decided to focus the experience on track-by-track selection. That decision proved challenging and mid-way through the project there was a point where we really had to consider ditching the track-by-track access and move back to a DJ set focused app.</p>
<p>The sub-views in the app like the artist photo, song, video, bio, blog pages came together pretty quickly and didn’t change much over the project but the home view, the grid, was definitely an area where we iterated on ideas for a long time. Yeah &#8212; that took a really long time. We might have had 8 or 10 significant tweaks to the layout and presentation. But I think all the time we spent iterating on the ideas really paid off in the execution.</p>
<div class="wp-caption aligncenter" style="width: 310px"><a href="http://labs.prx.org/wp-content/uploads/2011/09/music-mine-grid-03.png"><img class="size-medium wp-image-397  " title="music-mine-grid-03" src="http://labs.prx.org/wp-content/uploads/2011/09/music-mine-grid-03-300x225.png" alt="" width="300" height="225" /></a></dt>
</dl>
<div class="mceTemp mceIEcenter">
<dl id="attachment_399" class="wp-caption aligncenter" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://labs.prx.org/wp-content/uploads/2011/09/music-mine-grid-01.png"><img class="size-medium wp-image-399" title="music-mine-grid-01" src="http://labs.prx.org/wp-content/uploads/2011/09/music-mine-grid-01-300x225.png" alt="" width="300" height="225" /></a><p class="wp-caption-text">Alternate DJ set focused home view</p></div>
<dl id="attachment_397" class="wp-caption aligncenter" style="width: 310px;">
<dt class="wp-caption-dt"></dt>
<dd class="wp-caption-dd">Early DJ focused home view</dd>
</dl>
</div>
<div>
<h3 id="internal-source-marker_0.506858385168016" dir="ltr"></h3>
<div id="attachment_402" class="wp-caption aligncenter" style="width: 310px"><a href="http://labs.prx.org/wp-content/uploads/2011/09/music-mine-grid-00.png"><img class="size-medium wp-image-402" title="music-mine-grid-00" src="http://labs.prx.org/wp-content/uploads/2011/09/music-mine-grid-00-300x225.png" alt="" width="300" height="225" /></a><p class="wp-caption-text">Initial grid comp</p></div>
<div id="attachment_403" class="wp-caption aligncenter" style="width: 310px"><a href="http://labs.prx.org/wp-content/uploads/2011/09/music-mine-grid-final.jpg"><img class="size-medium wp-image-403" title="music-mine-grid-final" src="http://labs.prx.org/wp-content/uploads/2011/09/music-mine-grid-final-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Final grid design.</p></div>
<h3 dir="ltr"></h3>
<h3 dir="ltr">How do you feel about it? Is there anything you&#8217;d improve or add?</h3>
<p>Well&#8230;no. Actually, I&#8217;m really happy with it. I just re-read the original product vision and I think we&#8217;ve really held true to that over the last ten or so months.</p>
<blockquote>
<p dir="ltr"><em>The KCRW iPad Experience project will focus on creating an iPad experience that quickly engages target users by leveraging KCRW’s unique style, taste and hand picked music. In addition, tight conceptual focus and appealing interaction models will aid in driving long-term user engagement.</em></p>
</blockquote>
<p>People that we interviewed about what they might want in an music discovery app said they wanted us to make good music important to them, help them find new good music and improve their awareness. We&#8217;ve done that. People wanted us to connect them with great new artists, and help them learn more about music and artists they&#8217;re already familiar with. I think we&#8217;ve done that too.</p>
<h3 dir="ltr">What&#8217;s next from the PRX team?</h3>
<p>I’m really excited about an iPhone project that we’re working on with a very popular public radio show. I feel like we’re developing a unique way to help people interact and connect with the show. We’re pushing the device’s capabilities, coming up with new interactions that can surprise and delight people.</p>
<h3 dir="ltr">Any last thoughts?</h3>
<p>People talk about software as engineering, and it&#8217;s partially that, but it&#8217;s also a craft. This kind of work is like building a beautiful piece of furniture. When it&#8217;s done poorly, you end up with a cheap nothing that you throw away. But when it&#8217;s done well, you’ll never see all the work that went into it. Sometimes that means a lack of appreciation for the thought and care that was put in.</p>
<p><a href="http://doormouse.org/">Devin Chalmers</a>, <a href="http://www.eecs.harvard.edu/~nesson/">Rebecca Nesson</a> and <a href="http://www.prx.org/users/25617-akuklewicz">Andrew Kuklewicz</a> are top-notch developers, maybe the best people I&#8217;ve ever worked with. But even with the best people working together, it requires time and freedom to explore and do it right. We could have finished a long time ago if we&#8217;d done it poorly. Instead, we came up with something that we’re proud of, KCRW is happy with, and it seems so are the people using it.</p>
<h3>Part Two</h3>
<p>Coming up: Rebecca Nesson and Devin Chalmers will be digging into other more technical aspects of the KCRW Music Mine app, perspective transformations on scroll views, knob-twiddly stuff to tweak behavior and how we had to figure out layouts of a 4&#215;6 grid in both portrait and landscape modes.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://labs.prx.org/2011/09/19/exploring-the-depths-of-kcrw-music-mine-part-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Our Experience with Chef</title>
		<link>http://labs.prx.org/2011/07/05/our-experience-with-chef/</link>
		<comments>http://labs.prx.org/2011/07/05/our-experience-with-chef/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 19:32:34 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://labs.prx.org/?p=336</guid>
		<description><![CDATA[Part of the rollout for some automation features we have been working on is a requirement that we have a very scalable set of FTP servers. We&#8217;ve been using Amazon Web Services for many things at PRX, and the ability to spin up very cheap instances on both sides of the country is a huge [...]]]></description>
			<content:encoded><![CDATA[<p>Part of the rollout for some automation features we have been working on is a requirement that we have a very scalable set of FTP servers. We&#8217;ve been using Amazon Web Services for many things at PRX, and the ability to spin up very cheap instances on both sides of the country is a huge win for performance and reliability. Unfortunately, there&#8217;s a fair amount of work that needs to be done when a new server is spun up. Because the specifics of this work changes with some frequency and because we have a number of different kinds of servers we need to be able to spin up (and more are coming), the standard use of AMIs will be a nightmare to maintain.</p>
<p>Enter <a href="http://www.opscode.com/chef/">Chef</a>.</p>
<p>Chef allows us to develop (in source control) a system which describes both a particular configuration we would like our servers to have, and how to achieve this configuration. The configuration files are implemented in ruby, so the learning curve is primarily around nomenclature (and there&#8217;s a whole lot of it to learn). That having been said, most of the new concepts introduced by chef make sense once the system at large, &#8220;clicks.&#8221; I don&#8217;t expect a blog post to explain all of the nuance of an infrastructure configuration framework, but I think I can give enough introduction that one can walk away confident in their ability to do some simple deployments.</p>
<h3>Clients and Servers</h3>
<div id="attachment_346" class="wp-caption alignright" style="width: 310px"><a rel="attachment wp-att-346" href="http://labs.prx.org/2011/07/05/our-experience-with-chef/chef-setup/"><img class="size-medium wp-image-346" title="Chef Setup" src="http://labs.prx.org/wp-content/uploads/2011/07/Chef-Setup-300x236.png" alt="An Example Chef Deployment" width="300" height="236" /></a><p class="wp-caption-text">An Example Chef Deployment</p></div>
<p>The first thing one needs to learn about Chef is the notion of a <strong>server</strong> and a <strong>client</strong>. A chef server holds information about the chef clients<sup><a href="http://labs.prx.org/2011/07/05/our-experience-with-chef/#footnote_0_336" id="identifier_0_336" class="footnote-link footnote-identifier-link" title="This is not strictly true &amp;#8211; chef makes a distinction between clients and nodes; the former being something which interacts with the chef server and the latter being something which is assigned a set of code to execute. In nearly every case, however, the two are interchangeable. Just remember that when you assign something a role or recipe, you are assigning a node, and when you download updated configuration details from the chef server, you are using a client.">1</a></sup> in your deployment environment and what configuration they should have in order to be considered set up. It also stores the code you have written so that clients can achieve the expected configuration, but it never executes it. A chef server can be thought of, in simple terms, as a database.</p>
<p>One can install the server themselves, or can opt to use the Opscode platform, which is free for smaller deployments.</p>
<p>Clients pull down information about how they are expected to configure themselves from the chef server, and then execute the code you have written to get to that point. They do this by manually or periodically running <code>chef-client</code>, which reads from the chef server what code it will execute, then downloads and executes it.</p>
<h3>Cookbooks and Recipes</h3>
<p>The ruby code stored on a chef server is grouped into files called <strong>recipes</strong>, and those recipes are grouped into directories called <strong>cookbooks</strong>. Usually, cookbooks are collections of recipes that relate to a specific software package. For instance, one might write a cookbook for the <a href="http://httpd.apache.org/">Apache web server</a> that included a recipe for the web server itself, a recipe for <a href="http://www.modssl.org/">mod_ssl</a>, and a recipe for <a href="http://www.webdav.org/mod_dav/">mod_dav</a>.</p>
<p>Many cookbooks (and, by extension, many many recipes), are available on the <a href="http://community.opscode.com/cookbooks">opscode community website</a>. If you see one you would like to install, you can use the <code>knife cookbook site install &lt;cookbook name&gt;</code> command. Recently, Opscode did a major overhaul and made sure that many of these cookbooks are in working order. Please be aware, however, that many of them were written months or years ago, and may require some tweaking, especially if the software package they work with changes often.</p>
<h3>Run Lists and Roles</h3>
<p>Another construct to be aware of is the, <strong>run list</strong>. These are usually recipes, listed in order, that should be executed by the client every time it pulls information down from the chef server. Chef also supports <strong>roles</strong>, which are run lists in their own right, but can be referenced in other roles and run lists. In our current deployment system, we have a few roles which each contain several recipes, and each Chef client is configured to have only one or two roles in its run list.</p>
<h3>Starting a Chef-Managed Instance</h3>
<p>The typical workflow for starting a new instance is to spin one up, install chef, register it as a client with your chef server, add things to the client&#8217;s run list on the chef server, and then run <code>chef-client</code> to pull down the run list and execute it. Quite a mouthful!</p>
<p>Thankfully, in practice, this can easily be rolled up into one step. Because we are making use of Amazon EC2 at PRX, we installed the <code>knife-ec2</code> gem and we can run <code>knife ec2 server create -r "run list"</code>. This spins up an ec2 instance, bootstraps chef, registers it as a client with the chef server, and sets the run list appropriately. It also runs <code>chef-client</code> automatically when everything is set up, so one should have a new EC2 instance with all of the software one wants installed and configured.</p>
<h3>Wrapping Up</h3>
<p>We&#8217;ve covered the actual steps involved in using a configured chef server to deploy new EC2 instances, but we haven&#8217;t touched on how to actually configure the server. For that, I will refer you to the fantastic <a href="http://wiki.opscode.com/display/chef/Chef+Repository">Chef Repo article on the Opscode Wiki</a>, which will explain the directory structure and basic workings of the repository you will use to interact with the chef server.</p>
<p>I found much of the language involved in learning the chef framework confusing when I was learning it, and I hope that this article serves to make the more fundamental concepts that are needed a little easier to understand.</p>
<ol class="footnotes"><li id="footnote_0_336" class="footnote">This is not strictly true &#8211; chef makes a distinction between <strong>clients</strong> and <strong>nodes</strong>; the former being something which interacts with the chef server and the latter being something which is assigned a set of code to execute. In nearly every case, however, the two are interchangeable. Just remember that when you assign something a role or recipe, you are assigning a <strong>node</strong>, and when you download updated configuration details from the chef server, you are using a <strong>client</strong>.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://labs.prx.org/2011/07/05/our-experience-with-chef/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

