<?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>10flow</title>
	<atom:link href="http://www.10flow.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.10flow.com</link>
	<description>the personal blog of Scott Sawyer</description>
	<lastBuildDate>Thu, 09 May 2013 13:47:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Town-Wide Garage Sale Web App</title>
		<link>http://www.10flow.com/2013/04/08/town-wide-garage-sale-web-app/</link>
		<comments>http://www.10flow.com/2013/04/08/town-wide-garage-sale-web-app/#comments</comments>
		<pubDate>Tue, 09 Apr 2013 00:18:07 +0000</pubDate>
		<dc:creator>Scott Sawyer</dc:creator>
				<category><![CDATA[Posts]]></category>

		<guid isPermaLink="false">http://www.10flow.com/?p=242</guid>
		<description><![CDATA[The Borough of Madison, NJ organized a town-wide garage sale to benefit Union Beach, a community hit hard by Hurricane Sandy. I added a feature to their website, so residents can register their sale and (pending a quick review by &#8230; <a href="http://www.10flow.com/2013/04/08/town-wide-garage-sale-web-app/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The <a href="http://www.rosenet.org" target="_blank">Borough of Madison, NJ</a> organized a town-wide garage sale to benefit Union Beach, a community hit hard by Hurricane Sandy. I added a feature to their website, so residents can register their sale and (pending a quick review by a website administrator) have it placed on a map of Madison. <a href="http://www.rosenet.org/content/garage_sale_map" target="_blank">Check out the map here!</a></p>
<div class="figure"><a href="http://www.rosenet.org/content/garage_sale_map" target="_blank"><img src="http://www.10flow.com/wp-content/uploads/2013/04/garagesale.png" alt="Madison Garage Sale Map" title="Madison Garage Sale Map" width="464" height="168" class="alignnone size-full wp-image-243" /></a>
<p>Screenshot of Madison&#8217;s town-wide garage sale map mashup</p>
</div>
<p>I built the town&#8217;s extensible content management system starting in 2008, working closely with Jim Sanderson, Madison&#8217;s technology directory. The history of &#8220;RoseNet&#8221; (named for Madison&#8217;s &#8220;Rose City&#8221; moniker), one of the first community websites, dates back to 1997. It has gradually grown to include more and more content and interactive features. I haven&#8217;t seen any other municipal websites that come close in terms of quantity and quality of data. For example, Jim has invited all local businesses and non-profit organizations to have a self-maintained presence on the website, and <a href="http://www.rosenet.org/businesses" target="_blank">this cool business map</a> is a fun way to promote Madison&#8217;s downtown merchants. The local business listings provide a helpful service to residents and help boost revenue by promoting the business district in the face of competition from internet and big box retailers. There is, of course, room for improvement (we&#8217;re constantly debating the home page and navigation), but the site has proven to be a very effective communication medium for the town.</p>
<p>The garage sale registration process highlights a flexible workflow capability that will help the municipal government streamline many forms and processes. Plus, thanks to years of careful design and execution, Jim and I were able to deploy this feature with minimal cost and lead time.</p>
<p>I think we&#8217;ve really stumbled onto a great architecture for a civic website. I&#8217;d love to turn the design into an open source project. Recently, I&#8217;ve heard a lot about civic code volunteering and startups (like the <a href="http://codeforamerica.org/" target="_blank">Code for America</a> project), and I think that&#8217;s really great. Even though Madison is a small town, I think we&#8217;re out in front in terms of designing an effective municipal content management system. Drop me a line [<a href="http://www.twitter.com/10flow" target="_blank">Twitter</a>, <a href="https://plus.google.com/103311770895608986060" target="_blank">Google Plus</a>, or just leave a comment below] if you&#8217;re interested in collaborating.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.10flow.com/2013/04/08/town-wide-garage-sale-web-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Battery Life and Charge Cycles</title>
		<link>http://www.10flow.com/2013/04/03/battery-life-and-charge-cycle/</link>
		<comments>http://www.10flow.com/2013/04/03/battery-life-and-charge-cycle/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 01:39:05 +0000</pubDate>
		<dc:creator>Scott Sawyer</dc:creator>
				<category><![CDATA[Posts]]></category>

		<guid isPermaLink="false">http://www.10flow.com/?p=234</guid>
		<description><![CDATA[There are two camps on how to best protect the capacity of your cell phone battery: charge it when it&#8217;s dead, or charge it every night. I&#8217;ve heard older NiCd battery technology should be deep cycled to avoid the old &#8230; <a href="http://www.10flow.com/2013/04/03/battery-life-and-charge-cycle/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>There are two camps on how to best protect the capacity of your cell phone battery: charge it when it&#8217;s dead, or charge it every night.</p>
<p>I&#8217;ve heard older NiCd battery technology should be deep cycled to avoid the old “memory effect”, but our phones, tablets and laptops all have newer lithium-based batteries. The conventional knowledge seems to be that completely discharging a lithium battery permanently degrades its lifespan. But I haven&#8217;t found a definitive source on how to best care for my battery.</p>
<p>As an iPhone user, I thought I&#8217;d check with Apple first. For maximizing battery lifespan, <a href="http://www.apple.com/batteries/iphone.html" target="_blank">their website suggests</a> keeping your phone at the right temperature and adjusting your settings to use your battery less. They don&#8217;t offer any specific recommendation on deep vs. shallow charge cycling, but they do suggest going through at least one complete charge cycle (charging the battery to 100% and then completely running it down) per month. That seemed like an oddly specific recommendation with no data to back it up.</p>
<h2>Checking the Literature</h2>
<p>I decided to see what the scientific literature had to say about this. Here&#8217;s what I learned:</p>
<p><strong>Measuring Battery Performance:</strong> When evaluating any kind of performance, engineers need a metric. The standard lifespan metric seems to be “number of charging cycles through which the battery can retain 80% of its original capacity”. For example, Apple promises 400 charging cycles for your iPhone battery.</p>
<p><strong>Temperature:</strong> I found an <a href="http://www.sciencedirect.com/science/article/pii/S0378775305000832" target="_blank">interesting paper</a> (behind a paywall, unfortunately) on the aging mechanisms of lithium ion batteries. Sure enough, there&#8217;s good science verifying that temperature plays a big role in battery lifespan. Most batteries are designed to operate at room temperature, and both hot <em>and</em> cold temperatures accelerate aging. They also note that battery capacity will fade over time regardless of your usage habits because the chemicals simply break down.</p>
<p><strong>Shallow cycling:</strong> The best research I could find comparing deep and shallow cycling was <a href="http://drum.lib.umd.edu/bitstream/1903/12381/1/Williard_umd_0117N_12841.pdf" target="_blank">Nicholas Williard&#8217;s master&#8217;s thesis from the University of Maryland</a>. He experimented with a particular make and model of lithium ion batteries. He preconditioned a fraction of these batteries by shallow cycling them 900 times (draining just 7% of charge before recharging). Amazingly, he found the preconditioned (i.e., shallow-cycled) batteries were able to withstand about the same number of deep cycles as brand new batteries. In other words, shallow cycling didn&#8217;t seem to degrade battery capacity at all!</p>
<h2>My conclusions:</h2>
<ul>
<li>Keep your battery cool (but not cold).</li>
<li>Shallow cycling is OK (go ahead and charge every night&#8230; or even more often).</li>
<li>I couldn&#8217;t find any research backing up Apple&#8217;s “monthly deep cycle” recommendation.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.10flow.com/2013/04/03/battery-life-and-charge-cycle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Curiosity at 120 Volts</title>
		<link>http://www.10flow.com/2013/02/19/curiosity-at-120-volts/</link>
		<comments>http://www.10flow.com/2013/02/19/curiosity-at-120-volts/#comments</comments>
		<pubDate>Wed, 20 Feb 2013 02:52:36 +0000</pubDate>
		<dc:creator>Scott Sawyer</dc:creator>
				<category><![CDATA[Posts]]></category>

		<guid isPermaLink="false">http://www.10flow.com/?p=218</guid>
		<description><![CDATA[Have you ever wondered what would happen if you plug an old iPhone charger half-way into the wall and then short the power prongs with the 30-pin connector? My seven year-old nephew did. Not surprisingly, iPhone chargers don&#8217;t handle 15-amp &#8230; <a href="http://www.10flow.com/2013/02/19/curiosity-at-120-volts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Have you ever wondered what would happen if you plug an old iPhone charger half-way into the wall and then short the power prongs with the 30-pin connector? My seven year-old nephew did.</p>
<div class="figure"><a href="http://www.10flow.com/wp-content/uploads/2013/02/charger1_464.jpg"><img src="http://www.10flow.com/wp-content/uploads/2013/02/charger1_464.jpg" alt="shorted iPhone charger" title="charger1_464" width="464" height="309" class="alignnone size-full wp-image-219" /></a>
<p>Not surprisingly, <b>iPhone chargers</b> don&#8217;t handle 15-amp short circuits very well.</p>
</div>
<p>The metal shielding of the 30-pin connector completed shorted the 120 V A/C  power prongs. My nephew reports seeing a large spark, hearing a pop, and then witnessing a bit of smoke and funny smell. Fortunately, the 15-amp circuit breaker tripped almost immediately, preventing him from getting shocked and probably stopping a house fire.</p>
<p>In the picture below, you can see the power prongs melted a bit, and there&#8217;s a coating of black soot all over the charger (the wall was dirty, too, I&#8217;m told).</p>
<div class="figure-box">
<a href="http://www.10flow.com/wp-content/uploads/2013/02/charger2_750.jpg"><img src="http://www.10flow.com/wp-content/uploads/2013/02/charger2_750.jpg" alt="another look at the fried iPhone charger" title="charger2_750" width="750" height="350" class="alignnone size-full wp-image-220" /></a>
<p><b>Lesson learned?</b> We sure hope so!</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.10flow.com/2013/02/19/curiosity-at-120-volts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Analyze the Play-by-Play Data</title>
		<link>http://www.10flow.com/2013/01/26/how-to-analyze-the-play-by-play-data/</link>
		<comments>http://www.10flow.com/2013/01/26/how-to-analyze-the-play-by-play-data/#comments</comments>
		<pubDate>Sat, 26 Jan 2013 21:19:21 +0000</pubDate>
		<dc:creator>Scott Sawyer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[football]]></category>

		<guid isPermaLink="false">http://www.10flow.com/?p=207</guid>
		<description><![CDATA[Interested in analyzing the play-by-play football stats? I pushed some code to GitHub to help you parse the plays and output them to your choice of CSV (for use in a spreadsheet), JSON, or a SQL database. You can check &#8230; <a href="http://www.10flow.com/2013/01/26/how-to-analyze-the-play-by-play-data/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Interested in analyzing the play-by-play football stats? I pushed some code to GitHub to help you parse the plays and output them to your choice of CSV (for use in a spreadsheet), JSON, or a SQL database. <a href="https://github.com/10flow/playbyplay" target="_blank">You can check out the code (and a brief README) here</a>. The repository also contains all the source code of my <a href="http://football.10flow.com" target="_blank">play-by-play effectiveness webapp</a>.</p>
<h2>How to Parse Plays to CSV</h2>
<p>If you don&#8217;t need the data in a SQL database, you can quickly parse the plays to a CSV file (comma-separated values). You could then open this file in a spreadsheet application or read it into the scripting environment of your choice (R, MATLAB, Python, etc.).</p>
<p>I created a specific branch of the repository that will parse the plays without any dependencies on database libraries (i.e. SQLAlchemy). Assuming you&#8217;re on Linux and have <a href="https://help.ubuntu.com/community/Git" target="_blank">Git installed</a>, just clone the “nodatabase” branch of the repository to get started like this:</p>
<pre>
$ git clone --branch=nodatabase https://github.com/10flow/playbyplay.git
</pre>
<p>Then you can run the parser script:</p>
<pre>
$ cd playbyplay/play-parser/
$ ./play_parser.py
</pre>
<p>After a minute or two of processing, you&#8217;ll have a “output.csv” ready to play with.</p>
<h2>How to Ingest Plays into a Database</h2>
<p>If you want to use a SQL database, I&#8217;ll assume you have one installed. If not, I&#8217;ll refer you here for <a href="https://help.ubuntu.com/12.04/serverguide/mysql.html" target="_blank">Ubuntu&#8217;s guide to MySQL</a>.</p>
<p>My ingest script requires SQLAlchemy, a popular database library for Python. This is easy to install with the “easy_install” package manager. If you don&#8217;t have easy install, you can install it on Ubuntu as follows: “sudo apt-get install python-setuptools”. Next, get SQLAlchemy like this:</p>
<pre>
$ sudo easy_install SQLAlchemy
</pre>
<p>Now you&#8217;re ready to download the code from GitHub. Grab the master branch if you&#8217;re planning on using a database:</p>
<pre>
$ git clone https://github.com/10flow/playbyplay.git
</pre>
<p>Before you run the parser script, there&#8217;s a few things to do. First, specify your database information in “play_parser.py” on line 28. And next, you&#8217;ll need to create the database before you can insert the data. For example, if your database connection string (line 28) looks like this:</p>
<pre>
database_engine = create_engine('mysql+mysqldb://root:password@localhost/playtest', echo=False)
</pre>
<p>Then create the database like this:</p>
<pre>
$ mysql -u root -p
mysql> create database playtest;
Query OK, 1 row affected (0.06 sec)
mysql> exit
</pre>
<p>Now you&#8217;re ready to run the script:</p>
<pre>
$ cd playbyplay/play-parser/
$ ./play_parser.py
</pre>
<p>Inserting the plays will take a long time. But once it&#8217;s done, you can issue queries this:</p>
<pre>
$ mysql -u root -p
mysql> use playtest;

Database changed
mysql> select result,count(result) from plays where season=2012 and result!='play' group by result;
+--------+---------------+
| result | count(result) |
+--------+---------------+
| downs  |           209 |
| fg     |           855 |
| fumble |           184 |
| half   |           185 |
| int    |           378 |
| loss   |            61 |
| miss   |           193 |
| ot     |            14 |
| other  |           154 |
| punt   |          2480 |
| td     |          1269 |
| tie    |             2 |
| win    |           148 |
+--------+---------------+
13 rows in set (0.02 sec)
</pre>
<p>And now you&#8217;re ready to analyze.</p>
<p>Let me know if you come with any interesting stats in time for the big game!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.10flow.com/2013/01/26/how-to-analyze-the-play-by-play-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Play-by-Play Effectiveness</title>
		<link>http://www.10flow.com/2013/01/12/play-by-play-effectiveness/</link>
		<comments>http://www.10flow.com/2013/01/12/play-by-play-effectiveness/#comments</comments>
		<pubDate>Sat, 12 Jan 2013 15:19:44 +0000</pubDate>
		<dc:creator>Scott Sawyer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[football]]></category>

		<guid isPermaLink="false">http://www.10flow.com/?p=201</guid>
		<description><![CDATA[Check out this web app I put together to measure the effectiveness of plays and drives: http://football.10flow.com/ Here are some interesting stats I&#8217;ve found so far: The stats show Andy Reid&#8217;s Eagles performed poorly when down a score in the &#8230; <a href="http://www.10flow.com/2013/01/12/play-by-play-effectiveness/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Check out this web app I put together to measure the effectiveness of plays and drives:<br />
<a href="http://football.10flow.com/" target="_blank">http://football.10flow.com/</a></p>
<p>Here are some interesting stats I&#8217;ve found so far:</p>
<p>The stats show <a href="http://football.10flow.com/#2002|2012|PHI|0|4|4|0|0|Andy Reid and the Two Minute Drill" target="_blank">Andy Reid&#8217;s Eagles performed poorly when down a score in the final 2 minutes</a>. The biggest problem seems to be the terrible 34% pass success rate and a below average plays-per-drive (4.4 compared to 4.7). Two-minute drill drives ended in 11 picks (21.2%), 12 turnovers on downs (23.1%), and 10 TDs (19.2%). They ran out of the clock 9 times. Their scoring percentage was 25% compared to a <a href="http://football.10flow.com/#2002|2012|0|0|4|4|0|0|Two Minute Drill (on average)" target="_blank">league average</a> of 33.4%. Good luck Kansas City!</p>
<p>The <a href="http://football.10flow.com/#2012|2012|NYJ|0|0|0|0|0|Jets Offense 2012" target="_blank">2012 Jets</a> stand out as a weak offense. There was a big drop in touchdowns, pass play effectiveness, and interestingly, pass play selection. The Jets passed on 57.1% of plays in <a href="http://football.10flow.com/#2011|2011|NYJ|0|0|0|0|0|Jets Offense 2011" target="_blank">2011</a>, compared to 52.1% this year. The loss of CB Darrelle Revis also had an impact. Opposing team&#8217;s pass success rate went from 40.8% (with 15 picks) in <a href="http://football.10flow.com/#2011|2011|0|NYJ|0|0|0|0|Jets Defense 2011" target="_blank">2011</a> to 42.8% (with 9 picks) in <a href="http://football.10flow.com/#2012|2012|0|NYJ|0|0|0|0|Jets Defense 2012" target="_blank">2012</a>.</p>
<p>Finally, the <a href="http://football.10flow.com/#2012|2012|NE|0|0|0|0|0|2012 Patriots Offense" target="_blank">Pats offense</a> was scary-effective this year. Their touchdown rate stands out the most &#8212; 32.4% compared to league average 21.0%.</p>
<p>Leave a reply below or Tweet at me if you find something interesting in the stats!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.10flow.com/2013/01/12/play-by-play-effectiveness/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>NFL Play-by-Play Data</title>
		<link>http://www.10flow.com/2013/01/10/nfl-play-by-play-data/</link>
		<comments>http://www.10flow.com/2013/01/10/nfl-play-by-play-data/#comments</comments>
		<pubDate>Thu, 10 Jan 2013 19:35:22 +0000</pubDate>
		<dc:creator>Scott Sawyer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[football]]></category>

		<guid isPermaLink="false">http://www.10flow.com/?p=194</guid>
		<description><![CDATA[The Hive turned me on to this NFL play-by-play dataset going back to 2002, released by Brian Burke to see what the community could do with it. It&#8217;s a set of CSV files (hosted as a Google Docs spreadsheets) with &#8230; <a href="http://www.10flow.com/2013/01/10/nfl-play-by-play-data/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.boston.com/business/innovation/blogs/inside-the-hive/2013/01/03/hack-bill-belichick-with-database-every-nfl-play/48kGaFnyaEQST4BCzXNdiM/blog.html" target="_blank">The Hive</a> turned me on to this <a href="http://www.advancednflstats.com/2010/04/play-by-play-data.html" target="_blank">NFL play-by-play dataset</a> going back to 2002, released by <a href="http://www.advancednflstats.com" target="_blank">Brian Burke</a> to see what the community could do with it. It&#8217;s a set of CSV files (hosted as a Google Docs spreadsheets) with some metadata columns (game ID, offensive team, defensive team, yard-line, down, yards-to-go, quarter, time remaining) and a text description of the play. </p>
<p>This seems like a gold mine for evaluating the overall effectiveness of offenses and defenses in different situations. The data is great, but you can&#8217;t do much with the data unless you can parse the text description. Here are some example descriptions:</p>
<ul>
<li>(Shotgun) E.Manning pass incomplete short middle to V.Cruz.</li>
<li>(No Huddle) L.McCoy left tackle to CLV 43 for 7 yards (T.Ward).</li>
<li>(Shotgun) T.Brady pass deep middle to W.Welker to DEN 1 for 19 yards (C.Harris). Touchdown was reviewed by Review Assistant.  And overturned.</li>
</ul>
<p>There&#8217;s a quite a bit you can do with this data as a spreadsheet.  But when it comes to parsing these descriptions, a spreadsheet is simply not the right tool. After a few hours and a couple hundred lines of Python, I&#8217;ve parsed each description, filtered out non-offensive plays (i.e. kicks, penalties, and weird situations), and then determined the type of each play (pass or run) and the yardage gained or lost. I then rate each play as a success or failure. A successful play meets one of these criteria:</p>
<ul>
<li>Play results in a first down</li>
<li>Play scores a touchdown</li>
<li>On 1st or 2nd down, play gains at least 4 yards</li>
</ul>
<p>And, of course, successful plays can&#8217;t result in turnovers or losing the game.</p>
<p>I also determined how each drive ended, and then I ingested the entire dataset in a MySQL database. SQL is a great tool for filtering the plays based on specific values or ranges for any of the columns.</p>
<p>I don&#8217;t claim 100% of the 350,000+ play descriptions were parsed accurately, but based on some spot checking, I&#8217;d guess accuracy is in the high 90s. Football is a game with strange rules, and it would probably take thousands of lines of code to nail down every weird situation involving penalties, official review, blocked kicks, and multiple fumbles.</p>
<p>Regardless, with this mostly accurate database available, it&#8217;s now possible to quickly generate stats and even make the data accessible as a web application. I hope to roll out a site in the next couple days.</p>
<p>Here&#8217;s a sneak preview of the run stats visualization:</p>
<div class="figure"><a href="http://www.10flow.com/wp-content/uploads/2013/01/preview_464.png"><img src="http://www.10flow.com/wp-content/uploads/2013/01/preview_464.png" alt="Run Statistics" title="preview_464" width="464" height="117" class="alignnone size-full wp-image-198" /></a>
<p><b>Histograms</b> show run play success</p>
</div>
<p>Stay tuned and let me know what great ideas you have for the web app!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.10flow.com/2013/01/10/nfl-play-by-play-data/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Secret Santa 2.0</title>
		<link>http://www.10flow.com/2012/12/12/secret-santa-2-0/</link>
		<comments>http://www.10flow.com/2012/12/12/secret-santa-2-0/#comments</comments>
		<pubDate>Thu, 13 Dec 2012 01:21:17 +0000</pubDate>
		<dc:creator>Scott Sawyer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.10flow.com/?p=166</guid>
		<description><![CDATA[Are you organizing a Secret Santa gift exchange this holiday season? Pulling names out of a hat is sooo luddite. Jason Frey tweeted this 98-character Ruby script that will randomly pair up participants: secret_santa.rb: names.dup.shuffle.each_with_object({}) {&#124;n, h&#124; h[n] = names.find &#8230; <a href="http://www.10flow.com/2012/12/12/secret-santa-2-0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Are you organizing a Secret Santa gift exchange this holiday season? Pulling names out of a hat is sooo luddite. Jason Frey tweeted this 98-character Ruby script that will randomly pair up participants:</p>
<style>
.twitter-tweet-rendered {
clear: none!important;
}
</style>
<div class="figure">
<blockquote class="twitter-tweet" width="450"><p>secret_santa.rb: names.dup.shuffle.each_with_object({}) {|n, h| h[n] = names.find {|m| m != n}; names.delete(h[n])}</p>
<p>&mdash; Jason Frey (@Fryguy9) <a href="https://twitter.com/Fryguy9/status/271679521042870272" data-datetime="2012-11-22T18:20:20+00:00">November 22, 2012</a></p></blockquote>
<p><script src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
<p>Let&#8217;s try it out in a Rails console:</p>
<pre>
>> names = %w{Alice Bob Charlie David Eve}
=> ["Alice", "Bob", "Charlie", "David", "Eve"]
>> names.dup.shuffle.each_with_object({}) {|n, h| h[n] = names.find {|m| m != n}; names.delete(h[n])}
=> {"Bob"=>"David", "David"=>"Alice", "Alice"=>"Bob", "Charlie"=>"Eve", "Eve"=>"Charlie"}
</pre>
<p>Someone should really turn this into a webapp.</p>
<p>Happy Holidays!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.10flow.com/2012/12/12/secret-santa-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lossless Photo Compression</title>
		<link>http://www.10flow.com/2012/11/26/lossless-photo-compression/</link>
		<comments>http://www.10flow.com/2012/11/26/lossless-photo-compression/#comments</comments>
		<pubDate>Mon, 26 Nov 2012 22:50:09 +0000</pubDate>
		<dc:creator>Scott Sawyer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[image processing]]></category>

		<guid isPermaLink="false">http://www.10flow.com/?p=150</guid>
		<description><![CDATA[Last week, I had the privilege of giving a lecture on image coding and compression for an IEEE course on Image Processing, organized by the Boston chapter of the Signal Processing Society. My lecture slides (PDF) are available for download. &#8230; <a href="http://www.10flow.com/2012/11/26/lossless-photo-compression/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Last week, I had the privilege of giving a lecture on image coding and compression for an IEEE course on Image Processing, organized by the Boston chapter of the Signal Processing Society.  <a href="http://www.mit.edu/~ka21369/Imaging2012/sawyer.pdf" target="_blank">My lecture slides (PDF) are available for download.</a></p>
<p>The attendees were very engaged, and I got lots of great questions. When we got into wavelet-based JPEG2000 compression, there was one question in particular that I couldn&#8217;t quite answer at the time: if wavelet transforms are like digital FIR filters, how can they be reversible to provide lossless compression?</p>
<p>It&#8217;s a great question. The wavelet transform is based on tree-like cascading filter banks, where the signal is sent through a low-pass and high-pass filter at each stage, as shown here:</p>
<div class="figure">
<a href="http://www.10flow.com/wp-content/uploads/2012/11/wavelets.png"><img src="http://www.10flow.com/wp-content/uploads/2012/11/wavelets.png" alt="Wavelets are like a tree of cascading filter banks" title="wavelets" width="464" height="142" class="alignnone size-full wp-image-154" /></a></p>
<p><b>Wavelets</b> are like a tree of cascading filter banks<br />
<em>Source:</b> <a href="http://en.wikipedia.org/wiki/Discrete_wavelet_transform" target="_blank">http://en.wikipedia.org/wiki/Discrete_wavelet_transform</a></em></p>
</div>
<p>In the diagram above, the filter denoted g[n] represents a low-pass filter, and h[n] a high-pass filter.  In lossless image compression, the wavelet transform is carried on for a particular number of stages, and the resulting 2-D signal is compressed using entropy coding (which is lossless).  In order for the original image to be recovered, the wavelet transform, and by association the filters g[n] and h[n], must be reversible.</p>
<p>In general, a digital Finite Impulse Response (FIR) filter is not reversible.  Even filter banks, which pass a single input signal through a number of FIR filters, are generally not reversible.  However, the Cohen-Daubechies-Feauveau (CDF) 5/3 wavelet employed by JPEG2000 in lossless mode has a couple interesting properties of the wavelet transform used in JPEG2000 lossless compression that make the filters reversible.</p>
<p>First, the CDF 5/3 wavelet is designed to be an integer-to-integer map, such that the output can be expressed with finite precision. This is achieved in part by approximating the filter coefficients with rational numbers&mdash;in fact, each coeffient is a dyadic fraction (i.e. fraction whose denominator is a power of two). Second, the low-pass and high-pass coefficients are designed such that the two filter outputs can be combined to recover the original input. In other words, the two filters are complementary. Actually, the two sub-band signals are generated using <a href="http://en.wikipedia.org/wiki/Lifting_scheme" target="_blank">a lifting scheme, as described here</a>.</p>
<p>In short, to call the wavelet filters high-pass and low-pass FIR filters is an over-simplification. The CDF 5/3 wavelet is a carefully designed reversible transform that makes it well-suited to lossless image compression.</p>
<p>(Wavelets are a dense, complex topic. If you&#8217;re interested in really understanding them, I would suggest <a href="http://www.amazon.com/Wavelets-Filter-Banks-Gilbert-Strang/dp/0961408871" target="_blank"><em>Wavelets and Filter Banks</em> by Strang and Nguyen</a>. There are a host of other books available, but I&#8217;ve found their book to be the most readable.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.10flow.com/2012/11/26/lossless-photo-compression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image Compression in 60 Minutes</title>
		<link>http://www.10flow.com/2012/11/08/image-compression-in-60-minutes/</link>
		<comments>http://www.10flow.com/2012/11/08/image-compression-in-60-minutes/#comments</comments>
		<pubDate>Fri, 09 Nov 2012 03:16:45 +0000</pubDate>
		<dc:creator>Scott Sawyer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[image processing]]></category>

		<guid isPermaLink="false">http://www.10flow.com/?p=145</guid>
		<description><![CDATA[I&#8217;ve been invited to give a lecture on Image Coding and Compression next week. The audience is mostly IEEE members&#8212;engineering professionals working in various fields looking to bolster their background in image processing. I get one hour to cover this &#8230; <a href="http://www.10flow.com/2012/11/08/image-compression-in-60-minutes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been invited to give a <a target="_blank" href="http://www.ieeeboston.org/edu/class_room/2012_fall/c2-imaging_processing.html">lecture on Image Coding and Compression</a> next week.  The audience is mostly IEEE members&mdash;engineering professionals working in various fields looking to bolster their background in image processing.  I get one hour to cover this huge topic area.  So what are the most important bits to cover?</p>
<p>I like lectures that tell a story, so I&#8217;m approaching the topic chronologically.  I got into computers as a kid in the 90s, and back then, web graphics were all about GIFs and JPEGs.  These formats are based on very different compression techniques, and it was (and still is) important to choose the right one based on your image content.  Beyond the web, many engineering applications require lossless photo compression, and JPEG2000 has long been the de facto standard.  More recently, new vectorized formats (Scalable Vector Graphics, in particular) have taken off on the web, largely driven by devices with very high display resolution, such as Apple&#8217;s retina display.</p>
<p>With that narrative in mind, here&#8217;s my outline of the most important 60 minutes in Image Coding and Compression:</p>
<ul>
<li>How color works</li>
<li>Simple image coding (e.g. run length encoding)</li>
<li>LZW compression (GIF)</li>
<li>Compression with the discrete cosine transform (JPEG)</li>
<li>Compression with wavelet transforms (JPEG2000)</li>
<li>New graphics formats (e.g. SVG)</li>
</ul>
<p>Of course, there are a lot of interesting topics that didn&#8217;t make the cut (most notably, perhaps, predictive coding).  What are your thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.10flow.com/2012/11/08/image-compression-in-60-minutes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Big Data Platform Landscape</title>
		<link>http://www.10flow.com/2012/10/14/big-data-platform-landscape/</link>
		<comments>http://www.10flow.com/2012/10/14/big-data-platform-landscape/#comments</comments>
		<pubDate>Mon, 15 Oct 2012 00:22:20 +0000</pubDate>
		<dc:creator>Scott Sawyer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[Big Data]]></category>

		<guid isPermaLink="false">http://www.10flow.com/?p=141</guid>
		<description><![CDATA[The number of Big Data software platforms has exploded. To wrap my mind around the available databases, query and analysis systems, and the types of users that actually these sorts of technologies, I created a mind map in FreeMind. This &#8230; <a href="http://www.10flow.com/2012/10/14/big-data-platform-landscape/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The number of Big Data software platforms has exploded.  To wrap my mind around the available databases, query and analysis systems, and the types of users that actually these sorts of technologies, I created a mind map in <a href="http://freemind.sourceforge.net/">FreeMind</a>.</p>
<p>This map is certainly not complete, but it provides a good background on what&#8217;s out there.  I hope to continue growing this map as I learn about new technologies.  I&#8217;ve also noted a few topics that look like strong potential research areas.</p>
<p>Check it out here: <a href="/bigdatamap">Scott Sawyer&#8217;s mind map of Big Data platforms</a> (or <a href="/bigdatamap/BigDataPlatforms.mm">download the FreeMind file</a>).</p>
<p>Leave a reply or tweet at me (<a href="http://www.twitter.com/10flow">@10flow</a>) if you&#8217;ve got a technology to share!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.10flow.com/2012/10/14/big-data-platform-landscape/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
