<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>Calvin's Maps</title><generator>Tumblr (3.0; @cwmma)</generator><link>http://cwmma.tumblr.com/</link><item><title>if (err) return callback(err);</title><description>&lt;p&gt;&lt;a class="tumblr_blog" href="http://nodejsreactions.tumblr.com/post/52634242556/if-err-return-callback-err" target="_blank"&gt;nodejsreactions&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;img alt="image" src="http://funnyasduck.net/wp-content/uploads/2013/05/funny-kick-beer-bottle-off-boys-head-animated-gif-pics.gif"/&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://cwmma.tumblr.com/post/52827292012</link><guid>http://cwmma.tumblr.com/post/52827292012</guid><pubDate>Wed, 12 Jun 2013 20:08:59 -0400</pubDate></item><item><title>Modern Projections</title><description>&lt;p&gt;I was really excited by &lt;a href="http://www.jasondavies.com/maps/raster/" target="_blank"&gt;Jason Davies work&lt;/a&gt; on reprojected tile maps, this got me wondering, what projection would I want to use for a tile map, my answer: none of them.&lt;/p&gt;
&lt;p&gt;Most map projections are from an era of paper maps not zoomable web maps, which means that they are all geared to a specific zoom level. For instance, when people say that mercator is a &amp;#8216;terrible projection&amp;#8217; what they are actually saying is that mercator is a &amp;#8216;terrible projection for polar regions and for zoom levels that feature both equatorial and polar regions.&amp;#8217; In fact when zoomed in to a regional level mercator is going to be a pretty great projection for the vast majority of places with permanent human settlements. There are already projections created for specific areas which can make those local areas &lt;a href="http://bl.ocks.org/calvinmetcalf/5629688" target="_blank"&gt;more accurately&lt;/a&gt; then &lt;a href="http://a.tiles.mapbox.com/v3/examples.map-4l7djmvo/page.html#8.00/42.203/-71.783" target="_blank"&gt;standard mercator&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Meaning that if I wasn&amp;#8217;t going to an &lt;a href="http://bostoncalling.com/lineup" target="_blank"&gt;all day music festival today&lt;/a&gt; I&amp;#8217;d be looking into making a map:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;That at low zoom levels (entire earth) uses an equal area projection that doesn&amp;#8217;t screw up shapes too bad, (&lt;a href="https://en.wikipedia.org/wiki/Tobler_hyperelliptical_projection" target="_blank"&gt;one&lt;/a&gt; &lt;a href="http://en.wikipedia.org/wiki/Mollweide_projection" target="_blank"&gt;of&lt;/a&gt; &lt;a href="https://en.wikipedia.org/wiki/Hammer_projection" target="_blank"&gt;these&lt;/a&gt;?)&lt;/li&gt;
&lt;li&gt;When zoomed in switch to a &lt;a href="https://en.wikipedia.org/wiki/Lambert_conformal_conic_projection" target="_blank"&gt;Lambert Conformal Conic&lt;/a&gt; with the reference parallels dynamically calculated based on the current map view, why lcc? because most maps tend to be wider then they are tall, for a tall map, i.e one for a smart phone, you might use &lt;a href="https://en.wikipedia.org/wiki/Transverse_Mercator_projection" target="_blank"&gt;transverse mercator&lt;/a&gt;. &lt;span&gt;LCC and TM might not be the best choices at polar and equatorial latitudes, so a few more projections might be in order there.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;</description><link>http://cwmma.tumblr.com/post/51398003352</link><guid>http://cwmma.tumblr.com/post/51398003352</guid><pubDate>Sun, 26 May 2013 12:13:00 -0400</pubDate></item><item><title>Hospital Prices</title><description>&lt;a href="http://bl.ocks.org/calvinmetcalf/5547381"&gt;Hospital Prices&lt;/a&gt;: &lt;p&gt;Comparison of the different prices of procedures looking at the differences in prices at different hospitals optionally by state and also looking at the difference between the amount charged and the amount insurances payed.&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/50085182818</link><guid>http://cwmma.tumblr.com/post/50085182818</guid><pubDate>Fri, 10 May 2013 08:30:24 -0400</pubDate></item><item><title>Demographic changes in D3</title><description>&lt;p&gt;I haven&amp;#8217;t done much with D3 lately so I threw together this &lt;a href="http://calvinmetcalf.github.io/demographics.d3/" target="_blank"&gt;map of population, households, and employment forecasts&lt;/a&gt;. I made it in CoffeeScript and it really reminded me why I love CoffeeScript so much.&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/50051614240</link><guid>http://cwmma.tumblr.com/post/50051614240</guid><pubDate>Thu, 09 May 2013 20:34:20 -0400</pubDate><category>d3</category><category>javascript</category><category>coffeescript</category></item><item><title>Updates to Communist.js</title><description>&lt;p&gt;I did a lot of work on web workers in April leading up to entering the &lt;a href="https://developer.mozilla.org/en-US/demos/devderby/2013/april" target="_blank"&gt;Mozilla Dev Derby&lt;/a&gt; (as an aside my favorite one, besides mine, has got to be &lt;a href="http://zenphoton.com/" target="_blank"&gt;Zen Photon Garden&lt;/a&gt;), I&amp;#8217;ve taken what I&amp;#8217;ve learned made a few updates to &lt;a href="http://communistjs.com/" target="_blank"&gt;communist&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Dropped node, it just didn&amp;#8217;t make sense for communist to be used server side, none of the problems you have are they same, the final nail in the coffin is that I couldn&amp;#8217;t think of a reason I my self would ever use it server side. &lt;/li&gt;
&lt;li&gt;Communist now has it&amp;#8217;s own domain &lt;a href="http://communistjs.com/" target="_blank"&gt;&lt;a href="http://communistjs.com/" target="_blank"&gt;http://communistjs.com/&lt;/a&gt;&lt;/a&gt; this has nothing to do with what I just said, but it&amp;#8217;s true.&lt;/li&gt;
&lt;li&gt;Having the various worker types build on top of each other, while nice from a theoretical point of view ended up resulting in triple layers of function calls. &lt;/li&gt;
&lt;li&gt;I don&amp;#8217;t think I had been describing it very well so I simplified the explanation of the API with less talk about the messy inner parts.&lt;/li&gt;
&lt;li&gt;Call the workers in the same context to allow the use of &amp;#8220;this&amp;#8221; to persist values across calls. No more &amp;#8220;_db&amp;#8221; nonsense.&lt;/li&gt;
&lt;li&gt;Split up the build into more logical files and added phantomjs headless testing on the build stage and also have started using sauce labs to test it.&lt;/li&gt;
&lt;li&gt;With the help of sauce labs, it now works in IE10, Opera, and Safari &amp;gt;5.&lt;/li&gt;
&lt;li&gt;Added a few demos&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;a href="http://communistjs.com/" target="_blank"&gt;Check it out&lt;/a&gt;&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/49850961774</link><guid>http://cwmma.tumblr.com/post/49850961774</guid><pubDate>Tue, 07 May 2013 08:30:25 -0400</pubDate><category>webworkers</category><category>js</category><category>javascript</category><category>html5</category></item><item><title>State of the Web Worker (api)</title><description>&lt;p&gt;Quick write up I did on web workers you can &lt;a href="https://gist.github.com/calvinmetcalf/5495466" target="_blank"&gt;view the raw gis&lt;/a&gt;t if it doesn&amp;#8217;t show up below.&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/calvinmetcalf/5495466" target="_blank"&gt;https://gist.github.com/calvinmetcalf/5495466&lt;/a&gt;&lt;/div&gt;</description><link>http://cwmma.tumblr.com/post/49386406906</link><guid>http://cwmma.tumblr.com/post/49386406906</guid><pubDate>Wed, 01 May 2013 17:38:01 -0400</pubDate><category>js</category><category>javascript</category><category>webworkers</category></item><item><title>ASM (updated)</title><description>&lt;p&gt;I was talking to &lt;a href="http://trippingthebits.com/" target="_blank"&gt;Ryan Westphal&lt;/a&gt; the other day and he was saying how he&amp;#8217;d been playing round with &lt;a href="http://asmjs.org/" target="_blank"&gt;ASM.js&lt;/a&gt; and you could hand code it fairly easily and it was FAST. I&amp;#8217;ve been playing around with a crazy fractal generating map so I figured that would be as good a place as any to try out ASM.js.&lt;/p&gt;
&lt;p&gt;The code for the different fractal types was already stored in an object so switching it to be an asmjs style module wasn&amp;#8217;t too bad, code before:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/calvinmetcalf/5473009" target="_blank"&gt;https://gist.github.com/calvinmetcalf/5473009&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;code after:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/calvinmetcalf/5473022" target="_blank"&gt;https://gist.github.com/calvinmetcalf/5473022&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;I was able to smooth out the bugs as firefox versions that support it will give you the line numbers that prevent your asm code from compiling, after I finally got rid of the last of the errors primarily static type N00B mistakes like pow(y,3) but also asmjs ones like trying to initialize a variable to undefined or to an expression and ones related to not reading the allowed operators closely (no logical and). So I fired it up and nothing happend.  &lt;/p&gt;
&lt;p&gt;Then I realized that ASM seems to be turned off if you open up the debug console.  So close tools and hard refresh and &amp;#8230; nothing, it&amp;#8217;s actually slower in chrome too. &lt;/p&gt;
&lt;p&gt;After some intense microbenchmarks and help from &lt;a href="https://twitter.com/jdalton" target="_blank"&gt;John-David Dalton&lt;/a&gt; and &lt;a href="https://twitter.com/mraleph" target="_blank"&gt;Vyacheslav Egorov&lt;/a&gt; on twitter I was able to figure out that&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Replacing the logical and with a binary and (&amp;amp;&amp;amp;-&amp;gt;&amp;amp;) was what was killing chrome &lt;a href="http://jsperf.com/asmjs/11" target="_blank"&gt;perf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Despite what Firefox tells you DO NOT USE THE FUNCTION CONSTRUCTOR&lt;/li&gt;
&lt;li&gt;ASM doesn&amp;#8217;t optimize all code &lt;a href="http://jsperf.com/asmjs/10" target="_blank"&gt;perf&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;I have a feeling that there is an issue with the construction of my loop that&amp;#8217;s preventing it from optimizing.  More details to come, oh and the current &lt;a href="http://calvinmetcalf.github.io/leaflet-fractal" target="_blank"&gt;fractal demo&lt;/a&gt; did I mention that all of this is inside a web worker?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Update: I was planing more updates sooner but then Ubuntu started updating to Raring and my laptop started overheating when I did anything&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Update 2: I &lt;a href="http://jsperf.com/asm-mark-2/2" target="_blank"&gt;created a perf&lt;/a&gt; with the diag example from the spec and found that adding the words &amp;#8220;use asm&amp;#8221; cause it to go approximately 1/3 the speed.  But for some reason when firefox nightly tries to post the results it gets a 413 so hears a screen shot. &lt;img alt="image" src="http://media.tumblr.com/03a06c11a60af3a2075dc544a1dd5b9a/tumblr_inline_mm1i5iiGWC1qz4rgp.png"/&gt;&lt;/p&gt;

&lt;p&gt;Update 3: &lt;a href="http://jsperf.com/asmjs-fibonacci" target="_blank"&gt;This is the perf&lt;/a&gt; that Ryan was talking about when he said asm was fast. &lt;a href="http://jsperf.com/asmjs-fibonacci/3" target="_blank"&gt;This is the non-recursive version&lt;/a&gt; that I made, the asm version is now 206,350x faster, but the non-asm one is 1,654,225x faster giving it a commanding lead.  I will admit I am not a C coder, I can make some pretty optimized JavaScript but this lower level stuff I may be way off on, feel free to give me a shout on twitter with any suggestions. &lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/49003915863</link><guid>http://cwmma.tumblr.com/post/49003915863</guid><pubDate>Sat, 27 Apr 2013 09:23:00 -0400</pubDate><category>asmjs</category><category>javascript</category><category>mozilla</category><category>firefox</category><category>perf</category><category>js</category></item><item><title>Let's make a map with Leaflet and d3</title><description>&lt;p&gt;I made &lt;a href="http://calvinmetcalf.github.com/leaflet.demos" target="_blank"&gt;this map&lt;/a&gt; on Friday, today I wrote &lt;a href="https://github.com/calvinmetcalf/leaflet.demos/blob/gh-pages/blog/1-html.md" target="_blank"&gt;a detailed post on how I used  leaflet and d3 to make it&lt;/a&gt;, actual post is over on github because tumblr sucks for code.&lt;/p&gt;
&lt;p&gt;I was planning on writing this on earlier, but then I got 30 inches of snow&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" src="http://media.tumblr.com/d91bd146797b3c144ec8c85fd3019369/tumblr_inline_mi18prMLGG1qz4rgp.jpg"/&gt;&lt;/p&gt;

&lt;p&gt;(not me)&lt;/p&gt;
&lt;p&gt;&lt;span&gt;lost power for 20 hours, and brewed bathrobe beer.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt="image" src="http://media.tumblr.com/542fbd0346655ca491c4795a8154b6ef/tumblr_inline_mi18tnVdWh1qz4rgp.jpg"/&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;(me, and yes I&amp;#8217;m aware it looks like poop)&lt;/span&gt;&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/42839789884</link><guid>http://cwmma.tumblr.com/post/42839789884</guid><pubDate>Mon, 11 Feb 2013 08:30:46 -0500</pubDate></item><item><title>Let's build a Pouchdb app we aren't ashamed of &amp; backbone.js explained without words that start with C,M,or V </title><description>&lt;p&gt;The &lt;a href="http://cwmma.tumblr.com/post/41782044503/lets-make-an-app-pouchdb" target="_blank"&gt;previous post&lt;/a&gt;, while it showed the basics of pouch produced an app that is frankly not ready for prime time. So in this post we refactor the app and turn it into something less embarrassing. We are going to use the fantastic library &lt;a href="http://backbonejs.org/" target="_blank"&gt;backbone.js&lt;/a&gt;, written by the authors of a little language that turns into JavaScript, to tidy the app up, which will require an explanation of backbone. &lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been aware of backbone for quite a while but my reaction every time someone tries to explain it has always been &amp;#8220;yes but what does it do?&amp;#8221; I blame this on the proliferation of libraries and frame works built around the letters C, M, and V which all use terms starting with those letters in similar but divergent ways, so for the rest of this post we will be using no words that start with those letters. If don&amp;#8217;t care about backbone you can go right to the &lt;a href="https://calvin.iriscouch.com/backbone/_design/pouch/_rewrite/home" target="_blank"&gt;updated app&lt;/a&gt; or read about &lt;a href="https://github.com/calvinmetcalf/flaming-wight/blob/master/backbone.md" target="_blank"&gt;how I improved it&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The first basic part of backbone we will refer to as an &amp;#8220;item template&amp;#8221; though backbone uses a term that rhymes with &amp;#8220;bottle.&amp;#8221; You can think of this as representing a blueprint for a thing: in SQL it might be equivalent to a row, in PouchDB and MongoDB this might be a document, in Neo4J it might be an edge or node. When you add data you actually make a new instance of your item template (aka use the key word &amp;#8220;new&amp;#8221;).  Your item template can define tests that data needs to pass to be added and ways to serialized or transform your data for export, and can fire events when items are added, removed, updated etc.&lt;/p&gt;
&lt;p&gt;The next portion we will refer to as a group of items, but backbone uses a term which rhymes with &amp;#8220;selection.&amp;#8221; A group is really what it is and in SQL it would be like a table and in PouchDB it would be like a DB.  You use a group to not only to attache some events, like watching for updates to a specific attribute across all items, but as an object you can use all of underscores functional tools on. You can run map,reduce,filter,pluck,each and more on your group to easily get just the data you care about.&lt;/p&gt;
&lt;p&gt;The third and final of the essential parts of backbone is what I&amp;#8217;m going to refer to as a supervisor but backbone refers to with a word that rhymes with &amp;#8220;queue&amp;#8221;. If this was that show about the extravagant houses of of famous artists then this would be the bedroom. I call it a supervisor because it supervises a specific element of the page and it is the only thing that touches its element. And how do you get the supervisor to know when to do something? By having it listen for updates to a group and events in the dom inside its element. This is the gist of backbone, its key usefulness is segregating the logic so that like is grouped with like. So if you want to get rid of a side bar all if the logic related to it is in one supervisor. Now enough introduction go look &lt;a href="https://github.com/calvinmetcalf/flaming-wight/blob/master/backbone.md" target="_blank"&gt;at the updating the pouchDB app with backbone&lt;/a&gt;.&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/42426608055</link><guid>http://cwmma.tumblr.com/post/42426608055</guid><pubDate>Wed, 06 Feb 2013 08:30:38 -0500</pubDate><category>couchdb</category><category>pouchdb</category><category>js</category><category>javascript</category><category>coffeescript</category><category>backbone.js</category></item><item><title>Lets make an app: PouchDB</title><description>&lt;p&gt;This is part 3 in a series, you can (and should) checkout &lt;a href="http://cwmma.tumblr.com/post/39926807885/pouchdb-an-intro" target="_blank"&gt;part 1&lt;/a&gt; and &lt;a href="http://cwmma.tumblr.com/post/40516499487/in-which-we-explain-how-to-use-pouchdb" target="_blank"&gt;part two&lt;/a&gt;, we&amp;#8217;ll wait. &lt;/p&gt;
&lt;p&gt;So we&amp;#8217;re going to make an app, first remember that class we made last time, I had to make a few changes to get it to work, so overall it looks like this&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4648986" target="_blank"&gt;https://gist.github.com/4648986&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Why you ask? A couple of indentations errors (that nobody caught) but mostly the stop and start methods because I noticed that your browser doesn&amp;#8217;t always get the message whey your back on again after going offline, those methods allow you to stop the continuous replication and start it again to get things to sync.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We&amp;#8217;re going to make an app that allows you to write notes that others can see and edit, and should work when you go on and off line, this may seem trivial, but checkout &lt;a href="http://twitter.com/axemclion" target="_blank"&gt;@&lt;/a&gt;&lt;/span&gt;&lt;u&gt;&lt;a href="http://twitter.com/axemclion" target="_blank"&gt;axemclion&lt;/a&gt;&amp;#8217;s &lt;/u&gt;&lt;a href="http://nparashuram.com/conference/dist/#home/schedule" target="_blank"&gt;conference app&lt;/a&gt; which does something very similar but in a useful way. &lt;/p&gt;

&lt;p&gt;So originally I was going to make this in backbone.js but instead I &lt;strike&gt;discovered &lt;a href="http://www.reddit.com/r/cats" target="_blank"&gt;/r/cats&lt;/a&gt;&lt;/strike&gt; decided to do it slightly lover level to demonstrate the principles involved.  The structure of the app is going to be as follows;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;&lt;span&gt;We have an object called &amp;#8216;obj&amp;#8217; which has all the documents we care about from the pouch, our on change function will update/add/delete the document from obj.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;we have a function called &amp;#8216;update&amp;#8217; which takes obj and transforms it into an object call &amp;#8216;views&amp;#8217;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;We have a set of mustache templates, we also have a div with id &amp;#8216;body&amp;#8217;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;views is given to the mustache template to generate html, div#body is emptied and then we append the mustache html (I &lt;/span&gt;originally&lt;span&gt; was doing this to the body tag before I &lt;/span&gt;realized&lt;span&gt; this caused issues with the script tags.)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Besides the contents of obj the only thing that effects the function update is what the current location.hash is.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;The event structure is that when a document is changed, pouch updates obj and then calls update(), when a link is clicked, the handler preventsDefault(), changes the location.hash, calls update()&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;That&amp;#8217;s&lt;span&gt; pretty much it.  The first gotcha I noticed when doing this was that since I was replacing all the content rapidly:&lt;/span&gt;&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4654646" target="_blank"&gt;https://gist.github.com/4654646&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;I would not be shocked to learn that this caused performance issues with a lot of events like this added.  I&amp;#8217;d also not be shocked to learn the opposite, so I&amp;#8217;d probably test, and &lt;a href="http://kellegous.com/j/2013/01/26/layout-performance/" target="_blank"&gt;this was on hacker news this morning&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;So onto the actual stuff, first we have the html, notice all it really does is load 1 css file and a bunch of scripts&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4660033" target="_blank"&gt;https://gist.github.com/4660033&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;next we have our mustache templates, notice the use of CoffeeScripts triple quoted strings, use of partials, and my disdain for tabs and readability when it&amp;#8217;s not forced upon me by CoffeeScript&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4660100" target="_blank"&gt;https://gist.github.com/4660100&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;next we have a few misc function and the big update one, this does a couple that i&amp;#8217;d consider Wrong and want to refactor out if this was for a real project, notable iterating through every object every time something changes, this is not going to scale to more docs very well. We also delete everything and rebuild the page from scratch every time anything changes if I was redoing this I&amp;#8217;d break up the page into sections that could be re build individually. &lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4660123" target="_blank"&gt;https://gist.github.com/4660123&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Lastly we have the jquery on load which mostly just sets up a bunch of events and the on database change which just makes sure it isn&amp;#8217;t a design document and then replaces the document unless its been deleted in which case it&amp;#8217;s deleted. &lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4660159" target="_blank"&gt;https://gist.github.com/4660159&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Put that all together, and what do you get, &lt;a href="http://calvin.iriscouch.com/pd/_design/pouch/index.html" target="_blank"&gt;THIS DEMO!&lt;/a&gt; feel free to leave a note, etc. &lt;/p&gt;
&lt;p&gt;There you have it, next time I&amp;#8217;ll probably do something related to &lt;a href="https://github.com/daleharvey/pouchdb/pull/384" target="_blank"&gt;this new development&lt;/a&gt; and &lt;a href="http://leafletjs.com/" target="_blank"&gt;leaflet&lt;/a&gt;. Feel free to &lt;a href="https://twitter.com/CWMma" target="_blank"&gt;follow me on twitter&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And with that I leave you with &lt;a href="http://youtu.be/l7iVsdRbhnc" target="_blank"&gt;this video&lt;/a&gt; (omg nsfw) which was going to be basis of an explanation of how binary trees work until I remembered &lt;a href="https://github.com/daleharvey" target="_blank"&gt;@daleharvey&lt;/a&gt; was Scottish.&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/41782044503</link><guid>http://cwmma.tumblr.com/post/41782044503</guid><pubDate>Tue, 29 Jan 2013 08:30:36 -0500</pubDate><category>pouchdb</category><category>couchdb</category><category>js</category><category>javascript</category><category>mustache</category><category>indexeddb</category><category>mobile</category><category>coffeescript</category></item><item><title>In which we explain how to use PouchDB</title><description>&lt;p&gt;This is a follow up to my &lt;a href="http://cwmma.tumblr.com/post/39926807885/pouchdb-an-intro" target="_blank"&gt;previous PouchDB post&lt;/a&gt;, so if you can&amp;#8217;t read that you probably are going to want to. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://pouchdb.com/" target="_blank"&gt;PouchDB&lt;/a&gt; is local storage primarily using IndexedDB, but with a WebSQL fallback, even if you arn&amp;#8217;t doing crazy replications PouchDB may still be a easier to use because, do you understand IndexedDB? &lt;a href="https://developer.mozilla.org/en-US/docs/IndexedDB/Using_IndexedDB" target="_blank"&gt;Because I don&amp;#8217;t&lt;/a&gt;. Pouch on the other hand has an &lt;a href="http://pouchdb.com/api.html" target="_blank"&gt;API&lt;/a&gt; based on &lt;a href="http://wiki.apache.org/couchdb/Complete_HTTP_API_Reference" target="_blank"&gt;CouchDB&amp;#8217;s API&lt;/a&gt; which in turn is based on &lt;a href="http://en.wikipedia.org/wiki/Http" target="_blank"&gt;HTTP&lt;/a&gt;.  Your DB stores documents, which is just &lt;a href="http://www.json.org/" target="_self"&gt;JSON&lt;/a&gt; but with two special fields (note the underscores):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;_id: this you can add your self, but if not it&amp;#8217;s added for you, this is the documents key, if you want to find it you&amp;#8217;ll need this.&lt;/li&gt;
&lt;li&gt;_rev: this is the documents revision, this is what couch has instead of transactions, if you want to modify a document or delete it, you need the _rev of the version you want to change, that way if someone else modifies it first it won&amp;#8217;t match.&lt;/li&gt;
&lt;li&gt;There are actually &lt;a href="http://wiki.apache.org/couchdb/HTTP_Document_API#Special_Fields" target="_blank"&gt;7 more&lt;/a&gt;, but we you can safely ignore them for now.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;You update Couch via http and all the methods are based on HTTP verbs, Pouch&amp;#8217;s methods are the same (though it should be pointed out that HTTP verbs are traditionally written in all caps but are not case sensitive, but JavaScript methods are case sensitive and lowercase):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;POST: create a new new document and assigns it a random _id, use this if you don&amp;#8217;t care what the key is (i.e. your using it programmatically).&lt;/li&gt;
&lt;li&gt;PUT: Use this to either update a document, in which case you need to supply the _id and _rev, or to create a document with your chosen _id, in which case you don&amp;#8217;t need _rev. &lt;/li&gt;
&lt;li&gt;GET:  This is for getting a document, you need the _id obviously. &lt;/li&gt;
&lt;li&gt;DELETE/REMOVE: This is one deviation between Couch and Pouch as &amp;#8220;delete&amp;#8221; is a reserved word in JavaScript, don&amp;#8217;t forget you need the _rev.   This actually just adds _deleted:true which in Couch means that next time the database is compacted previous version can be removed, note you can&amp;#8217;t remove it entirely because if you did you wouldn&amp;#8217;t be able to tell other databases so when you replicated. &lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Now onto Pouch specific things: the first thing to know is that like IndexedDB Pouch is asynchronous. , compare this which is synchronous JavaScript code&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4507762" target="_blank"&gt;https://gist.github.com/4507762&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;with this async code&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4507817" target="_blank"&gt;https://gist.github.com/4507817&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;The reason for this async set up is so as not to block the execution, unless you are using workers (which you likely aren&amp;#8217;t, see my &lt;a href="https://github.com/calvinmetcalf/communist" target="_blank"&gt;previous post&lt;/a&gt;) all of your script is in one thread, but the IndexedDB is in another thread and when you ask it to get you something instead of putting you on hold it just asks you for a number to call you when it&amp;#8217;s found it. Pouch follows the Node.js convention of the first argument given to any callback will be an error argument which will be null/undefined/false if there is not an error meaning you can use if(!err) to check for an error and be the last argument you give to the function (the callback that is), hopefully this makes more sense:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4519828" target="_blank"&gt;https://gist.github.com/4519828&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Ok now for some basic Pouch usage which we will demonstrate by building a sample app &amp;#8230;sort of, this post is really long so instead were going to create a class that will serve as the core of the app we will make next time, for serious.&lt;/p&gt;
&lt;p&gt;Note unlike the previous code, this code is going to be in CoffeeScript, when I&amp;#8217;m not writing directly for the browser this is what I tend to use for a variety of reasons which I go into excessive detail about at the end of &lt;a href="http://cwmma.tumblr.com/post/39217946858/on-web-workers-and-communist-js" target="_blank"&gt;this previous post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So the first thing we&amp;#8217;re going to need is a constructor function, it&amp;#8217;s going to take a url as its first argument and implement the pattern from my previous post.The second argument its going to take is an on change function, this is the function that will be called every time a document is changed either remotely or locally.&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4520740" target="_blank"&gt;https://gist.github.com/4520740&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;We want to be able to&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Add a new document&lt;/li&gt;
&lt;li&gt;Get a document&lt;/li&gt;
&lt;li&gt;Delete one&lt;/li&gt;
&lt;/ul&gt;&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4520785" target="_blank"&gt;https://gist.github.com/4520785&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Which put together looks like&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4520837" target="_blank"&gt;https://gist.github.com/4520837&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;And there you have a basic PouchDB class next time we&amp;#8217;ll make a working app for real, just have to figure out what I was originally going to show something based on &lt;a href="http://leafletjs.com/" target="_blank"&gt;leaflet&lt;/a&gt; like my &lt;a href="https://github.com/calvinmetcalf/leaflet.pouch" target="_blank"&gt;leaflet.pouch&lt;/a&gt; but that might require too much knowledge of how leaflet works, feel free to hit me up on &lt;a href="https://twitter.com/CWMma" target="_blank"&gt;twitter&lt;/a&gt; with suggestions.&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/40516499487</link><guid>http://cwmma.tumblr.com/post/40516499487</guid><pubDate>Mon, 14 Jan 2013 08:30:41 -0500</pubDate><category>CouchDB</category><category>IndexedDB</category><category>JavaScript</category><category>PouchDB</category><category>CoffeeScript</category></item><item><title>PouchDB: an intro</title><description>&lt;p&gt;So I&amp;#8217;ve been hacking around with &lt;a href="http://pouchdb.com/" target="_blank"&gt;PouchDB&lt;/a&gt; a bit lately and I’m going to explain why I think it is so awesome.&lt;/p&gt;
&lt;p&gt;Before we discus PouchDB we’re going to need to talk about CouchDB which Pouch is based on. &lt;a href="http://couchdb.apache.org/" target="_blank"&gt;CouchDB&lt;/a&gt; is an open source nosql document database written in Erlang that &lt;a href="http://www.wired.com/wiredenterprise/2012/12/couchdb/" target="_blank"&gt;grew out of Lotus Notes&lt;/a&gt; of all things. I’m personally a fan of CouchDB but of it’s features the ones that matters here are, data is stored in JSON, you use JavaScript to query the data, you communicate with it entirely through a &lt;a href="http://en.wikipedia.org/wiki/Representational_state_transfer" target="_blank"&gt;RESTful&lt;/a&gt; interface, and something called “Master-Master Replication,” now to put that in terms &lt;a href="http://kublaikat.tumblr.com/" target="_blank"&gt;my cat&lt;/a&gt; would understand, this means that two databases can sync without one being master and the other slave but as equals, and this done in a way such that replication can be done in real time or sporadically. Think of email on your cellphone, you can have it so that it tries to sync every x minutes which just fails if it has no reception, or you can set it up so then when you have service you get push notification and when you loose reception you just get all of the emails when you get reception again. This is similar to how Couch can work, though it can be much more complex as well. If you want to know more about Couch then &lt;a href="http://guide.couchdb.org/" target="_blank"&gt;CouchDB: The Definitive Guide&lt;/a&gt; is a good place to start.&lt;/p&gt;
&lt;p&gt;So one of the issues with CouchDB is that Erlang…well lets just say people have mixed feelings about it, which lead to pretty quickly, CouchDB compatible Databases, &lt;a href="http://bigcouch.cloudant.com/" target="_blank"&gt;Big Couch from Cloudant&lt;/a&gt; which you can cluster, &lt;a href="http://labs.couchbase.com/TouchDB-iOS/" target="_blank"&gt;TouchDB&lt;/a&gt; is a version written in Objective-C targeting embedded apps, and then we have PouchDB.&lt;/p&gt;
&lt;p&gt;PouchDB is written in JavaScript and targets the browser, but also works with Node.js. It has a number of different back ends that it can use so at the very basic you can run this (notice the Node.js style async callbacks, they always are function which take as a first argument an err object which is undefined unless there is an error):&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4469112" target="_blank"&gt;&lt;a href="https://gist.github.com/4469112" target="_blank"&gt;https://gist.github.com/4469112&lt;/a&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Which lets you access and modify a CouchDB on the same origin like so.&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" src="http://media.tumblr.com/67349ae8619d9ee62aca5c208d4af0c2/tumblr_inline_mg7vfaau1N1r9dbm0.png"/&gt;&lt;/p&gt;
&lt;p&gt;The benefits of this setup is that it works on browsers as old as Internet Explorer 8, but on the other hand this only works with an internet connection.&lt;/p&gt;
&lt;p&gt;We can also set up one locally like this:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4469674" target="_blank"&gt;&lt;a href="https://gist.github.com/4469674" target="_blank"&gt;https://gist.github.com/4469674&lt;/a&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;This uses either IndexedDB or Web SQL depending on whats available and works on on all browsers except Internet Explorer versions besides 10. This is nice because we can create a large local storage with the same API whether on Chrome, Firefox, or mobile Safari, and the API is a whole lot easier then the IndexedDB API.&lt;/p&gt;
&lt;p&gt;Now the neat thing we can do is combine the local and remote data sources with:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/4469426" target="_blank"&gt;&lt;a href="https://gist.github.com/4469426" target="_blank"&gt;https://gist.github.com/4469426&lt;/a&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Which sets a pouch db up that syncs to a local database (either IndexedDB or web SQL) which syncs to a remote CouchDB, like so:&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" src="http://media.tumblr.com/bc73ab0be3ecc4cfff0fd353abdee17a/tumblr_inline_mg7x8fqfMw1r9dbm0.png"/&gt;&lt;/p&gt;
&lt;p&gt;If the browser looses it’s internet connection it can then still work with the local database, and it then can sync when it gets internet access again. If the browser doesn&amp;#8217;t support IndexedDB or webSQL it just creates a direct connection to the remote Couch.&lt;/p&gt;
&lt;p&gt;You can checkout Pouch on:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://pouchdb.com/" target="_blank"&gt;It&amp;#8217;s website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/daleharvey/pouchdb" target="_blank"&gt;Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/pouchdb" target="_blank"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Next time, example apps.&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/39926807885</link><guid>http://cwmma.tumblr.com/post/39926807885</guid><pubDate>Mon, 07 Jan 2013 08:30:28 -0500</pubDate><category>CouchDB</category><category>IndexedDB</category><category>PouchDB</category><category>WebSQL</category><category>js</category><category>JavaScript</category></item><item><title>On Communist.js improved</title><description>&lt;p&gt;Two quick notes about &lt;a href="https://github.com/calvinmetcalf/communist" target="_blank"&gt;Communist.js&lt;/a&gt; a library for working with web workers I wrote about in &lt;a href="http://cwmma.tumblr.com/post/39217946858/on-web-workers-and-communist-js" target="_blank"&gt;a previous post&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;I totally blanked and forgot to put in a license, it&amp;#8217;s MIT btw and that&amp;#8217;s now reflected.&lt;/li&gt;
&lt;li&gt;Added a default function if you don&amp;#8217;t specify it that makes it more RPC like, so if you invoke it without an argument, then you can use the method add which takes 2 parameters a name and a function(e.g. var comrade = communist();comrade.add(&amp;#8220;name&amp;#8221;,function(){};), then when you can do this with multiple functions, the main difference is that the parameters for send are now name of function to evoke, params for function, callback e.g. comrade.send(&amp;#8220;name&amp;#8221;,param1,param2,&amp;#8230;,cb);.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;That is all for now, comeback next time for, Communist.js in the wild as I use it for something, or PouchDB, whichever I bother to write first.&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/39518363166</link><guid>http://cwmma.tumblr.com/post/39518363166</guid><pubDate>Wed, 02 Jan 2013 19:41:18 -0500</pubDate><category>webworkers</category><category>javascript</category><category>js</category></item><item><title>On web workers and Communist.js</title><description>&lt;a href="https://github.com/calvinmetcalf/communist"&gt;On web workers and Communist.js&lt;/a&gt;: &lt;p&gt;Alright so this isn’t actually about maps, it’s about JavaScript, which I end up using to make maps most of the time anyway, so that’s why it’s related. I’ve been working on library to help make JavaScript &lt;a href="https://developer.mozilla.org/en-US/docs/DOM/Worker" target="_blank"&gt;web workers&lt;/a&gt; easier to use.&lt;/p&gt;
&lt;p&gt;First off, the idea with web workers is to be be able to do stuff on a webpage without blocking. On a web page everything is done in the same thread, so if something your doing take a while, it prevents everything else form working and can cause the page to freeze, in &lt;a href="http://calvinmetcalf.github.com/communist/" target="_blank"&gt;this example&lt;/a&gt; you can see that by hitting the red button, or running it in Internet Explorer versions older then 10. Hitting the green button executes that long script as a worker and thus the time keeps ticking. &lt;/p&gt;
&lt;p&gt;The two main issues that seem to be keeping workers from being more widely used are:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Internet Explorer&lt;/li&gt;
&lt;li&gt;Having to load the worker script as a separate file. &lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;First, Internet Explorer doesn’t support workers until version 10, the one that just came out and &lt;a href="http://www.w3schools.com/browsers/browsers_explorer.asp" target="_blank"&gt;nobody uses&lt;/a&gt;. This means that your almost definitely going to have people viewing on clients that don’t support workers.&lt;/p&gt;
&lt;p&gt;You have to load the worker script from a separate file, now I can see the reasoning behind this restriction as it keeps the 2 contexts separated. But it introduces a couple of issues,&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Poly fills are much trickier (though I then found this &lt;a href="http://code.google.com/p/ie-web-worker/" target="_blank"&gt;polyfill&lt;/a&gt; right after I wrote that).&lt;/li&gt;
&lt;li&gt;Can’t use them with CDN hosted scripts, the worker script has to obey the same origin policy of the html page that it’s run on, but the script that’s calling it does not. &lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;So my idea to deal with this is a &lt;a href="https://github.com/calvinmetcalf/communist" target="_blank"&gt;library I’ve been writing called Communist.js&lt;/a&gt; (why the title, because it cares about the workers). It works around the pattern of write a function, create a new Communist with that function, then send the communist data and a callback, and the communist executes the function in the other thread and calls the callback with the result. If the client doesn’t support web workers it gets executed in thread by a function I call Socialist (Can you tell I wrote for a humor magazine in college?).&lt;/p&gt;
&lt;p&gt;Under the hood, Communist is turning the function into a string, templating it with some code to handle message passing, and turning that string into a blob file, which we are then creating a blob URL out of the blob which we are using to make the worker.  This is based on the &lt;a href="https://developer.mozilla.org/en-US/docs/DOM/Using_web_workers?redirectlocale=en-US&amp;redirectslug=Using_web_workers#Embedded_workers" target="_blank"&gt;“inline worker” example&lt;/a&gt; on the MDN page about using worker, but updated to take into account blob builder being deprecated. This method does have some drawbacks, notably you will get an error if your function references a variable defined outside the function. &lt;/p&gt;
&lt;p&gt;Now Socialist ended up giving me much more grief, as I ended up having to recreated certain parts of the worker global object that acted subtly different there as opposed to when executed in the regular context.  Notably setInterval which calls it’s it’s function with window as the context even when it’s called from a function with a different context. &lt;/p&gt;
&lt;p&gt;So it still needs some work, but don’t hesitate to &lt;a href="https://github.com/calvinmetcalf/communist" target="_blank"&gt;fork it on Github&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;P.S. you may notice I decided to write it in CoffeeScript.  Now why would I do that? My growing appreciation for CoffeeScript really deserves its own blog post but quickly:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Splats… are really helpful.  This is a features where you can write your function to take (arrgs…, finalArg) and you get an array of values called arrgs and a variable called finalArg, you can also do (one, two, rest…) or you can execute with an array like func(params…).  While I know this is just syntactic sugar for stuff you can do in JavaScript, it’s really nice not to have to worry about that when you do it a bunch.&lt;/li&gt;
&lt;li&gt;Indentation, my code is so much neater when it isn’t optional.&lt;/li&gt;
&lt;li&gt;Prototype as ::.  I just think it looks cool.&lt;/li&gt;
&lt;li&gt;Class keyword, this makes much of the prototype mess much easier (and ironically means I never got to use :: in this library).&lt;/li&gt;
&lt;/ul&gt;</description><link>http://cwmma.tumblr.com/post/39217946858</link><guid>http://cwmma.tumblr.com/post/39217946858</guid><pubDate>Sun, 30 Dec 2012 10:19:26 -0500</pubDate><category>JS</category><category>JavaScript</category><category>WebWorkers</category><category>CoffeeScript</category></item><item><title>the @avidgeo folks upon learning the osgeo summer code sprint was going to be in boston</title><description>&lt;p&gt;the @avidgeo folks upon learning the osgeo summer code sprint was going to be in boston&lt;img src="https://dl.dropbox.com/u/10192015/dsm.gif"/&gt;&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/34356350365</link><guid>http://cwmma.tumblr.com/post/34356350365</guid><pubDate>Fri, 26 Oct 2012 08:30:30 -0400</pubDate></item><item><title>CouchDB Presentation</title><description>&lt;a href="http://calvinmetcalf.github.com/glowing-hipster"&gt;CouchDB Presentation&lt;/a&gt;: &lt;p&gt;I gave a presentation at&lt;a href="http://avidgeo.com" title="Avid Geo" target="_blank"&gt; avid geo&lt;/a&gt; yesterday about couchdb and what it’s good (and not good) for.&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/33914531410</link><guid>http://cwmma.tumblr.com/post/33914531410</guid><pubDate>Fri, 19 Oct 2012 17:36:09 -0400</pubDate><category>couchdb</category><category>nosql</category><category>wifi</category></item><item><title>Density</title><description>&lt;a href="http://goo.gl/95QwN"&gt;Density&lt;/a&gt;: &lt;p&gt;Quick link to a map i made of ma population density by 2010 census blocks&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/33772025958</link><guid>http://cwmma.tumblr.com/post/33772025958</guid><pubDate>Wed, 17 Oct 2012 09:59:54 -0400</pubDate></item><item><title>Street types by voter</title><description>&lt;p&gt;Totally forgot that there is another source of street types, the voter record and yes I do have a copy of the 2010 voter record, all 3883893 records, so street types by how many people were registered to vote at them in 2010&lt;/p&gt;
&lt;p&gt;&lt;iframe frameborder="0" height="450" marginheight="0" marginwidth="0" scrolling="no" src="https://dl.dropbox.com/u/10192015/streetpie.html" width="900"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;But the voter file, now that has some other stats we can work off of, like party&lt;/p&gt;
&lt;p&gt;&lt;iframe frameborder="0" height="450" marginheight="0" marginwidth="0" scrolling="no" src="https://dl.dropbox.com/u/10192015/party.html" width="900"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;That N stands for unenrolled FWI and the reason it&amp;#8217;s so popular is that unenrolled voters can vote in any primary, but enrolled voters can only vote in their own. This does help by telling us that anyone listed as being a member in a party must care that much more, so, how do the parties stack up.&lt;/p&gt;
&lt;p&gt;&lt;iframe frameborder="0" height="450" marginheight="0" marginwidth="0" scrolling="no" src="https://dl.dropbox.com/u/10192015/dPie.html" width="900"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Much more likely to live on a street and less likely to live on anything else, Lane even falls bellow the cut off (4%), so how about Republicans.&lt;/p&gt;
&lt;p&gt;&lt;iframe frameborder="0" height="450" marginheight="0" marginwidth="0" scrolling="no" src="https://dl.dropbox.com/u/10192015/rPie.html" width="900"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;In which we see the reverse, this most likely has to do with the suburban nature of MA republican voters vs the Urban Democratic voter now for unenrolled?&lt;/p&gt;
&lt;p&gt;&lt;iframe frameborder="0" height="450" marginheight="0" marginwidth="0" scrolling="no" src="https://dl.dropbox.com/u/10192015/nPie.html" width="900"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;An very similar breakdown to the overall suggesting my follow up should be based on which primaries they tended to vote in. Now what about green party?&lt;/p&gt;
&lt;p&gt;&lt;iframe frameborder="0" height="450" marginheight="0" marginwidth="0" scrolling="no" src="https://dl.dropbox.com/u/10192015/gPie.html" width="900"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Un suprisingly they are like democrats, but more so. Sadly I forgot to write a view for the Libritarian party, and the Pirate party wasn&amp;#8217;t set up in 2010. For now, thats all.&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/32732346498</link><guid>http://cwmma.tumblr.com/post/32732346498</guid><pubDate>Tue, 02 Oct 2012 08:16:50 -0400</pubDate><category>voter</category><category>geo</category></item><item><title>Full List</title><description>&lt;p&gt;Haven&amp;#8217;t had as much time as I&amp;#8217;d like today but here is the full list of things that roads are called in MA, there are over 300 and some are weird&lt;/p&gt;
&lt;p&gt;&lt;iframe frameborder="no" height="900" scrolling="yes" src="https://www.google.com/fusiontables/embedviz?viz=GVIZ&amp;amp;t=TABLE&amp;amp;containerId=gviz_canvas&amp;amp;q=select+col0%2C+col1%2C+col3%2C+col4+from+1ZLcuTI-nEwCWJGvUjvN5sZgYfn1GsWrmITn6YiU" width="600"&gt;&lt;/iframe&gt;&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/30994392365</link><guid>http://cwmma.tumblr.com/post/30994392365</guid><pubDate>Thu, 06 Sep 2012 09:52:39 -0400</pubDate><category>map</category><category>chart</category><category>table</category></item><item><title>road lengths</title><description>&lt;p&gt;so after reading &lt;a href="http://bostonography.com/" title="bostonography's" target="_blank"&gt;bostonography&amp;#8217;s&lt;/a&gt; &lt;a href="http://bostonography.com/2012/street-road-and-avenue/" title="street ave road" target="_blank"&gt;awesome post&lt;/a&gt; on Boston road types, was inspired to do some figures for road vs street vs lane but across the commonwealth.  First we can look at by count.&lt;/p&gt;
&lt;p&gt;&lt;iframe frameborder="no" height="500" scrolling="no" src="https://www.google.com/fusiontables/embedviz?containerId=gviz_canvas&amp;amp;q=select+col0%2C+col1+from+1ZLcuTI-nEwCWJGvUjvN5sZgYfn1GsWrmITn6YiU+order+by+col1+desc+limit+100&amp;amp;uiversion=2&amp;amp;viz=GVIZ&amp;amp;t=PIE&amp;amp;att=true&amp;amp;width=700&amp;amp;height=485" width="700"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;you&amp;#8217;ll notice &amp;#8220;street&amp;#8221; is the top followed by &amp;#8220;road&amp;#8221; and &amp;#8220;avenue&amp;#8221;.&lt;/p&gt;
&lt;p&gt;But if we look by length (in km) then &amp;#8220;road&amp;#8221; is first followed by &amp;#8220;street&amp;#8221; and &amp;#8220;avenue&amp;#8221; still in third.&lt;/p&gt;
&lt;p&gt;&lt;iframe frameborder="no" height="500" scrolling="no" src="https://www.google.com/fusiontables/embedviz?containerId=gviz_canvas&amp;amp;q=select+col0%2C+col4+from+1ZLcuTI-nEwCWJGvUjvN5sZgYfn1GsWrmITn6YiU+order+by+col4+desc+limit+100&amp;amp;uiversion=2&amp;amp;viz=GVIZ&amp;amp;t=PIE&amp;amp;att=true&amp;amp;width=700&amp;amp;height=485" width="700"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Implying that their are less roads then streets but streets are longer. You&amp;#8217;ll notice also Highway makes the list by length, this includes both roads commonly called highway, like McGrath Highway in Somerville (or Quincy) and roads not like Yankee Division Highway (aka 128). A similar story with Turnpike though I&amp;#8217;m pretty sure that there is only such a high count due to me counting a road that crosses a town boarder as two roads for the count.   More data when I have time to crunch the data.&lt;/p&gt;</description><link>http://cwmma.tumblr.com/post/30936217674</link><guid>http://cwmma.tumblr.com/post/30936217674</guid><pubDate>Wed, 05 Sep 2012 11:47:11 -0400</pubDate><category>maps</category><category>charts</category></item></channel></rss>
