<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
 <title>Seth Mason</title>
 
 <link href="http://sethmason.com/" />
 <updated>2013-01-01T19:39:56-08:00</updated>
 <id>http://sethmason.com/</id>
 <author>
   <name>Seth Mason</name>
   <email>seth@sethmason.com</email>
 </author>

 
 <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/sethmason" /><feedburner:info uri="sethmason" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
   <title>Books I Read in 2012</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/X9jb8LhdCWM/books-i-read-in-2012.html" />
   <updated>2012-12-31T00:00:00-08:00</updated>
   <id>http://sethmason.com/2012/12/31/books-i-read-in-2012</id>
   <content type="html">&lt;p&gt;Oy vey. So, it seems like I only post here once a year and it&amp;#8217;s only to list books that I read. Well, at least I&amp;#8217;m consistent right?&lt;/p&gt;

&lt;p&gt;I kind of went undead crazy this year what with reading the two Justin Cronin books as well as Colson Whitehead&amp;#8217;s foray into post-apocalyptic zombie prose.&lt;/p&gt;

&lt;p&gt;Favorites from this year include (in no particular order) &lt;a href='http://www.amazon.com/gp/search?keywords=9780679745068&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Et
Tu, Babe&lt;/a&gt;, &lt;a href='http://www.amazon.com/gp/search?keywords=9780375726408&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Empire
Falls&lt;/a&gt;, &lt;a href='http://www.amazon.com/gp/search?keywords=9780385343831&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The
Tiger's Wife&lt;/a&gt; and &lt;a href='http://www.amazon.com/gp/search?keywords=9780345459404&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Perdido
Street Station&lt;/a&gt;. &lt;a href='http://www.amazon.com/gp/search?keywords=9780316126694&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The
Art of Fielding&lt;/a&gt; was really entertaining too though the ending was very strange.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780316057554&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Winter's Bone&lt;/a&gt; by Daniel Woodrell &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780142437209&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Jane Eyre&lt;/a&gt; by Charlotte Brontë &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780679745068&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Et Tu, Babe&lt;/a&gt; by Mark Leyner &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781936365746&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;A Hologram for the King&lt;/a&gt; by Dave Eggers &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780345504982&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Twelve (The Passage, #2)&lt;/a&gt; by Justin Cronin &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780385528078&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Zone One&lt;/a&gt; by Colson Whitehead &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781449319793&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Python for Data Analysis&lt;/a&gt; by Wes McKinney &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780345504968&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Passage (The Passage, #1)&lt;/a&gt; by Justin Cronin &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780375507250&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Cloud Atlas&lt;/a&gt; by David Mitchell &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781439138311&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Brooklyn&lt;/a&gt; by Colm Tóibín &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780316126694&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Art of Fielding&lt;/a&gt; by Chad Harbach &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780307887894&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Lean Startup: How Today's Entrepreneurs Use Continuous Innovation to Create Radically Successful Businesses&lt;/a&gt; by Eric Ries &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780374271565&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Submission&lt;/a&gt; by Amy Waldman &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780307887436&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Ready Player One&lt;/a&gt; by Ernest Cline &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780345458421&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Iron Council (New Crobuzon, #3)&lt;/a&gt; by China Miéville &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781935182979&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;RabbitMQ in Action: Distributed Messaging for Everyone&lt;/a&gt; by Alvaro Videla &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780345497512&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The City &amp;amp; the City&lt;/a&gt; by China Miéville &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780307263995&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Swamplandia!&lt;/a&gt; by Karen Russell &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780345460011&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Scar (New Crobuzon, #2)&lt;/a&gt; by China Miéville &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780547576725&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;We the Animals&lt;/a&gt; by Justin Torres &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780345459404&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Perdido Street Station (New Crobuzon, #1)&lt;/a&gt; by China Miéville &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780385343664&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Imperfectionists&lt;/a&gt; by Tom Rachman &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780307269645&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;You are Not a Gadget&lt;/a&gt; by Jaron Lanier &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780688161125&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Replay&lt;/a&gt; by Ken Grimwood &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781408808870&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Finkler Question&lt;/a&gt; by Howard Jacobson &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780061054884&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Dispossessed&lt;/a&gt; by Ursula K. Le Guin &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780385343831&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Tiger's Wife&lt;/a&gt; by Téa Obreht &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781451627282&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;11/22/63&lt;/a&gt; by Stephen King &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780375726408&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Empire Falls&lt;/a&gt; by Richard Russo &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780385334174&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Deadeye Dick&lt;/a&gt; by Kurt Vonnegut &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780743431675&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Call for the Dead (George Smiley, #1)&lt;/a&gt; by John le Carré &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780192801692&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Secret Agent&lt;/a&gt; by Joseph Conrad &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780140285604&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Cat’s Cradle&lt;/a&gt; by Kurt Vonnegut &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781840224023&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Uncle Tom's Cabin&lt;/a&gt; by Harriet Beecher Stowe &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780140287820&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Death in Summer&lt;/a&gt; by William Trevor &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Full disclosure: Most of the book links on this page are Amazon affiliate links so I get to pay off my bookie that much quicker if you buy something.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=X9jb8LhdCWM:XVM2ohP7PhM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=X9jb8LhdCWM:XVM2ohP7PhM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=X9jb8LhdCWM:XVM2ohP7PhM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=X9jb8LhdCWM:XVM2ohP7PhM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=X9jb8LhdCWM:XVM2ohP7PhM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/X9jb8LhdCWM" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2012/12/31/books-i-read-in-2012.html</feedburner:origLink></entry>
 
 <entry>
   <title>Using Pandas to stalk your neighbors</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/1EXhuFwRGuU/using-pandas-to-stalk-your-neighbors.html" />
   <updated>2012-11-17T00:00:00-08:00</updated>
   <id>http://sethmason.com/2012/11/17/using-pandas-to-stalk-your-neighbors</id>
   <content type="html">&lt;p&gt;I picked up the book &lt;a href='http://www.amazon.com/gp/product/1449319793/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1449319793&amp;amp;linkCode=as2&amp;amp;tag=slackorama-20'&gt;Python for Data Analysis&lt;/a&gt; as I&amp;#8217;ve been seeing it mentioned in quite a few places. And so far, it&amp;#8217;s great. A very good high level overview of using &lt;a href='http://pandas.pydata.org'&gt;Pandas&lt;/a&gt;. No, not the cute kind of pandas. I&amp;#8217;m talking about the Python library for data analysis. Derp.&lt;/p&gt;

&lt;p&gt;Anyhow, I decided to dive in and see what I could find out about my neighbors. Chapter 9 of &lt;a href='http://www.amazon.com/gp/product/1449319793/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1449319793&amp;amp;linkCode=as2&amp;amp;tag=slackorama-20'&gt;the book&lt;/a&gt; goes into analyzing the &lt;a href='http://www.fec.gov/disclosurep/PDownload.do'&gt;2012 Federal Election Commission Database&lt;/a&gt; so I loaded it up:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='pycon'&gt;&lt;span class='gp'&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class='kn'&gt;import&lt;/span&gt; &lt;span class='nn'&gt;pandas&lt;/span&gt; &lt;span class='kn'&gt;as&lt;/span&gt; &lt;span class='nn'&gt;pd&lt;/span&gt;
&lt;span class='gp'&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class='n'&gt;fec&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;pd&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;read_csv&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;P00000001-ALL.csv&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Looking into the data, there is some garbage rows. I grabbed all the Culver City zip codes (well, the zip codes I care about) at least:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='pycon'&gt;&lt;span class='gp'&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class='n'&gt;zips&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;fec&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;contbr_zip&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;unique&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt;
&lt;span class='gp'&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class='n'&gt;mask&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;np&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;array&lt;/span&gt;&lt;span class='p'&gt;([&lt;/span&gt;&lt;span class='nb'&gt;str&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;x&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;startswith&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;90232&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='n'&gt;x&lt;/span&gt; &lt;span class='ow'&gt;in&lt;/span&gt; &lt;span class='n'&gt;zips&lt;/span&gt;&lt;span class='p'&gt;])&lt;/span&gt;
&lt;span class='gp'&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class='n'&gt;fec&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;fec&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;contbr_zip&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;isin&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;zips&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;mask&lt;/span&gt;&lt;span class='p'&gt;])]&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;contbr_city&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;value_counts&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt;
&lt;span class='go'&gt;CULVER CITY     241&lt;/span&gt;
&lt;span class='go'&gt;CUILVER CITY      2&lt;/span&gt;
&lt;span class='go'&gt;SANTA MONICA      1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I don&amp;#8217;t know if these come from bad data from the contributor or from the FEC so I&amp;#8217;m just going to include everything based on zip code.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='pycon'&gt;&lt;span class='gp'&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class='n'&gt;culver&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;fec&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;fec&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;contbr_zip&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;isin&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;zips&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;mask&lt;/span&gt;&lt;span class='p'&gt;])]&lt;/span&gt;
&lt;span class='gp'&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class='n'&gt;culver&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;contb_receipt_amt&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;sum&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt;
&lt;span class='go'&gt;58341.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Fifty-eight grand! Nice going Culver City!&lt;/p&gt;

&lt;p&gt;Now let&amp;#8217;s see who got the money:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='pycon'&gt;&lt;span class='gp'&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class='n'&gt;culver&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;pivot_table&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;contb_receipt_amt&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;rows&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;cand_nm&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;aggfunc&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='nb'&gt;sum&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='go'&gt;cand_nm&lt;/span&gt;
&lt;span class='go'&gt;Huntsman, Jon                      4500&lt;/span&gt;
&lt;span class='go'&gt;Obama, Barack                     50381&lt;/span&gt;
&lt;span class='go'&gt;Paul, Ron                           500&lt;/span&gt;
&lt;span class='go'&gt;Roemer, Charles E. &amp;#39;Buddy&amp;#39; III      110&lt;/span&gt;
&lt;span class='go'&gt;Romney, Mitt                       2850&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That&amp;#8217;s kind of interesting&amp;#8230;Huntsman got more money from the 90232 than Romney.&lt;/p&gt;

&lt;p&gt;Now, let&amp;#8217;s check out the occupations that contributed the most:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='pycon'&gt;&lt;span class='gp'&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class='n'&gt;culver&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;pivot_table&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;contb_receipt_amt&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;rows&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;contbr_occupation&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
&lt;span class='gp'&gt;... &lt;/span&gt;&lt;span class='n'&gt;aggfunc&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='nb'&gt;sum&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;order&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;ascending&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='bp'&gt;False&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;head&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;10&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='go'&gt;contbr_occupation&lt;/span&gt;
&lt;span class='go'&gt;RETIRED                               7272.0&lt;/span&gt;
&lt;span class='go'&gt;ACCOUNT MANAGER                       5000.0&lt;/span&gt;
&lt;span class='go'&gt;VICE PRESIDENT, INTERNET MARKETING    4000.0&lt;/span&gt;
&lt;span class='go'&gt;PROFESSOR                             2800.5&lt;/span&gt;
&lt;span class='go'&gt;PRESIDENT &amp;amp; C.E.O.                    2500.0&lt;/span&gt;
&lt;span class='go'&gt;GALLERY OWNER                         2500.0&lt;/span&gt;
&lt;span class='go'&gt;BOOKKEEPER                            2500.0&lt;/span&gt;
&lt;span class='go'&gt;HOMEMAKER                             1971.0&lt;/span&gt;
&lt;span class='go'&gt;INTERIOR DESIGNER                     1500.0&lt;/span&gt;
&lt;span class='go'&gt;WRITER                                1410.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Retirees going large. That&amp;#8217;s kind of interesting. Let&amp;#8217;s look at that.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='pycon'&gt;&lt;span class='gp'&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class='n'&gt;culver&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;culver&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;contbr_occupation&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;RETIRED&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;pivot_table&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
&lt;span class='gp'&gt;... &lt;/span&gt;&lt;span class='s'&gt;&amp;#39;contb_receipt_amt&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;rows&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;cand_nm&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;aggfunc&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='nb'&gt;sum&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='go'&gt;cand_nm&lt;/span&gt;
&lt;span class='go'&gt;Obama, Barack                     7162&lt;/span&gt;
&lt;span class='go'&gt;Roemer, Charles E. &amp;#39;Buddy&amp;#39; III      10&lt;/span&gt;
&lt;span class='go'&gt;Romney, Mitt                       100&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Maybe I misunderstand our local retirees (at least the ones I&amp;#8217;ve met) but this was surprising to me. I really expected Romney to come out on top.&lt;/p&gt;

&lt;p&gt;I think that&amp;#8217;s enough peeking into my neighbors contributions habits for one night. I have to say &lt;a href='http://pandas.pydata.org'&gt;Pandas&lt;/a&gt; makes this sort of thing really easy. I&amp;#8217;ve only scratched the surface here. There&amp;#8217;s lots more that one can do (mathematically speaking) with Panads. &lt;a href='http://www.amazon.com/gp/product/1449319793/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1449319793&amp;amp;linkCode=as2&amp;amp;tag=slackorama-20'&gt;Python for Data Analysis&lt;/a&gt; gives you a really good introduction to Pandas and then &lt;a href='http://pandas.pydata.org'&gt;the webiste&lt;/a&gt; fills in the gaps.&lt;/p&gt;

&lt;p&gt;&lt;a href='http://www.amazon.com/gp/product/1449319793/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1449319793&amp;amp;linkCode=as2&amp;amp;tag=slackorama-20'&gt;Python for Data Analysis&lt;/a&gt; and Panads get two thumbs up from me. Thanks to &lt;a href='http://oreilly.com/'&gt;O&amp;#8217;Reilly&lt;/a&gt; and &lt;a href='http://blog.wesmckinney.com/'&gt;Wes McKinney&lt;/a&gt;.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=1EXhuFwRGuU:doR6b53CMsQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=1EXhuFwRGuU:doR6b53CMsQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=1EXhuFwRGuU:doR6b53CMsQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=1EXhuFwRGuU:doR6b53CMsQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=1EXhuFwRGuU:doR6b53CMsQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/1EXhuFwRGuU" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2012/11/17/using-pandas-to-stalk-your-neighbors.html</feedburner:origLink></entry>
 
 <entry>
   <title>Python and Spotify Together At Last</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/9t1QhUvuBH0/python-and-spotify-together-at-last.html" />
   <updated>2012-01-26T00:00:00-08:00</updated>
   <id>http://sethmason.com/2012/01/26/python-and-spotify-together-at-last</id>
   <content type="html">&lt;p&gt;Here&amp;#8217;s a simple script to show the currently playing song in Spotify. All you have to do is put it on your &lt;code&gt;$PATH&lt;/code&gt; and run:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;&amp;gt;&lt;/span&gt; nowplaying
&lt;span class='go'&gt;The Unsinkable Fats Domino by Guided By Voices&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;While this is handy in and of itself (to some people), if you are running &lt;a href='http://www.gnu.org/software/screen/'&gt;GNU Screen&lt;/a&gt;, you can have it output the currently playing song in your statusline. Just add the following to your &lt;code&gt;.screenrc&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;backtick 101 5 5 /home/YOURNAME/bin/nowplaying
hardstatus string  &amp;#39;%101`&amp;#39;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you already have a &lt;code&gt;hardstatus&lt;/code&gt; (or &lt;code&gt;caption&lt;/code&gt;) line, you&amp;#8217;ll just need to add &lt;code&gt;%101&lt;/code&gt; in there somewhere. Then, you&amp;#8217;ll have the currently playing song easily available.&lt;/p&gt;

&lt;p&gt;For info about what the above does, see the &lt;a href='http://www.gnu.org/software/screen/manual/html_node/Backtick.html'&gt;GNU Screen manual about backtick&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s the entire script:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='python'&gt;&lt;span class='c'&gt;#!/usr/bin/env python&lt;/span&gt;
&lt;span class='sd'&gt;&amp;quot;&amp;quot;&amp;quot;Spit out the currently playing song.&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class='kn'&gt;import&lt;/span&gt; &lt;span class='nn'&gt;dbus&lt;/span&gt;
&lt;span class='kn'&gt;import&lt;/span&gt; &lt;span class='nn'&gt;sys&lt;/span&gt;

&lt;span class='k'&gt;try&lt;/span&gt;&lt;span class='p'&gt;:&lt;/span&gt;
    &lt;span class='n'&gt;bus&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;dbus&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;Bus&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;dbus&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;Bus&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;TYPE_SESSION&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
    &lt;span class='n'&gt;spotify&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;bus&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;get_object&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;com.spotify.qt&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
    &lt;span class='n'&gt;info&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;spotify&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;GetMetadata&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt;
&lt;span class='k'&gt;except&lt;/span&gt; &lt;span class='n'&gt;dbus&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;exceptions&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;DBusException&lt;/span&gt;&lt;span class='p'&gt;:&lt;/span&gt;
    &lt;span class='k'&gt;print&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;Spotify is not running&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
    &lt;span class='n'&gt;sys&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;exit&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;1&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

&lt;span class='n'&gt;track&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;{}&lt;/span&gt;
&lt;span class='n'&gt;trackMap&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;artist&amp;#39;&lt;/span&gt;    &lt;span class='p'&gt;:&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;xesam:artist&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
             &lt;span class='s'&gt;&amp;#39;album&amp;#39;&lt;/span&gt;     &lt;span class='p'&gt;:&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;xesam:album&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
             &lt;span class='s'&gt;&amp;#39;title&amp;#39;&lt;/span&gt;     &lt;span class='p'&gt;:&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;xesam:title&amp;#39;&lt;/span&gt;
             &lt;span class='p'&gt;}&lt;/span&gt;

&lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='n'&gt;key&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;value&lt;/span&gt; &lt;span class='ow'&gt;in&lt;/span&gt; &lt;span class='n'&gt;trackMap&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;items&lt;/span&gt;&lt;span class='p'&gt;():&lt;/span&gt;
    &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='ow'&gt;not&lt;/span&gt; &lt;span class='n'&gt;value&lt;/span&gt; &lt;span class='ow'&gt;in&lt;/span&gt; &lt;span class='n'&gt;info&lt;/span&gt;&lt;span class='p'&gt;:&lt;/span&gt;
        &lt;span class='k'&gt;continue&lt;/span&gt;
    &lt;span class='n'&gt;piece&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;info&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;value&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt;
    &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='nb'&gt;isinstance&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;piece&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nb'&gt;list&lt;/span&gt;&lt;span class='p'&gt;):&lt;/span&gt;
        &lt;span class='n'&gt;piece&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;, &amp;#39;&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;join&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;piece&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

    &lt;span class='n'&gt;track&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;key&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;piece&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;encode&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;utf-8&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

&lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='n'&gt;track&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;has_key&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;title&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='ow'&gt;and&lt;/span&gt; &lt;span class='n'&gt;track&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;has_key&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;artist&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;):&lt;/span&gt;
    &lt;span class='k'&gt;print&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;&lt;/span&gt;&lt;span class='si'&gt;%s&lt;/span&gt;&lt;span class='s'&gt; by &lt;/span&gt;&lt;span class='si'&gt;%s&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;&lt;/span&gt; &lt;span class='o'&gt;%&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;track&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;title&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;],&lt;/span&gt; &lt;span class='n'&gt;track&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;artist&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;]))&lt;/span&gt;
&lt;span class='k'&gt;else&lt;/span&gt;&lt;span class='p'&gt;:&lt;/span&gt;
    &lt;span class='k'&gt;print&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;No song playing&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you want Spotify to use the built-in notifier in Ubuntu, then by all means check out &lt;a href='http://code.google.com/p/spotify-notify/'&gt;Spotify-notify&lt;/a&gt;. It also adds support for tmedia keys.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=9t1QhUvuBH0:mMePT8q82GU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=9t1QhUvuBH0:mMePT8q82GU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=9t1QhUvuBH0:mMePT8q82GU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=9t1QhUvuBH0:mMePT8q82GU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=9t1QhUvuBH0:mMePT8q82GU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/9t1QhUvuBH0" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2012/01/26/python-and-spotify-together-at-last.html</feedburner:origLink></entry>
 
 <entry>
   <title>Books I Read in 2011</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/tOyoxTy58bU/books-i-read-in-2011.html" />
   <updated>2011-12-21T00:00:00-08:00</updated>
   <id>http://sethmason.com/2011/12/21/books-i-read-in-2011</id>
   <content type="html">&lt;p&gt;So, it&amp;#8217;s been over a year since &lt;a href='http://sethmason.com/2010/12/07/books-i-read-in-2010.html'&gt;my last &amp;#8220;Books I Read&amp;#8221;&lt;/a&gt; post so it&amp;#8217;s time I suppose. Only 28 books this year but this includes the behemoths that make up the first five books of the &lt;a href='http://en.wikipedia.org/wiki/A_song_of_ice_and_fire'&gt;A Song Ice and
Fire&lt;/a&gt; series so my page count is probably a bit higher this year. Hrm, that might be the job for a different script.&lt;/p&gt;

&lt;p&gt;Looking over the list, books that stand out for me this year include &lt;a href='http://www.amazon.com/gp/search?keywords=9780141439617&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The
Woman in White&lt;/a&gt;, &lt;a href='http://www.amazon.com/gp/search?keywords=9780062049803&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;State
of Wonder&lt;/a&gt; and &lt;a href='http://www.amazon.com/gp/product/0307477479/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=slackorama-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0307477479'&gt;A Visit from the Goon Squad&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you want up to the minute updates, I suggest you follow me on &lt;a href='http://www.goodreads.com/user/show/1519786-slackorama'&gt;Goodreads&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780553801477&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;A Dance With Dragons (A Song of Ice and Fire, #5)&lt;/a&gt; by George R.R. Martin &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780553582024&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;A Feast for Crows (A Song of Ice and Fire, #4)&lt;/a&gt; by George R.R. Martin &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780553573428&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;A Storm of Swords (A Song of Ice and Fire, #3)&lt;/a&gt; by George R.R. Martin &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780553381696&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;A Clash of Kings (A Song of Ice and Fire, #2)&lt;/a&gt; by George R.R. Martin &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780062049803&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;State of Wonder&lt;/a&gt; by Ann Patchett &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780330419123&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Under the Banner of Heaven: A Story of Violent Faith&lt;/a&gt; by Jon Krakauer &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780307346605&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;World War Z: An Oral History of the Zombie War&lt;/a&gt; by Max Brooks &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780679603597&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Super Sad True Love Story&lt;/a&gt; by Gary Shteyngart &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781400052172&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Immortal Life of Henrietta Lacks&lt;/a&gt; by Rebecca Skloot &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780553588484&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;A Game of Thrones (A Song of Ice and Fire, #1)&lt;/a&gt; by George R.R. Martin &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781594203046&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Kid&lt;/a&gt; by Sapphire &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/product/0307477479/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=slackorama-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0307477479'&gt;A Visit from the Goon Squad&lt;/a&gt; by Jennifer Egan&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780385341073&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Mister Pip&lt;/a&gt; by Lloyd Jones &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780066211312&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Just Kids&lt;/a&gt; by Patti Smith &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780393328622&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The History of Love&lt;/a&gt; by Nicole Krauss &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780375504945&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;A World on Fire: Britain's Crucial Role in the American Civil War&lt;/a&gt; by Amanda Foreman &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780375757853&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Moonstone&lt;/a&gt; by Wilkie Collins &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780141439617&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Woman in White&lt;/a&gt; by Wilkie Collins &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780192835086&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Adventures of Sherlock Holmes&lt;/a&gt; by Arthur Conan Doyle &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780385523790&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Master of Shadows: The Secret Diplomatic Career of the Painter Peter Paul Rubens&lt;/a&gt; by Mark Lamster &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780375757327&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Robinson Crusoe&lt;/a&gt; by Daniel Defoe &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780321683915&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Test-Driven JavaScript Development&lt;/a&gt; by Christian Johansen &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781934356500&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Pomodoro Technique Illustrated: Can You Focus - Really Focus - for 25 Minutes?&lt;/a&gt; by Noteberg  Staffan &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781609419691&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Bossypants&lt;/a&gt; by Tina Fey &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781156188743&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;At the Mountains of Madness&lt;/a&gt; by H.P. Lovecraft &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780976694021&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Behind Closed Doors: Secrets of Great Management&lt;/a&gt; by Johanna Rothman &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780230712591&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;City of Ruin (Legends of the Red Sun, #2)&lt;/a&gt; by Mark Charan Newton &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780679783268&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Pride and Prejudice&lt;/a&gt; by Jane Austen &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Full disclosure: Most of the book links on this page are Amazon affiliate links so I get some coin when you buy something.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=tOyoxTy58bU:PHm9-wtcTpo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=tOyoxTy58bU:PHm9-wtcTpo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=tOyoxTy58bU:PHm9-wtcTpo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=tOyoxTy58bU:PHm9-wtcTpo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=tOyoxTy58bU:PHm9-wtcTpo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/tOyoxTy58bU" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2011/12/21/books-i-read-in-2011.html</feedburner:origLink></entry>
 
 <entry>
   <title>The Big Easy 2011</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/DDfhm9UsIVk/the-big-easy-2011.html" />
   <updated>2011-11-10T00:00:00-08:00</updated>
   <id>http://sethmason.com/2011/11/10/the-big-easy-2011</id>
   <content type="html">&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; &lt;em&gt;I use quite a bit of software.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For no particular reason other than I need to post something to make up for all the times I didn&amp;#8217;t post (and because I love making lists), here&amp;#8217;s a list of the software that I use day to day.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href='http://www.ubuntu.org'&gt;Ubuntu&lt;/a&gt;: My main machine is running Ubuntu 11.04. I&amp;#8217;ve got other boxes running older versions of Ubuntu (as well as OS X) but this is where my hat hangs for the time being. Speaking of hanging, Unity almost made me want to hang myself but I think I have it dialed into where I like it. Hidden inside the Compiz settings are some sweet keyboard shortcuts for windows management, which is the only reason I tried out &lt;a href='http://xmonad.org'&gt;xmonad&lt;/a&gt; for as long as I did.&lt;/li&gt;

&lt;li&gt;&lt;a href='http://gnu.org/s/emacs'&gt;GNU Emacs&lt;/a&gt;: Emacs is probably where I spend about 90% of my day. I&amp;#8217;ve got it to the point where I hardly touch the configuration files anymore. People complain that emacs users spend tons of time fiddling with settings but you have to average that over the lifespan of you using the software. So the time setting it up isn&amp;#8217;t that much really. Emacs probably demands its own post about all the packages that I use come to think of it.&lt;/li&gt;

&lt;li&gt;&lt;a href='http://www.google.com/chrome'&gt;Google Chrome&lt;/a&gt;: Yep, I ditched &lt;a href='http://www.getfirefox.com'&gt;Firefox&lt;/a&gt;. Chrome just seems a lot faster and the developer tools are built in and rock solid. Seeing as how Firebug was staring to cause me to stab my eyes out, I&amp;#8217;m quite happy now.&lt;/li&gt;

&lt;li&gt;&lt;a href='http://www.dropbox.com'&gt;Dropbox&lt;/a&gt;: This is a service that I actually pay for. At my last job, dropbox was blocked and it made my life kind hellish. Without it, all my ebooks, projects and personal wiki are inaccessible.&lt;/li&gt;

&lt;li&gt;&lt;a href='http://www.keepassx.org'&gt;KeePassX&lt;/a&gt;: The older the get, the more I forget. And when it comes to the bazillions of passwords I need to remember for various sites, I rely on KeePassX. Open source and available on multiple platforms, it&amp;#8217;s a keeper. Har har! Get it? Keeper. KeePassX. I should move over to marketing.&lt;/li&gt;

&lt;li&gt;&lt;a href='http://www.spotify.com'&gt;Spotify&lt;/a&gt;: Another service that I pay for. The huge selection of songs and the integration with Facebook make it kind of hard to pass up. I mention Facebook because it&amp;#8217;s good fun to queue up &lt;a href='http://open.spotify.com/track/5Sa2OJjh3yX9fmkCdXTCeN'&gt;weird songs&lt;/a&gt; so they end up on your wall and your Mom gets to see it.&lt;/li&gt;

&lt;li&gt;&lt;a href='http://git-scm.com'&gt;Git&lt;/a&gt;: Yeah, I spend way too much time in git but I use it and it suits my software development needs. So much so, that I use git to interact with our Subversion repository at work.&lt;/li&gt;

&lt;li&gt;&lt;a href='http://www.rememberthemilk.com'&gt;Remeber the Milk&lt;/a&gt;: Another piece of software that I pay for. I know this is technically a web service but I have software installed for it on my phone and tablet so I&amp;#8217;m lumping this into the software post.&lt;/li&gt;

&lt;li&gt;&lt;a href='http://software.schmorp.de/pkg/rxvt-unicode.html'&gt;urxvt&lt;/a&gt;: I&amp;#8217;m using this less and less now that I&amp;#8217;ve been using &lt;a href='http://www.masteringemacs.org/articles/2010/11/01/running-shells-in-emacs-overview/'&gt;Emacs to run my shell&lt;/a&gt; but when I need to run complex commands, this is the termianal I turn to. My shell of choice is &lt;a href='http://www.zsh.org'&gt;Zsh&lt;/a&gt;.&lt;/li&gt;

&lt;li&gt;&lt;a href='http://github.com/robbyrussell/oh-my-zsh'&gt;Oh My Zsh!&lt;/a&gt;: Speaking of Zsh, this is a great collection of very useful Zsh configurations and aliases which make working with Zsh very very nice.&lt;/li&gt;

&lt;li&gt;&lt;a href='http://github.com/docwhat/homedir'&gt;homedir&lt;/a&gt;: I don&amp;#8217;t know how I exactly found homedir but it&amp;#8217;s very sweet. It&amp;#8217;s basically a small package manager for your home directory. I use to keep all configurations the same across machines. And where I need a machine specific configuration, homedir comes to the rescue. I don&amp;#8217;t really use this day to day but thought it was worth mentioning because it&amp;#8217;s saved my bacon a few times.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That about wraps up what I&amp;#8217;m using day to day. I use other things on-and-off (like LibreOffice &amp;#8211; &lt;em&gt;shudder&lt;/em&gt;) but didn&amp;#8217;t think they were worth putting in the post.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=DDfhm9UsIVk:V8UR35Z8AZ8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=DDfhm9UsIVk:V8UR35Z8AZ8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=DDfhm9UsIVk:V8UR35Z8AZ8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=DDfhm9UsIVk:V8UR35Z8AZ8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=DDfhm9UsIVk:V8UR35Z8AZ8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/DDfhm9UsIVk" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2011/11/10/the-big-easy-2011.html</feedburner:origLink></entry>
 
 <entry>
   <title>Moustaches For Good!</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/4LDKyfpx8vU/moustaches-for-good.html" />
   <updated>2011-11-03T00:00:00-07:00</updated>
   <id>http://sethmason.com/2011/11/03/moustaches-for-good</id>
   <content type="html">&lt;p&gt;Sooo&amp;#8230;hey! How ya&amp;#8217; doing? Long time no see. Hope you&amp;#8217;ve been well. Aside from being broken up over the breakdown of &lt;a href='http://decafbad.com/blog/2011/11/01/readerpocalypse'&gt;Google Reader&lt;/a&gt;, I&amp;#8217;ve also been busy growing a moustache for Movember.&lt;/p&gt;

&lt;p&gt;You can donate to my cause at &lt;a href='http://mobro.co/sethmason'&gt;http://mobro.co/sethmason&lt;/a&gt;. Feel free to pass it around!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=4LDKyfpx8vU:J5zZtenuZyo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=4LDKyfpx8vU:J5zZtenuZyo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=4LDKyfpx8vU:J5zZtenuZyo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=4LDKyfpx8vU:J5zZtenuZyo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=4LDKyfpx8vU:J5zZtenuZyo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/4LDKyfpx8vU" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2011/11/03/moustaches-for-good.html</feedburner:origLink></entry>
 
 <entry>
   <title>JSLint and git blame for fun and profit</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/QB2cA91tfzA/jslint-and-git-blame-for-fun-and-profit.html" />
   <updated>2011-05-04T00:00:00-07:00</updated>
   <id>http://sethmason.com/2011/05/04/jslint-and-git-blame-for-fun-and-profit</id>
   <content type="html">&lt;p&gt;For some unknown reason, we have a problem with superfluous trailing commas at work in our JavaScript. It&amp;#8217;s probably because we have a bunch of Perl developers writing JavaScript. Unfortunately, this doesn&amp;#8217;t play well in a world with Internet Explorer.&lt;/p&gt;

&lt;p&gt;&lt;a href='http://www.jslint.com'&gt;JSLint&lt;/a&gt; makes this easy enough to track down. But I wanted something more. I wanted to know who the culprits were. Thus, I whipped up this little script that&amp;#8217;ll take a list of files and tell you who committed a file with a trailing comma in it. Besides, JSLint, You&amp;#8217;ll need &lt;a href='https://www.mozilla.org/rhino/'&gt;Rhino&lt;/a&gt; and a script to execute commands (named runtime.js). I&amp;#8217;ll try and post that later.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='c1'&gt;// blame_comma.js -- loop through the files passed in and see who has&lt;/span&gt;
&lt;span class='c1'&gt;// commas in them&lt;/span&gt;

&lt;span class='c1'&gt;// find ../htdocs/js/ECM -type f -name &amp;quot;*.js&amp;quot; -print | \&lt;/span&gt;
&lt;span class='c1'&gt;// xargs java -classpath \&lt;/span&gt;
&lt;span class='c1'&gt;//   /usr/share/yuicompressor-2.4.2/lib/rhino-1.6R7.jar \&lt;/span&gt;
&lt;span class='c1'&gt;//   org.mozilla.javascript.tools.shell.Main blame_comma.js&lt;/span&gt;

&lt;span class='nx'&gt;load&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;fulljslint.js&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
&lt;span class='nx'&gt;load&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;runtime.js&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;

&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='kd'&gt;function&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;args&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;bad_files&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;{};&lt;/span&gt;
    &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;i&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt; &lt;span class='nx'&gt;i&lt;/span&gt; &lt;span class='o'&gt;&amp;lt;&lt;/span&gt; &lt;span class='nx'&gt;args&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;length&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt; &lt;span class='nx'&gt;i&lt;/span&gt;&lt;span class='o'&gt;++&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;file&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;args&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='nx'&gt;i&lt;/span&gt;&lt;span class='p'&gt;],&lt;/span&gt;
            &lt;span class='nx'&gt;js&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;readFile&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;file&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
        &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;success&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;JSLINT&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;js&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
		    &lt;span class='nx'&gt;browser&lt;/span&gt; &lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='kc'&gt;true&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
            &lt;span class='nx'&gt;undef&lt;/span&gt;   &lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='kc'&gt;true&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
            &lt;span class='nx'&gt;newcap&lt;/span&gt;  &lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='kc'&gt;false&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
            &lt;span class='nx'&gt;indent&lt;/span&gt;  &lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='mi'&gt;4&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
            &lt;span class='nx'&gt;predef&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;Ext&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;ECM&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;ActiveXObject&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;window&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
                     &lt;span class='s2'&gt;&amp;quot;TestCase&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;document&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;assertTrue&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;sinon&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;gt&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt;
	    &lt;span class='p'&gt;});&lt;/span&gt;
        &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='o'&gt;!&lt;/span&gt;&lt;span class='nx'&gt;success&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
            &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;errors&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;JSLINT&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;errors&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
            &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;j&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;&lt;span class='nx'&gt;j&lt;/span&gt;&lt;span class='o'&gt;&amp;lt;&lt;/span&gt;&lt;span class='nx'&gt;errors&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;length&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;&lt;span class='nx'&gt;j&lt;/span&gt;&lt;span class='o'&gt;++&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
                &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;e&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;errors&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='nx'&gt;j&lt;/span&gt;&lt;span class='p'&gt;];&lt;/span&gt;
                &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;e&lt;/span&gt; &lt;span class='o'&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class='nx'&gt;e&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;reason&lt;/span&gt; &lt;span class='o'&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class='nx'&gt;e&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;reason&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;match&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sr'&gt;/Extra comma/&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
                    &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;cmd&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;git blame -L&amp;#39;&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='nx'&gt;e&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;line&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;, &amp;#39;&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt;
                              &lt;span class='nx'&gt;e&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;line&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39; -- &amp;#39;&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='nx'&gt;file&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
                    &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;output&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;runtime&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;exec&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='nx'&gt;cmd&lt;/span&gt; &lt;span class='p'&gt;);&lt;/span&gt;
                    &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='o'&gt;!&lt;/span&gt;&lt;span class='nx'&gt;bad_files&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='nx'&gt;file&lt;/span&gt;&lt;span class='p'&gt;])&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
                        &lt;span class='nx'&gt;bad_files&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='nx'&gt;file&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;[];&lt;/span&gt;
                    &lt;span class='p'&gt;}&lt;/span&gt;
                    &lt;span class='nx'&gt;bad_files&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='nx'&gt;file&lt;/span&gt;&lt;span class='p'&gt;].&lt;/span&gt;&lt;span class='nx'&gt;push&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;output&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
                &lt;span class='p'&gt;}&lt;/span&gt;
            &lt;span class='p'&gt;}&lt;/span&gt;
        &lt;span class='p'&gt;}&lt;/span&gt;
    &lt;span class='p'&gt;}&lt;/span&gt;
    &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;key&lt;/span&gt; &lt;span class='k'&gt;in&lt;/span&gt; &lt;span class='nx'&gt;bad_files&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;bad_files&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;hasOwnProperty&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;key&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
            &lt;span class='nx'&gt;print&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;\n&amp;quot;&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='nx'&gt;key&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
            &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;errors&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;bad_files&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='nx'&gt;key&lt;/span&gt;&lt;span class='p'&gt;];&lt;/span&gt;
            &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;i&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt; &lt;span class='nx'&gt;i&lt;/span&gt;&lt;span class='o'&gt;&amp;lt;&lt;/span&gt;&lt;span class='nx'&gt;errors&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;length&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;&lt;span class='nx'&gt;i&lt;/span&gt;&lt;span class='o'&gt;++&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
                &lt;span class='nx'&gt;print&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;errors&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='nx'&gt;i&lt;/span&gt;&lt;span class='p'&gt;]);&lt;/span&gt;
            &lt;span class='p'&gt;}&lt;/span&gt;
        &lt;span class='p'&gt;}&lt;/span&gt;
    &lt;span class='p'&gt;}&lt;/span&gt;
&lt;span class='p'&gt;})(&lt;/span&gt;&lt;span class='nx'&gt;arguments&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Like most of the stuff I seem to do lately, this is available as a &lt;a href='https://gist.github.com/947059'&gt;gist on GitHub&lt;/a&gt;. Let me know if you see anything you like.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=QB2cA91tfzA:m0WTHzNIXAE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=QB2cA91tfzA:m0WTHzNIXAE:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=QB2cA91tfzA:m0WTHzNIXAE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=QB2cA91tfzA:m0WTHzNIXAE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=QB2cA91tfzA:m0WTHzNIXAE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/QB2cA91tfzA" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2011/05/04/jslint-and-git-blame-for-fun-and-profit.html</feedburner:origLink></entry>
 
 <entry>
   <title>Beautify your JavaScript in Emacs</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/gWPhzJt6BJ8/jsbeautify-in-emacs.html" />
   <updated>2011-04-28T00:00:00-07:00</updated>
   <id>http://sethmason.com/2011/04/28/jsbeautify-in-emacs</id>
   <content type="html">&lt;p&gt;I know you&amp;#8217;ll find this hard to believe dear reader but I&amp;#8217;m a big fan of using Emacs to write JavaScript. One thing that irked me in the past is that none of the libraries got the indentation and other formatting how I wanted. Luckily, I recently stumbled onto &lt;a href='http://jsbeautifier.org/'&gt;js-beautify&lt;/a&gt; (via the most excellent &lt;a href='http://jsfiddle.net'&gt;jsFiddle&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Lo and behold, there is a command line interface to beautifying JavaScript! Good thing Emacs can call shell commands on text so easily. Thus, we have:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='scheme'&gt;&lt;span class='c1'&gt;;;; js-beautify.el -- beautify some js code&lt;/span&gt;

&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;defgroup&lt;/span&gt; &lt;span class='nv'&gt;js-beautify&lt;/span&gt; &lt;span class='nv'&gt;nil&lt;/span&gt;
  &lt;span class='s'&gt;&amp;quot;Use jsbeautify to beautify some js&amp;quot;&lt;/span&gt;
  &lt;span class='nv'&gt;:group&lt;/span&gt; &lt;span class='ss'&gt;&amp;#39;editing&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;defcustom&lt;/span&gt; &lt;span class='nv'&gt;js-beautify-args&lt;/span&gt; &lt;span class='s'&gt;&amp;quot;--jslint-happy --brace-style=end-expand&lt;/span&gt;
&lt;span class='s'&gt;--keep-array-indentation&amp;quot;&lt;/span&gt;
  &lt;span class='s'&gt;&amp;quot;Arguments to pass to jsbeautify script&amp;quot;&lt;/span&gt;
  &lt;span class='nv'&gt;:type&lt;/span&gt; &lt;span class='o'&gt;&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nv'&gt;string&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
  &lt;span class='nv'&gt;:group&lt;/span&gt; &lt;span class='ss'&gt;&amp;#39;js-beautify&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;defcustom&lt;/span&gt; &lt;span class='nv'&gt;js-beautify-path&lt;/span&gt; &lt;span class='s'&gt;&amp;quot;~/projects/js-beautify/python/jsbeautifier.py&amp;quot;&lt;/span&gt;
  &lt;span class='s'&gt;&amp;quot;Path to jsbeautifier python file&amp;quot;&lt;/span&gt;
  &lt;span class='nv'&gt;:type&lt;/span&gt; &lt;span class='o'&gt;&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nv'&gt;string&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
  &lt;span class='nv'&gt;:group&lt;/span&gt; &lt;span class='ss'&gt;&amp;#39;js-beautify&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;defun&lt;/span&gt; &lt;span class='nv'&gt;js-beautify&lt;/span&gt; &lt;span class='p'&gt;()&lt;/span&gt;
  &lt;span class='s'&gt;&amp;quot;Beautify a region of javascript using the code from jsbeautify.org&amp;quot;&lt;/span&gt;
  &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;interactive&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
  &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='k'&gt;let &lt;/span&gt;&lt;span class='p'&gt;((&lt;/span&gt;&lt;span class='nf'&gt;orig-point&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;point&lt;/span&gt;&lt;span class='p'&gt;)))&lt;/span&gt;
    &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;unless&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;mark&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
      &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;mark-defun&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;
    &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;shell-command-on-region&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;point&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
                             &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;mark&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
                             &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;concat&lt;/span&gt; &lt;span class='s'&gt;&amp;quot;python &amp;quot;&lt;/span&gt;
                                     &lt;span class='nv'&gt;js-beautify-path&lt;/span&gt;
                                     &lt;span class='s'&gt;&amp;quot; --stdin &amp;quot;&lt;/span&gt;
                                     &lt;span class='nv'&gt;js-beautify-args&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
                             &lt;span class='nv'&gt;nil&lt;/span&gt; &lt;span class='nv'&gt;t&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
    &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;goto-char&lt;/span&gt; &lt;span class='nv'&gt;orig-point&lt;/span&gt;&lt;span class='p'&gt;)))&lt;/span&gt;

&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nf'&gt;provide&lt;/span&gt; &lt;span class='ss'&gt;&amp;#39;js-beautify&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='c1'&gt;;;; js-beautify.el ends here&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I like it so much I have bound to M-t (for tidy) in a mode hook:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  (local-set-key &amp;quot;\M-t&amp;quot; &amp;#39;js-beautify)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you want to follow any updates, I&amp;#8217;ve put this snippet up as a &lt;a href='https://gist.github.com/712405'&gt;Gist on GitHub&lt;/a&gt; so feel free to clone and send me any pull requests.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=gWPhzJt6BJ8:IHDwguMr38s:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=gWPhzJt6BJ8:IHDwguMr38s:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=gWPhzJt6BJ8:IHDwguMr38s:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=gWPhzJt6BJ8:IHDwguMr38s:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=gWPhzJt6BJ8:IHDwguMr38s:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/gWPhzJt6BJ8" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2011/04/28/jsbeautify-in-emacs.html</feedburner:origLink></entry>
 
 <entry>
   <title>Toggler in Ext JS</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/QlR_AWz6wLk/toggler-in-ext-js.html" />
   <updated>2011-04-02T00:00:00-07:00</updated>
   <id>http://sethmason.com/2011/04/02/toggler-in-ext-js</id>
   <content type="html">&lt;p&gt;Since it has been awhile since I last posted and we started using &lt;a href='http://www.sencha.com/products/extjs/'&gt;Ext JS&lt;/a&gt; at &lt;a href='http://www.cheetahmail.com'&gt;work&lt;/a&gt;, I thought I&amp;#8217;d post a little snippet JavaScript for setting up a link that toggles something.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='c1'&gt;// create a toggler link...is there a better way?&lt;/span&gt;
&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;toggler&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='k'&gt;new&lt;/span&gt; &lt;span class='nx'&gt;Ext&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;BoxComponent&lt;/span&gt;&lt;span class='p'&gt;({&lt;/span&gt;
    &lt;span class='nx'&gt;autoEl&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='nx'&gt;tag&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
        &lt;span class='nx'&gt;href&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;#&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
        &lt;span class='nx'&gt;html&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;All&amp;#39;&lt;/span&gt;
    &lt;span class='p'&gt;},&lt;/span&gt;
    &lt;span class='nx'&gt;listeners&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='s1'&gt;&amp;#39;render&amp;#39;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='kd'&gt;function&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;comp&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
            &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;el&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;comp&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;getEl&lt;/span&gt;&lt;span class='p'&gt;();&lt;/span&gt;
            &lt;span class='nx'&gt;el&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;on&lt;/span&gt;&lt;span class='p'&gt;({&lt;/span&gt;
                &lt;span class='s1'&gt;&amp;#39;click&amp;#39;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
                    &lt;span class='nx'&gt;scope&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='nx'&gt;comp&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
                    &lt;span class='nx'&gt;fn&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='kd'&gt;function&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;event&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nx'&gt;element&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
                        &lt;span class='nx'&gt;event&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;stopEvent&lt;/span&gt;&lt;span class='p'&gt;();&lt;/span&gt;
                        &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;text&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='k'&gt;this&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;getEl&lt;/span&gt;&lt;span class='p'&gt;().&lt;/span&gt;&lt;span class='nx'&gt;dom&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;innerHTML&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
                        &lt;span class='nx'&gt;text&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;text&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;toggle&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;All&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;None&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
                        &lt;span class='k'&gt;this&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;update&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;text&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
                        &lt;span class='c1'&gt;// do your toggling here&lt;/span&gt;
                    &lt;span class='p'&gt;}&lt;/span&gt;
                &lt;span class='p'&gt;}&lt;/span&gt;
            &lt;span class='p'&gt;});&lt;/span&gt;
        &lt;span class='p'&gt;}&lt;/span&gt;
    &lt;span class='p'&gt;}&lt;/span&gt;
&lt;span class='p'&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Because it&amp;#8217;s an instance of &lt;a href='http://dev.sencha.com/deploy/dev/docs/?class=Ext.Component'&gt;Ext.Component&lt;/a&gt; it can easily be added to a &lt;a href='http://dev.sencha.com/deploy/dev/docs/?class=Ext.Component'&gt;Ext.Container&lt;/a&gt; so it&amp;#8217;s a tad more reusable than a straight up select. At least I think so.&lt;/p&gt;

&lt;p&gt;Questions and comments welcome.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=QlR_AWz6wLk:-i3h9Rpl5hY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=QlR_AWz6wLk:-i3h9Rpl5hY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=QlR_AWz6wLk:-i3h9Rpl5hY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=QlR_AWz6wLk:-i3h9Rpl5hY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=QlR_AWz6wLk:-i3h9Rpl5hY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/QlR_AWz6wLk" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2011/04/02/toggler-in-ext-js.html</feedburner:origLink></entry>
 
 <entry>
   <title>Books I Read in 2010</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/KvWuinohdDw/books-i-read-in-2010.html" />
   <updated>2010-12-07T00:00:00-08:00</updated>
   <id>http://sethmason.com/2010/12/07/books-i-read-in-2010</id>
   <content type="html">&lt;p&gt;I was messing around with the &lt;a href='http://www.goodreads.com/api'&gt;Goodreads API&lt;/a&gt; and generated a list of books I read in 2010. Here they are in reverse order:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781934356340&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Passionate Programmer: Creating a Remarkable Career in Software Development&lt;/a&gt; by Chad Fowler &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780374158460&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Freedom&lt;/a&gt; by Jonathan Franzen &lt;/li&gt;
&lt;li&gt;Program or be Programmed: Ten Commands for a Digital Age&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780307379207&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;How to Live Safely in a Science Fictional Universe&lt;/a&gt; by Charles Yu &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780759547636&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;How Would You Move Mount Fuji?&lt;/a&gt; by William Poundstone &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780743204804&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The First National Bank of Dad: The Best Way to Teach Kids About Money&lt;/a&gt; by David Owen &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780439023511&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Mockingjay (The Hunger Games, #3)&lt;/a&gt; by Suzanne Collins &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780439023498&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Catching Fire (The Hunger Games, #2)&lt;/a&gt; by Suzanne Collins &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780439023481&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Hunger Games (The Hunger Games, #1)&lt;/a&gt; by Suzanne Collins &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780374299255&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Lush Life&lt;/a&gt; by Richard Price &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780446610384&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Parable of the Talents&lt;/a&gt; by Octavia E. Butler &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780230712584&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Nights of Villjamur (Legends of the Red Sun, #1)&lt;/a&gt; by Mark Charan Newton &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780765346124&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Eye of the Heron&lt;/a&gt; by Ursula K. Le Guin &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780451526915&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Arrowsmith&lt;/a&gt; by Sinclair Lewis &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780452284845&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Young Wan&lt;/a&gt; by Brendan O'Carroll &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780446675505&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Parable of the Sower&lt;/a&gt; by Octavia E. Butler &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780307269997&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Girl Who Kicked the Hornet's Nest&lt;/a&gt; by Stieg Larsson &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780307269980&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Girl Who Played with Fire&lt;/a&gt; by Stieg Larsson &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781439127957&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Circles&lt;/a&gt; by James Burke &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780470156032&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Honey, I Wrecked the Kids: When Yelling, Screaming, Threats, Bribes, Time-outs, Sticker Charts and Removing Privileges All Don't Work&lt;/a&gt; by Alyson Schafer &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780671540661&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Shadow of the Torturer (The Book of the New Sun, #1)&lt;/a&gt; by Gene Wolfe &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780446504126&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;NurtureShock: New Thinking About Children&lt;/a&gt; by Po Bronson &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780439227148&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The Call of the Wild&lt;/a&gt; by Jack London &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781439152928&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Between the Assassinations&lt;/a&gt; by Aravind Adiga &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780385528177&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Getting Organized in the Google Era: How to Get Stuff out of Your Head, Find It When You Need It, and Get It Done Right&lt;/a&gt; by Douglas C. Merrill &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780140149869&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;The South&lt;/a&gt; by Colm Tóibín &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781402179624&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Two Years Before the Mast: A Sailor's Life at Sea&lt;/a&gt; by Richard Henry Dana Jr. &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780071431187&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Statistics Demystified&lt;/a&gt; by Stan Gibilisco &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780393329407&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Another Bullshit Night in Suck City&lt;/a&gt; by Nick Flynn &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9781934356050&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Pragmatic Thinking and Learning: Refactor Your Wetware&lt;/a&gt; by Andy Hunt &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780345487452&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Storming Las Vegas: How a Cuban-Born, Soviet-Trained Commando Took Down the Strip to the Tune of Five World-Class Hotels, Three Armored Cars, and Millions of Dollars&lt;/a&gt; by John Huddy &lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.amazon.com/gp/search?keywords=9780374520083&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Table of Contents&lt;/a&gt; by John McPhee &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Only 32 books in a year! That&amp;#8217;s kind of low for me, even with my Kindle by my side. Such is life I suppose. I really enjoyed &lt;a href='http://www.amazon.com/gp/search?keywords=9780307379207&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;How
to Live Safely in a Science Fictional Universe&lt;/a&gt; by Charles Yu, the Hunger Games series and &lt;a href='http://www.amazon.com/gp/search?keywords=9781934356050&amp;amp;index=books&amp;amp;linkCode=qs&amp;amp;tag=slackorama-20'&gt;Pragmatic
Thinking and Learning: Refactor Your Wetware&lt;/a&gt; by Andy Hunt if anyone is looking for a &amp;#34;Best of.&amp;#34;&lt;/p&gt;

&lt;p&gt;Full disclosure: These are Amazon affiliate links so if you happen to buy one through a link, I&amp;#8217;ll get some shekels.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=KvWuinohdDw:JXClwqKZ8LM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=KvWuinohdDw:JXClwqKZ8LM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=KvWuinohdDw:JXClwqKZ8LM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=KvWuinohdDw:JXClwqKZ8LM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=KvWuinohdDw:JXClwqKZ8LM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/KvWuinohdDw" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2010/12/07/books-i-read-in-2010.html</feedburner:origLink></entry>
 
 <entry>
   <title>Git script to update Bugzilla</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/RakBccqx88E/git-script-to-update-bugzilla.html" />
   <updated>2010-11-23T00:00:00-08:00</updated>
   <id>http://sethmason.com/2010/11/23/git-script-to-update-bugzilla</id>
   <content type="html">&lt;p&gt;At my work we use &lt;a href='http://git-scm.com' title='Git'&gt;git&lt;/a&gt; and &lt;a href='http://www.bugzilla.org' title='Bugzilla'&gt;Bugzilla&lt;/a&gt; for source code control and bug tracking respectively. We have a process where bugfixes are commited to a branch off of master with the name of &lt;code&gt;bugfix/bz1234&lt;/code&gt; where &lt;code&gt;1234&lt;/code&gt; is the id of the issue in our bugzilla system.&lt;/p&gt;

&lt;p&gt;After a fix is completed, a merge request is filed in our bugzilla system to merge this branch back into &lt;code&gt;master&lt;/code&gt; (developers don&amp;#8217;t have write privileges to &lt;code&gt;master&lt;/code&gt;). We are in the process of writing up a hook to parse commit messages to automate all of this but it&amp;#8217;s taking some time.&lt;/p&gt;

&lt;p&gt;So, in the interest of making my life a bit easier until then, I took advantage of Bugzilla&amp;#8217;s excellent &lt;a href='http://www.bugzilla.org/docs/3.0/html/api/email_in.html'&gt;email_in.pl&lt;/a&gt; to parse incoming emails to edit tickets and wrote up a command to file fix and merge tickets for me.&lt;/p&gt;

&lt;p&gt;I simply put &lt;code&gt;git-bz&lt;/code&gt; on my &lt;code&gt;$PATH&lt;/code&gt; and call it thusly:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; git bz fix
&amp;gt; git fix 1.2.3 hotfix | sendmail -t&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note: Our merge tickets require a milestone and a version for the merge ticket, thus the extra arguments for the merge.&lt;/p&gt;

&lt;p&gt;Your system is probably radically different than ours but I thought it&amp;#8217;d be interesting to post something here showing how powerful git is. Let me know what you think.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='perl'&gt;&lt;span class='c1'&gt;#!/usr/bin/env perl&lt;/span&gt;
&lt;span class='c1'&gt;# git-bz -- given a version and target, print out a merge&lt;/span&gt;
&lt;span class='c1'&gt;#           email for sending to bz&lt;/span&gt;

&lt;span class='k'&gt;use&lt;/span&gt; &lt;span class='n'&gt;warnings&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
&lt;span class='k'&gt;use&lt;/span&gt; &lt;span class='n'&gt;strict&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;

&lt;span class='k'&gt;use&lt;/span&gt; &lt;span class='n'&gt;Carp&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
&lt;span class='k'&gt;use&lt;/span&gt; &lt;span class='n'&gt;Git&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;

&lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
&lt;span class='c1'&gt;# map a shorthand version to the one bz expects for merges&lt;/span&gt;
&lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
&lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;%versions&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;
    &lt;span class='s'&gt;&amp;#39;mne&amp;#39;&lt;/span&gt;    &lt;span class='o'&gt;=&amp;gt;&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;Merge (M&amp;amp;E/Patch)&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='s'&gt;&amp;#39;rc&amp;#39;&lt;/span&gt;     &lt;span class='o'&gt;=&amp;gt;&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;Merge (RC/Major)&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='s'&gt;&amp;#39;hotfix&amp;#39;&lt;/span&gt; &lt;span class='o'&gt;=&amp;gt;&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;Merge (Hotfix)&amp;#39;&lt;/span&gt;
&lt;span class='p'&gt;);&lt;/span&gt;

&lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
&lt;span class='c1'&gt;# get the action and config info&lt;/span&gt;
&lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
&lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$action&lt;/span&gt;   &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nb'&gt;shift&lt;/span&gt; &lt;span class='o'&gt;||&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
&lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$bz_email&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nn'&gt;Git::&lt;/span&gt;&lt;span class='n'&gt;config&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;bz.email&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;

&lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='o'&gt;!&lt;/span&gt; &lt;span class='nv'&gt;$bz_email&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='n'&gt;croak&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;No bugzilla email found&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;

&lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
&lt;span class='c1'&gt;# start doing the work&lt;/span&gt;
&lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
&lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='nv'&gt;$action&lt;/span&gt; &lt;span class='ow'&gt;eq&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;fix&amp;#39;&lt;/span&gt; &lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$user_email&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;get_user_email&lt;/span&gt;&lt;span class='p'&gt;();&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$bz_info&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;get_bz_info&lt;/span&gt;&lt;span class='p'&gt;();&lt;/span&gt;

    &lt;span class='k'&gt;print&lt;/span&gt; &lt;span class='s'&gt;&amp;lt;&amp;lt;&amp;quot;MAIL&amp;quot;;&lt;/span&gt;
&lt;span class='s'&gt;To: $bz_email&lt;/span&gt;
&lt;span class='s'&gt;From: $user_email&lt;/span&gt;
&lt;span class='s'&gt;Subject: Issue $bz_info-&amp;gt;{bug} fixed&lt;/span&gt;

&lt;span class='s'&gt;\@bug_id = $bz_info-&amp;gt;{bug}&lt;/span&gt;
&lt;span class='s'&gt;\@bug_status = RESOLVED&lt;/span&gt;
&lt;span class='s'&gt;\@resolution = FIXED&lt;/span&gt;

&lt;span class='s'&gt;Fixed in $bz_info-&amp;gt;{branch} pending merge.&lt;/span&gt;

&lt;span class='s'&gt;MAIL&lt;/span&gt;

&lt;span class='p'&gt;}&lt;/span&gt; &lt;span class='k'&gt;elsif&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='nv'&gt;$action&lt;/span&gt; &lt;span class='ow'&gt;eq&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;merge&amp;#39;&lt;/span&gt; &lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$target_milestone&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nb'&gt;shift&lt;/span&gt; &lt;span class='o'&gt;||&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;---&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$merge_to&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nb'&gt;shift&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$version&lt;/span&gt;  &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='nv'&gt;$merge_to&lt;/span&gt; &lt;span class='o'&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class='nv'&gt;$versions&lt;/span&gt;&lt;span class='p'&gt;{&lt;/span&gt;&lt;span class='nv'&gt;$merge_to&lt;/span&gt;&lt;span class='p'&gt;}&lt;/span&gt; &lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='o'&gt;||&lt;/span&gt;
                   &lt;span class='s'&gt;&amp;#39;unspecified&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$bz_info&lt;/span&gt;  &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;get_bz_info&lt;/span&gt;&lt;span class='p'&gt;();&lt;/span&gt;

    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$user_email&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;get_user_email&lt;/span&gt;&lt;span class='p'&gt;();&lt;/span&gt;

    &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='o'&gt;!&lt;/span&gt;&lt;span class='nb'&gt;defined&lt;/span&gt; &lt;span class='nv'&gt;$bz_info&lt;/span&gt;&lt;span class='o'&gt;-&amp;gt;&lt;/span&gt;&lt;span class='p'&gt;{&lt;/span&gt;&lt;span class='n'&gt;bug&lt;/span&gt;&lt;span class='p'&gt;}&lt;/span&gt; &lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='n'&gt;croak&lt;/span&gt; &lt;span class='s'&gt;&amp;quot;No bug id found in branch name&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='p'&gt;}&lt;/span&gt;

    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$bug_id&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nv'&gt;$bz_info&lt;/span&gt;&lt;span class='o'&gt;-&amp;gt;&lt;/span&gt;&lt;span class='p'&gt;{&lt;/span&gt;&lt;span class='n'&gt;bug&lt;/span&gt;&lt;span class='p'&gt;};&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$bz_branch&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nv'&gt;$bz_info&lt;/span&gt;&lt;span class='o'&gt;-&amp;gt;&lt;/span&gt;&lt;span class='p'&gt;{&lt;/span&gt;&lt;span class='n'&gt;branch&lt;/span&gt;&lt;span class='p'&gt;};&lt;/span&gt;

 &lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
 &lt;span class='c1'&gt;# get the remote branch, url and name&lt;/span&gt;
 &lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;@remote_info&lt;/span&gt;
        &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nn'&gt;Git::&lt;/span&gt;&lt;span class='n'&gt;command&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;config&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;--get-regexp&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;^branch\.&amp;#39;&lt;/span&gt;
                        &lt;span class='o'&gt;.&lt;/span&gt; &lt;span class='nv'&gt;$bz_branch&lt;/span&gt; &lt;span class='p'&gt;);&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='nv'&gt;$remote&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nv'&gt;$remote_branch&lt;/span&gt; &lt;span class='p'&gt;);&lt;/span&gt;
    &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$line&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nv'&gt;@remote_info&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='nv'&gt;$line&lt;/span&gt; &lt;span class='o'&gt;=~&lt;/span&gt;&lt;span class='sr'&gt; /\.remote\s+(.+)/x&lt;/span&gt; &lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
            &lt;span class='nv'&gt;$remote&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nv'&gt;$1&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
        &lt;span class='p'&gt;}&lt;/span&gt; &lt;span class='k'&gt;elsif&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='nv'&gt;$line&lt;/span&gt; &lt;span class='o'&gt;=~&lt;/span&gt;&lt;span class='sr'&gt; /merge\s+((refs\/)?heads\/)?(.+)/x&lt;/span&gt; &lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
            &lt;span class='nv'&gt;$remote_branch&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nv'&gt;$3&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
        &lt;span class='p'&gt;}&lt;/span&gt;
    &lt;span class='p'&gt;}&lt;/span&gt;

    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$remote_url&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nn'&gt;Git::&lt;/span&gt;&lt;span class='n'&gt;command_oneline&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;config&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;--get-regexp&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
        &lt;span class='s'&gt;&amp;#39;remote.&amp;#39;&lt;/span&gt; &lt;span class='o'&gt;.&lt;/span&gt; &lt;span class='nv'&gt;$remote&lt;/span&gt; &lt;span class='o'&gt;.&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;.url&amp;#39;&lt;/span&gt; &lt;span class='p'&gt;);&lt;/span&gt;
    &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='nv'&gt;$remote_url&lt;/span&gt; &lt;span class='o'&gt;=~&lt;/span&gt; &lt;span class='sr'&gt;m/url\s+(.+)/x&lt;/span&gt; &lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='nv'&gt;$remote_url&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nv'&gt;$1&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='p'&gt;}&lt;/span&gt;

 &lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
 &lt;span class='c1'&gt;# get the commits to show&lt;/span&gt;
 &lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$commits&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nn'&gt;Git::&lt;/span&gt;&lt;span class='n'&gt;command&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
        &lt;span class='s'&gt;&amp;#39;log&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;            &lt;span class='s'&gt;&amp;quot;$remote/$remote_branch..&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
        &lt;span class='s'&gt;&amp;#39;--pretty=short&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;--name-status&amp;#39;&lt;/span&gt;
    &lt;span class='p'&gt;);&lt;/span&gt;

 &lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
 &lt;span class='c1'&gt;# finally print out the email message&lt;/span&gt;
 &lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
    &lt;span class='k'&gt;print&lt;/span&gt; &lt;span class='s'&gt;&amp;lt;&amp;lt;&amp;quot;MAIL&amp;quot;;&lt;/span&gt;
&lt;span class='s'&gt;To: $bz_email&lt;/span&gt;
&lt;span class='s'&gt;From: $user_email&lt;/span&gt;
&lt;span class='s'&gt;Subject: Please merge $bz_branch to $remote_branch&lt;/span&gt;

&lt;span class='s'&gt;\@blocked = $bug_id&lt;/span&gt;
&lt;span class='s'&gt;\@product = Application Defects&lt;/span&gt;
&lt;span class='s'&gt;\@component = Merge Request&lt;/span&gt;
&lt;span class='s'&gt;\@version = $version&lt;/span&gt;
&lt;span class='s'&gt;\@target_milestone = $target_milestone&lt;/span&gt;

&lt;span class='s'&gt;Please merge $bz_branch to the remote branch $remote_branch&lt;/span&gt;

&lt;span class='s'&gt;Merge: $bz_branch&lt;/span&gt;
&lt;span class='s'&gt;To: $remote_branch&lt;/span&gt;
&lt;span class='s'&gt;Repository: $remote_url&lt;/span&gt;

&lt;span class='s'&gt;$commits&lt;/span&gt;
&lt;span class='s'&gt;MAIL&lt;/span&gt;

&lt;span class='p'&gt;}&lt;/span&gt; &lt;span class='k'&gt;else&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='n'&gt;croak&lt;/span&gt; &lt;span class='s'&gt;&amp;lt;&amp;lt;&amp;quot;USAGE&amp;quot;;&lt;/span&gt;
&lt;span class='s'&gt;error: Unknon subcommand: $action&lt;/span&gt;
&lt;span class='s'&gt;usage: git bz fix &amp;lt;target&amp;gt;&lt;/span&gt;
&lt;span class='s'&gt;   or: git bz merge &amp;lt;merge_to&amp;gt; &amp;lt;target&amp;gt;&lt;/span&gt;

&lt;span class='s'&gt;USAGE&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;

&lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
&lt;span class='c1'&gt;# get current branch and bug ID&lt;/span&gt;
&lt;span class='c1'&gt;#============================================================================&lt;/span&gt;
&lt;span class='k'&gt;sub &lt;/span&gt;&lt;span class='nf'&gt;get_bz_info&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$bz_branch&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nn'&gt;Git::&lt;/span&gt;&lt;span class='n'&gt;command_oneline&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;symbolic-ref&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;HEAD&amp;#39;&lt;/span&gt; &lt;span class='p'&gt;);&lt;/span&gt;
    &lt;span class='nv'&gt;$bz_branch&lt;/span&gt; &lt;span class='o'&gt;=~&lt;/span&gt; &lt;span class='sr'&gt;s{^refs\/heads/}{}x&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nv'&gt;$bug_id&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nv'&gt;$bz_branch&lt;/span&gt; &lt;span class='o'&gt;=~&lt;/span&gt; &lt;span class='sr'&gt;m/bz(\d+)/x&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='k'&gt;return&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt; &lt;span class='n'&gt;branch&lt;/span&gt; &lt;span class='o'&gt;=&amp;gt;&lt;/span&gt; &lt;span class='nv'&gt;$bz_branch&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;bug&lt;/span&gt; &lt;span class='o'&gt;=&amp;gt;&lt;/span&gt; &lt;span class='nv'&gt;$bug_id&lt;/span&gt; &lt;span class='p'&gt;};&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;

&lt;span class='k'&gt;sub &lt;/span&gt;&lt;span class='nf'&gt;get_user_email&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='k'&gt;my&lt;/span&gt; &lt;span class='nv'&gt;$email&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nn'&gt;Git::&lt;/span&gt;&lt;span class='n'&gt;command_oneline&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;config&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;--get&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s'&gt;&amp;#39;user.email&amp;#39;&lt;/span&gt; &lt;span class='p'&gt;);&lt;/span&gt;
    &lt;span class='k'&gt;return&lt;/span&gt; &lt;span class='nv'&gt;$email&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you want to use it, you&amp;#8217;ll need to set up a config to point to your own bz email.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; git config bz.email mybz@somedomain.com&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This script is available as a &lt;a href='https://gist.github.com/710374'&gt;gist&lt;/a&gt; on &lt;a href='http://github.com'&gt;github&lt;/a&gt;.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=RakBccqx88E:0oixoXQsqxQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=RakBccqx88E:0oixoXQsqxQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=RakBccqx88E:0oixoXQsqxQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=RakBccqx88E:0oixoXQsqxQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=RakBccqx88E:0oixoXQsqxQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/RakBccqx88E" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2010/11/23/git-script-to-update-bugzilla.html</feedburner:origLink></entry>
 
 <entry>
   <title>Emacs and Remember The Milk all jumbled up</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/G-e-1L_TzFc/emacs-and-remember-the-milk-all-jumbled-up.html" />
   <updated>2010-08-19T00:00:00-07:00</updated>
   <id>http://sethmason.com/2010/08/19/emacs-and-remember-the-milk-all-jumbled-up</id>
   <content type="html">&lt;p&gt;I&amp;#8217;m a huge fan of &lt;a href='http://www.rememberthemilk.com'&gt;Remember The Milk&lt;/a&gt; and &lt;a href='http://www.gnu.org/software/emacs/'&gt;GNU Emacs&lt;/a&gt;. So much so, that I&amp;#8217;ve given them both money over the years. And now I&amp;#8217;ve (kind of) combined them. I just pushed &lt;a href='http://github.com/slackorama/slack-rtm'&gt;slack-rtm&lt;/a&gt; to GitHub.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve kind of avoided Emacs Lisp, &lt;a href='http://steve-yegge.blogspot.com/2008/11/ejacs-javascript-interpreter-for-emacs.html'&gt;the 1984 Subaru of Lisp&lt;/a&gt;. While I&amp;#8217;ve done some minor hacking of my .emacs in the two years I&amp;#8217;ve been using Emacs, I have not really done any serious programming in it. But with this, I&amp;#8217;m hoping to remedy that a bit. It&amp;#8217;s been fine so far, even though the learning curve has been steep. I don&amp;#8217;t think I&amp;#8217;ll be writing a JavaScript interpreter anytime soon.&lt;/p&gt;

&lt;p&gt;Right now, it&amp;#8217;s pretty simple. It just creates a buffer and shoves your tasks into it. I&amp;#8217;ve only tested it on GNU Emacs 23.1.50.1. Ultimately, I&amp;#8217;d like it to sync between an &lt;a href='http://www.orgmode.org'&gt;orgmode&lt;/a&gt; file and RTM, kind of like what &lt;a href='http://sachachua.com/blog/2010/05/org-toodledo/'&gt;Sacha Chua did with org-toodledo.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, &lt;a href='http://github.com/slackorama/slack-rtm'&gt;have at it&lt;/a&gt;. Feel free to fork it and send me pull requests. I&amp;#8217;m hoping to release early (DONE!) and often.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=G-e-1L_TzFc:gnC5Ur5t0Lc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=G-e-1L_TzFc:gnC5Ur5t0Lc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=G-e-1L_TzFc:gnC5Ur5t0Lc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=G-e-1L_TzFc:gnC5Ur5t0Lc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=G-e-1L_TzFc:gnC5Ur5t0Lc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/G-e-1L_TzFc" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2010/08/19/emacs-and-remember-the-milk-all-jumbled-up.html</feedburner:origLink></entry>
 
 <entry>
   <title>Sheena Is A C++ Hacker</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/qNls3XrFlmI/sheena-is-a-c-hacker.html" />
   <updated>2010-07-01T00:00:00-07:00</updated>
   <id>http://sethmason.com/2010/07/01/sheena-is-a-c-hacker</id>
   <content type="html">&lt;p&gt;Not really. And my name&amp;#8217;s not Sheena. But I did make a contribution to the awesome console based newsreader &lt;a href='http://www.newsbeuter.org'&gt;Newsbeuter&lt;/a&gt;. If you want to see my patch, it&amp;#8217;s available on &lt;a href='http://github.com/akrennmair/newsbeuter/commit/31933f2e60f2d99b08fd5108e63421997a900696'&gt;Github&lt;/a&gt;. I fixed a problem with the way that it authenticated against Google Reader API.&lt;/p&gt;

&lt;p&gt;As for Newsbeuter, if you like doing everything from the commandline, this is the newsreader for you. Lots of features like keyboard shortcuts that can be reconfigured easily and query feeds so you can create your own pipe.&lt;/p&gt;

&lt;p&gt;&lt;a href='http://www.newsbeuter.org'&gt;Check it out&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=qNls3XrFlmI:sXhroVSRICk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=qNls3XrFlmI:sXhroVSRICk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=qNls3XrFlmI:sXhroVSRICk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=qNls3XrFlmI:sXhroVSRICk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=qNls3XrFlmI:sXhroVSRICk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/qNls3XrFlmI" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2010/07/01/sheena-is-a-c-hacker.html</feedburner:origLink></entry>
 
 <entry>
   <title>Google Apps Script For Fun and Profit</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/56WDgJlXCik/google-apps-scripts-for-fun-and-profit.html" />
   <updated>2010-05-28T00:00:00-07:00</updated>
   <id>http://sethmason.com/2010/05/28/google-apps-scripts-for-fun-and-profit</id>
   <content type="html">&lt;p&gt;OK, so I have to admit that I have a mancrush on &lt;a href='http://www.google.com/google-d-s/scripts/scripts.html'&gt;Google Apps Script&lt;/a&gt;. It&amp;#8217;s a nice little tool that allows you to do a whole variety of things on a bunch of Google Products. For instance:&lt;/p&gt;
&lt;blockquote&gt;
With scripts, you can:&lt;br /&gt;
* Create your own custom spreadsheet functions&lt;br /&gt;
* Automate repetitive tasks (e.g. process responses to Google Docs forms)&lt;br /&gt;
* Link multiple Google products together (e.g. send emails or schedule&lt;br /&gt;
* Calendar events from a list of addresses in a Spreadsheet)&lt;br /&gt;
* Customize existing Google products (e.g. add custom buttons or menus to run
* your own scripts)&lt;br /&gt;
&lt;/blockquote&gt;
&lt;p&gt;Not only is the tool itself very nice (a slick in-browser editor with syntax highlighting and context sensitive prompts), the &lt;a href='http://www.google.com/google-d-s/scripts/articles.html'&gt;tutorials&lt;/a&gt; are as well. In a little under 15 minutes while reading the tutorial I was able to write a script that emails you the next 10 days events from any calendar. It uses JavaScript so if you are familiar with that, then you could probably even do it quicker than me and my old brain.&lt;/p&gt;

&lt;p&gt;A pet peeve that I have is that the daily email I get from Google Calendar doesn&amp;#8217;t include my contact&amp;#8217;s birthdays. Even if it did, it&amp;#8217;d only be for that day which would be too late for me to drop a card in the mail. And even if did that, it wouldn&amp;#8217;t send the email to my wife. Thus, the following script was born.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='c1'&gt;// how many days in advance&lt;/span&gt;
&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;INTERVAL&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;10&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;

&lt;span class='c1'&gt;// the calendar to grab&lt;/span&gt;
&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;CALENDAR&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;Contacts&amp;#39; birthdays and events&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;

&lt;span class='c1'&gt;// who to send it to&lt;/span&gt;
&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;EMAIL_TO&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;email1@somewhere.com,email2@somewhere.com&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;

&lt;span class='c1'&gt;//  the subject to use&lt;/span&gt;
&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;SUBJECT&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;Birthdays for Seth next &amp;quot;&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='nx'&gt;INTERVAL&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot; days &amp;quot;&lt;/span&gt;

&lt;span class='kd'&gt;function&lt;/span&gt; &lt;span class='nx'&gt;onOpen&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;submenu&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;[{&lt;/span&gt; &lt;span class='nx'&gt;name&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;Send Birthday List&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
                   &lt;span class='nx'&gt;functionName&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;sendBirthdayList&amp;quot;&lt;/span&gt;
                 &lt;span class='p'&gt;}];&lt;/span&gt;
  &lt;span class='nx'&gt;SpreadsheetApp&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;getActiveSpreadsheet&lt;/span&gt;&lt;span class='p'&gt;().&lt;/span&gt;&lt;span class='nx'&gt;addMenu&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;Birthdays&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nx'&gt;submenu&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;  
&lt;span class='p'&gt;}&lt;/span&gt;

&lt;span class='kd'&gt;function&lt;/span&gt; &lt;span class='nx'&gt;sendBirthdayList&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
  &lt;span class='c1'&gt;// Get the event template string from the spreadsheet&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;emailTemplate&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;SpreadsheetApp&lt;/span&gt;
        &lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;getActiveSheet&lt;/span&gt;&lt;span class='p'&gt;().&lt;/span&gt;&lt;span class='nx'&gt;getRange&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;b2&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;).&lt;/span&gt;&lt;span class='nx'&gt;getValue&lt;/span&gt;&lt;span class='p'&gt;();&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;eventTemplate&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;SpreadsheetApp&lt;/span&gt;
        &lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;getActiveSheet&lt;/span&gt;&lt;span class='p'&gt;().&lt;/span&gt;&lt;span class='nx'&gt;getRange&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;b3&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;).&lt;/span&gt;&lt;span class='nx'&gt;getValue&lt;/span&gt;&lt;span class='p'&gt;();&lt;/span&gt;
  &lt;span class='c1'&gt;// Get the next INTERVAL days&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;start&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='k'&gt;new&lt;/span&gt; &lt;span class='nb'&gt;Date&lt;/span&gt;&lt;span class='p'&gt;();&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;end&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='k'&gt;new&lt;/span&gt; &lt;span class='nb'&gt;Date&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;start&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;getTime&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='mi'&gt;1000&lt;/span&gt;&lt;span class='o'&gt;*&lt;/span&gt;&lt;span class='mi'&gt;60&lt;/span&gt;&lt;span class='o'&gt;*&lt;/span&gt;&lt;span class='mi'&gt;60&lt;/span&gt;&lt;span class='o'&gt;*&lt;/span&gt;&lt;span class='mi'&gt;24&lt;/span&gt;&lt;span class='o'&gt;*&lt;/span&gt;&lt;span class='mi'&gt;10&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
 
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;cal&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;CalendarApp&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;openByName&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;CALENDAR&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;events&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;cal&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;getEvents&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;start&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nx'&gt;end&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
    
  &lt;span class='c1'&gt;// Add each event to the email&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;eventLines&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
  
  &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;e&lt;/span&gt; &lt;span class='k'&gt;in&lt;/span&gt; &lt;span class='nx'&gt;events&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;event&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;events&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='nx'&gt;e&lt;/span&gt;&lt;span class='p'&gt;];&lt;/span&gt;
    &lt;span class='nx'&gt;eventLines&lt;/span&gt; &lt;span class='o'&gt;+=&lt;/span&gt; &lt;span class='nx'&gt;eventTemplate&lt;/span&gt;
      &lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;replace&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;&amp;lt;TITLE&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nx'&gt;event&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;getTitle&lt;/span&gt;&lt;span class='p'&gt;())&lt;/span&gt;
      &lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;replace&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;&amp;lt;DAY&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nx'&gt;event&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;getEndTime&lt;/span&gt;&lt;span class='p'&gt;().&lt;/span&gt;&lt;span class='nx'&gt;toLocaleDateString&lt;/span&gt;&lt;span class='p'&gt;())&lt;/span&gt;
      &lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;replace&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;&amp;#39;s birthday&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
            
  &lt;span class='p'&gt;}&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;email&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;emailTemplate&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;replace&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;&amp;lt;EVENTS&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nx'&gt;eventLines&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
  &lt;span class='nx'&gt;MailApp&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;sendEmail&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;EMAIL_TO&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
                    &lt;span class='nx'&gt;SUBJECT&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='nx'&gt;now&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;toLocaleDateString&lt;/span&gt;&lt;span class='p'&gt;(),&lt;/span&gt; &lt;span class='nx'&gt;email&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Lo! Better living through technology.&lt;/p&gt;

&lt;p&gt;Right now, I have the template for the email stored in two cells in a spreadsheet and other configuration info at the top of the script. Those could probably go in cell data too, just so it&amp;#8217;d be easier to share this script. But it should give you an idea of lovely it is touse &lt;a href='http://www.google.com/google-d-s/scripts/scripts.html'&gt;Google Apps Script&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Using the triggers that are built-in (Triggers &amp;#60; Current script triggers&amp;#8230;), I have it scheduled to email us every 3 days at midnight. So, hopefully, I won&amp;#8217;t be missing any birthdays.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=56WDgJlXCik:9wyD37Ik_n0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=56WDgJlXCik:9wyD37Ik_n0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=56WDgJlXCik:9wyD37Ik_n0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=56WDgJlXCik:9wyD37Ik_n0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=56WDgJlXCik:9wyD37Ik_n0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/56WDgJlXCik" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2010/05/28/google-apps-scripts-for-fun-and-profit.html</feedburner:origLink></entry>
 
 <entry>
   <title>97 Things Every Programmer Should Know</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/lIMGLhBj7t4/97-things-every-programmer-should-know.html" />
   <updated>2010-04-05T00:00:00-07:00</updated>
   <id>http://sethmason.com/2010/04/05/97-things-every-programmer-should-know</id>
   <content type="html">&lt;p&gt;I recently picked up O&amp;#8217;Reilly&amp;#8217;s book &lt;a href='http://www.amazon.com/gp/product/0596809484?ie=UTF8&amp;amp;tag=slackorama-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=05968094840'&gt;97 Things Every Programmer Should Know: Collective Wisdom from the Experts&lt;/a&gt; as it was an eBook Deal of the Day. Overall, I thought it a great book for a programmer just starting out in the field. It had quite a few things that I wish I&amp;#8217;d known earlier. Probably because I took an unconventional route to programming.&lt;/p&gt;

&lt;p&gt;One thing I found interesting was that many of the essays made reference to the suggestion from &lt;a href='http://www.amazon.com/gp/product/020161622X?ie=UTF8&amp;amp;tag=slackorama-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=020161622X'&gt;The Pragmatic Programmer: From Journeyman to Master&lt;/a&gt; to learn one new langauage every year. The suggestion by itself wasn&amp;#8217;t interesting. I think many people have heard it. The thing that intrigued me about it was that &amp;#34;The Pragmatic Programmer&amp;#34; is published by Addison-Wesley. I don&amp;#8217;t think I&amp;#8217;ve seen such overt references to other publishers&amp;#8217; books in a programming book before.&lt;/p&gt;

&lt;p&gt;Kudos to you O&amp;#8217;Reilly.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=lIMGLhBj7t4:ztuZjsECsP0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=lIMGLhBj7t4:ztuZjsECsP0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=lIMGLhBj7t4:ztuZjsECsP0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=lIMGLhBj7t4:ztuZjsECsP0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=lIMGLhBj7t4:ztuZjsECsP0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/lIMGLhBj7t4" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2010/04/05/97-things-every-programmer-should-know.html</feedburner:origLink></entry>
 
 <entry>
   <title>A Better Bugzilla2</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/zcB8XZU_Uvw/a-better-bugzilla2-look.html" />
   <updated>2010-02-18T00:00:00-08:00</updated>
   <id>http://sethmason.com/2010/02/18/a-better-bugzilla2-look</id>
   <content type="html">&lt;p&gt;For a variety of reasons, I&amp;#8217;m still using version 2 of &lt;a href='http://www.bugzilla.org'&gt;Bugzilla&lt;/a&gt; at work even though it&amp;#8217;s considered &amp;#8220;dead&amp;#8221; by Bugzilla. And the interface looks like it&amp;#8217;s been dead awhile.&lt;/p&gt;

&lt;p&gt;But, thanks to &lt;a href='https://addons.mozilla.org/en-US/firefox/addon/748'&gt;Greasemonkey&lt;/a&gt;, I&amp;#8217;m not stuck with the interface. Inspired by &lt;a href='http://www.squarefree.com/2009/02/26/tidybug/'&gt;Jesse Ruderman&amp;#8217;s TidyBug&lt;/a&gt;, I made my own Greasemonkey script which I&amp;#8217;m calling &lt;a href='/userscripts/tidybz2.user.js'&gt;TidyBz2&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s the before shot:&lt;/p&gt;
&lt;figure&gt;
&lt;img class='noline' height='330' src='/images/20100218_tidybz2-pre.png' width='540' /&gt;
&lt;/figure&gt;
&lt;p&gt;Here&amp;#8217;s the after shot:&lt;/p&gt;
&lt;figure&gt;
&lt;img class='noline' height='310' src='/images/20100218_tidybz2-post.png' width='540' /&gt;
&lt;/figure&gt;
&lt;p&gt;It hides the huge header, makes the title of the issue much more prominent and fixes some other formatting nits I disliked. Information that I think is more important is moved up to the top as well. But there are also perks you can&amp;#8217;t see. You can use the keyboard to do pretty much anything you need to: comment, resolve, browse the URL, search, navigate between comments a la gmail, etc. Once you have it installed, just press &lt;kbd&gt;?&lt;/kbd&gt; to see all the keyboard shortcuts.&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s up on &lt;a href='http://github.com/slackorama/tidybz2'&gt;GitHub&lt;/a&gt; so feel free to fork it and make any modifications you&amp;#8217;d like to see.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=zcB8XZU_Uvw:eOGpF7vcGbU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=zcB8XZU_Uvw:eOGpF7vcGbU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=zcB8XZU_Uvw:eOGpF7vcGbU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=zcB8XZU_Uvw:eOGpF7vcGbU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=zcB8XZU_Uvw:eOGpF7vcGbU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/zcB8XZU_Uvw" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2010/02/18/a-better-bugzilla2-look.html</feedburner:origLink></entry>
 
 <entry>
   <title>PragPub</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/xx6AKw3O2lo/pragpub-.html" />
   <updated>2010-02-04T00:00:00-08:00</updated>
   <id>http://sethmason.com/2010/02/04/pragpub-</id>
   <content type="html">&lt;p&gt;This is probably way late but &lt;a href='http://www.pragprog.com' title='The Pragmatic Bookshelf'&gt;The Pragmatic Bookshelf&lt;/a&gt;, publishers of fine programming books, have launched a &lt;a href='http://www.pragprog.com/magazines' title='PragPub'&gt;free monthly magazine&lt;/a&gt; called &lt;em&gt;PragPub&lt;/em&gt; that covers a variety of topics. For instance, this month has a nice overview of how to use &lt;a href='http://sass-lang.com/' title='Sytactically awesome stylesheets'&gt;Sass&lt;/a&gt;. Past topics have included articles about Clojure, automating screencasts and managing life projects.&lt;/p&gt;

&lt;p&gt;Granted, they are ultimately pushing their books (which I think are excellent) but they are releasing the magazine in PDF, epub and mobi. How cool is that?&lt;/p&gt;

&lt;p&gt;&lt;a href='http://www.pragprog.com/magazines' title='PragPub'&gt;PragPub&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=xx6AKw3O2lo:7nkEyDy2aKE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=xx6AKw3O2lo:7nkEyDy2aKE:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=xx6AKw3O2lo:7nkEyDy2aKE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=xx6AKw3O2lo:7nkEyDy2aKE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=xx6AKw3O2lo:7nkEyDy2aKE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/xx6AKw3O2lo" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2010/02/04/pragpub-.html</feedburner:origLink></entry>
 
 <entry>
   <title>Visit your local library via Amazon.com</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/dKpmMaxE7AU/visit-your-local-library-via-amazoncom.html" />
   <updated>2010-01-30T00:00:00-08:00</updated>
   <id>http://sethmason.com/2010/01/30/visit-your-local-library-via-amazoncom</id>
   <content type="html">&lt;figure class='left'&gt;
&lt;img height='79' src='/images/20100130.gif' width='79' /&gt;
&lt;/figure&gt;
&lt;p&gt;I love reading. It&amp;#8217;s how I get most my knowledge (or lack thereof). And I also really like &lt;a href='http://en.wikipedia.org/wiki/Bookmarklet' title='What is a bookmarklet?'&gt;bookmarklets&lt;/a&gt;. They make browsing the web much easier.&lt;/p&gt;

&lt;p&gt;And I found this great bookmarklet that let&amp;#8217;s you find a book that you are viewing on Amazon.com at your local library. It&amp;#8217;s called &lt;a href='http://xisbn.worldcat.org/liblook2/index.htm' title='xISBN Bookmarket'&gt;xISBN Bookmarklet&lt;/a&gt;. I just call it &amp;#8216;library lookup v2.&amp;#8217; It was inspired by Jon Udell&amp;#8217;s &lt;a href='http://jonudell.net/LibraryLookupGenerator.html'&gt;LibraryLookup&lt;/a&gt; which I used to use so I just updated the version.&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s really easy to set up and use. Set up is &lt;a href='http://xisbn.worldcat.org/liblook2/index.htm' title='xISBN Bookmarket'&gt;covered on its page&lt;/a&gt; under &amp;#34;Try xISBN Bookmarkets.&amp;#34; One thing you&amp;#8217;ll need in advance is to know the base URL of your library&amp;#8217;s catalog. Mine is &lt;a href='http://catalog.colapl.org'&gt;http://catalog.colapl.org&lt;/a&gt; for example.&lt;/p&gt;

&lt;p&gt;Using it is even eaiser. You just look at a page on Amazon or Barnes and Noble and click the bookmarklet. Or if there&amp;#8217;s a &lt;a href='http://en.wikipedia.org/wiki/International_Standard_Book_Number' title='ISBN'&gt;ISBN&lt;/a&gt; on a page, you can just select it and click the bookmarklet. It&amp;#8217;ll take you to a page &lt;a href='http://xisbn.worldcat.org/liblook/resolve.htm?res_id=http://catalog.colapl.org/&amp;amp;rft.isbn=1878424076&amp;amp;url_ver=Z39.88-2004&amp;amp;rft_val_fmt=info:ofi/fmt:kev:mtx:book' title='Seth Speaks'&gt;like this.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Depending on your library, you could place a hold on it and then pick it up. Remember, support your local library!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=dKpmMaxE7AU:6abbsBeVUZo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=dKpmMaxE7AU:6abbsBeVUZo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=dKpmMaxE7AU:6abbsBeVUZo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=dKpmMaxE7AU:6abbsBeVUZo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=dKpmMaxE7AU:6abbsBeVUZo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/dKpmMaxE7AU" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2010/01/30/visit-your-local-library-via-amazoncom.html</feedburner:origLink></entry>
 
 <entry>
   <title>And I'm back</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/WIK26alZdYY/and-im-back.html" />
   <updated>2010-01-25T00:00:00-08:00</updated>
   <id>http://sethmason.com/2010/01/25/and-im-back</id>
   <content type="html">&lt;p&gt;OK, so it&amp;#8217;s been over a year since &lt;a href='http://sethmason.com/2009/01/06/resolutions.html'&gt;my last post&lt;/a&gt; (of which I completed all except two). But here I am now with a wonderful new design, thanks to &lt;a href='http://www.sproutcreative.com'&gt;Sprout Creative&lt;/a&gt; and a new outlook on blogging.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve taken a bit of a different approach to blogging this time. Instead of using a content management system like &lt;a href='http://www.wordpress.org'&gt;Wordpress&lt;/a&gt; or &lt;a href='http://www.movabletype.com'&gt;Movable Type&lt;/a&gt;, I&amp;#8217;m opting for static html. The pages are generated by &lt;a href='http://wiki.github.com/mojombo/jekyll/'&gt;Jekyll&lt;/a&gt; after being written in &lt;a href='http://www.gnu.org/software/emacs/emacs.html'&gt;GNU Emacs&lt;/a&gt;. I&amp;#8217;m hoping that this tool set makes it easier for me to get posts up. &lt;a href='/contact.html'&gt;Let me know&lt;/a&gt; if you have any questions about the process or if you have any comments about the design.&lt;/p&gt;

&lt;p&gt;We&amp;#8217;ll see if it sticks. If you don&amp;#8217;t hear from me for another year, then you&amp;#8217;ll know that this little experiment failed.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=WIK26alZdYY:hshqnUimlKo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=WIK26alZdYY:hshqnUimlKo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=WIK26alZdYY:hshqnUimlKo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=WIK26alZdYY:hshqnUimlKo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=WIK26alZdYY:hshqnUimlKo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/WIK26alZdYY" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2010/01/25/and-im-back.html</feedburner:origLink></entry>
 
 <entry>
   <title>Resolutions</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/aLPS48Ppse8/resolutions.html" />
   <updated>2009-01-06T00:00:00-08:00</updated>
   <id>http://sethmason.com/2009/01/06/resolutions</id>
   <content type="html">&lt;p&gt;I have been mulling these over for the past couple of days but I thought I&amp;#8217;d post them to the internets in hopes of injecting some accountability into the whole morass.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Get knee fixed&lt;/li&gt;
	&lt;li&gt;Go on vacation somewhere besides San Francisco/Oakland or Rhode Island with wife and child&lt;/li&gt;
	&lt;li&gt;Take better photos&lt;/li&gt;
	&lt;li&gt;Bake cake for wife&amp;#8217;s birthday&lt;/li&gt;
	&lt;li&gt;Lay off the sugar and don&amp;#8217;t lay around as much (uhm, after I bake the cake)&lt;/li&gt;
	&lt;li&gt;Learn Clojure&lt;/li&gt;
	&lt;li&gt;Fix what ails desktop computer&lt;/li&gt;
	&lt;li&gt;Clean out top drawer of bureau&lt;/li&gt;
	&lt;li&gt;Rebalance 401K&lt;/li&gt;
	&lt;li&gt;Turn 40 (yeah, I&amp;#8217;m old)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you are reading this and want a health check, feel free to &lt;a href="http://sethmason.com/contact/"&gt;ping me&lt;/a&gt;.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=aLPS48Ppse8:qPta6yDBgns:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=aLPS48Ppse8:qPta6yDBgns:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=aLPS48Ppse8:qPta6yDBgns:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=aLPS48Ppse8:qPta6yDBgns:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=aLPS48Ppse8:qPta6yDBgns:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/aLPS48Ppse8" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2009/01/06/resolutions.html</feedburner:origLink></entry>
 
 <entry>
   <title>Dojo snippets for emacs</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/KmvoegwVvoc/dojo-snippets-for-emacs.html" />
   <updated>2008-12-14T00:00:00-08:00</updated>
   <id>http://sethmason.com/2008/12/14/dojo-snippets-for-emacs</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve been using &lt;a href="http://www.dojotoolkit.org"&gt;Dojo&lt;/a&gt; for a couple of months now and I really like it as it makes writing cross-browser JavaScript a breeze.&lt;/p&gt;
&lt;p style="float:right;"&gt;&lt;img src="/images/13.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve also been using &lt;a href="http://www.gnu.org/software/emacs/"&gt;emacs&lt;/a&gt; with &lt;a href="http://pluskid.lifegoo.com/upload/project/yasnippet/doc/index.html"&gt;YASnippet&lt;/a&gt; for a bit now too.  YASnippet is a plugin for emacs that allows you to define a snippet that&amp;#8217;ll get transformed into something much bigger in your file.  It saves you a lot of typing as you can define areas in your snippet where you get prompted to enter text and it&amp;#8217;ll autofill with your entries.  Very handy, let me tell you.  There&amp;#8217;s a &lt;a href="http://www.youtube.com/watch?v=vOj7btx3ATg"&gt;screencast on YouTube&lt;/a&gt; showing how powerful it is.&lt;/p&gt;
&lt;p&gt;Which brings me to the point of this post. I&amp;#8217;ve created a package of snippets aimed at people writing Dojo based JavaScript.  It&amp;#8217;s hosted up on &lt;a href="http://www.github.com/slackorama/dojo-yasnippets/tree/master"&gt;GitHub&lt;/a&gt; if you would like to use it.  Currently, it only includes (what I feel to be) the major functions but feel free to contact me if you&amp;#8217;d like to add more.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=KmvoegwVvoc:r7TeZaAmQX4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=KmvoegwVvoc:r7TeZaAmQX4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=KmvoegwVvoc:r7TeZaAmQX4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=KmvoegwVvoc:r7TeZaAmQX4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=KmvoegwVvoc:r7TeZaAmQX4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/KmvoegwVvoc" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2008/12/14/dojo-snippets-for-emacs.html</feedburner:origLink></entry>
 
 <entry>
   <title>svn log made easy</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/n_rj-qhUVdQ/svn-log-made-easy.html" />
   <updated>2008-12-01T00:00:00-08:00</updated>
   <id>http://sethmason.com/2008/12/01/svn-log-made-easy</id>
   <content type="html">&lt;p&gt;&lt;a href="http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.log.html"&gt;svn log&lt;/a&gt; is a great command to see what&amp;#8217;s going on in your subversion repository.  Unfortunately, at my job we are using a really old version (1.1.4!),  a version so old that it doesn&amp;#8217;t support the &lt;code&gt;--limit&lt;/code&gt; argument.  This makes the &lt;code&gt;svn log&lt;/code&gt; painful to use as it outputs &lt;span class="caps"&gt;EVERYTHING&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Luckily, &lt;code&gt;svn log&lt;/code&gt; is so awesome that it overcomes this weakness and allows you to use a date based criteria for listing log statements.  Unfortunately, the syntax is hard for me to remember.  Thus, I wrote this little shell script function that&amp;#8217;ll list activity for the given days in the past.  You can put it in your &lt;code&gt;.bashrc&lt;/code&gt; and run it like &lt;code&gt;svnlog 14&lt;/code&gt;.  That&amp;#8217;ll output logs from the last 14 days.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;svnlog&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;OFFSET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;
    &lt;span class="nb"&gt;shift&lt;/span&gt;
&lt;span class="nb"&gt;    &lt;/span&gt;svn log -r HEAD:&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;`date -d &amp;quot;&lt;/span&gt;&lt;span class="nv"&gt;$OFFSET&lt;/span&gt; days ago&lt;span class="s2"&gt;&amp;quot; +%Y-%m-%d`&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="nv"&gt;$*&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=n_rj-qhUVdQ:FTD2J2zh4KI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=n_rj-qhUVdQ:FTD2J2zh4KI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=n_rj-qhUVdQ:FTD2J2zh4KI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=n_rj-qhUVdQ:FTD2J2zh4KI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=n_rj-qhUVdQ:FTD2J2zh4KI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/n_rj-qhUVdQ" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2008/12/01/svn-log-made-easy.html</feedburner:origLink></entry>
 
 <entry>
   <title>Commandline Fun</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/_4BrxgCu1C8/commandline-fun.html" />
   <updated>2008-11-05T00:00:00-08:00</updated>
   <id>http://sethmason.com/2008/11/05/commandline-fun</id>
   <content type="html">&lt;p&gt;Insprired by &lt;a href="http://www.ibm.com/developerworks/linux/library/l-friendfeed/?S_TACT=105AGX01&amp;amp;S_CMP=HP"&gt;an article on ibm.com&lt;/a&gt; about using &lt;a href="http://www.twitter.com"&gt;twitter&lt;/a&gt; from the command line, I wrote up a simple little script to get your friends updates.&lt;/p&gt;
&lt;p&gt;Here it is:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;curl -s -u username:password &lt;span class="se"&gt;\&lt;/span&gt;
http://twitter.com/statuses/friends_timeline.xml |
awk &lt;span class="s1"&gt;&amp;#39;/&amp;lt;text/ {&lt;/span&gt;
&lt;span class="s1"&gt;  gsub(/&amp;lt;\/*text&amp;gt;/,&amp;quot;&amp;quot;);&lt;/span&gt;
&lt;span class="s1"&gt;  text = $0;&lt;/span&gt;
&lt;span class="s1"&gt;}&lt;/span&gt;
&lt;span class="s1"&gt;/screen_name/ {&lt;/span&gt;
&lt;span class="s1"&gt;  gsub(/ *&amp;lt;\/*screen_name&amp;gt;/,&amp;quot;&amp;quot;);&lt;/span&gt;
&lt;span class="s1"&gt;  print $0;&lt;/span&gt;
&lt;span class="s1"&gt;  print text;&lt;/span&gt;
&lt;span class="s1"&gt;}&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;All it does it is use &lt;a href="http://curl.haxx.se/"&gt;cURL&lt;/a&gt; to grab the timeline from twitter.  Then it passes it through &lt;a href="http://en.wikipedia.org/wiki/Awk"&gt;awk&lt;/a&gt; to extract the name and text from your buddies.  Simple and silly, yes?&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=_4BrxgCu1C8:nWVGe7jAVXE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=_4BrxgCu1C8:nWVGe7jAVXE:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=_4BrxgCu1C8:nWVGe7jAVXE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=_4BrxgCu1C8:nWVGe7jAVXE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=_4BrxgCu1C8:nWVGe7jAVXE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/_4BrxgCu1C8" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2008/11/05/commandline-fun.html</feedburner:origLink></entry>
 
 <entry>
   <title>More Keyboard Fun</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/G999Oe8ICi0/more-keyboard-fun.html" />
   <updated>2008-10-28T00:00:00-07:00</updated>
   <id>http://sethmason.com/2008/10/28/more-keyboard-fun</id>
   <content type="html">&lt;p&gt;Continuing along on the keyboard theme, most Google apps have keyboard shortcuts.  I&amp;#8217;ve started using Google calendar and found the &lt;a href="http://www.google.com/support/calendar/bin/answer.py?hl=en-il&amp;amp;answer=37034"&gt;keyboard shortcuts&lt;/a&gt; for it as well.  Very handy.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.google.com/support/calendar/bin/answer.py?hl=en-il&amp;amp;answer=37034"&gt;Google Calendar keyboard shortcuts&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=G999Oe8ICi0:-gB_N-Qs2js:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=G999Oe8ICi0:-gB_N-Qs2js:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=G999Oe8ICi0:-gB_N-Qs2js:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=G999Oe8ICi0:-gB_N-Qs2js:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=G999Oe8ICi0:-gB_N-Qs2js:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/G999Oe8ICi0" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2008/10/28/more-keyboard-fun.html</feedburner:origLink></entry>
 
 <entry>
   <title>Throw away that mouse</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/O_lZBM-QpqA/throw-away-that-mouse.html" />
   <updated>2008-10-10T00:00:00-07:00</updated>
   <id>http://sethmason.com/2008/10/10/throw-away-that-mouse</id>
   <content type="html">&lt;p&gt;&lt;img src="http://sethmason.com/images/12.png" title="Mouseless browsing screenshot" alt="Mouseless browsing screenshot" /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m not a big fan of using the mouse.  It pains me to reach for it to accomplish something.  That&amp;#8217;s why I was really excited to find the &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/879"&gt;Mouseless Browsing&lt;/a&gt; add-on for &lt;a href="http://www.getfirefox.com"&gt;Firefox&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From the add-on&amp;#8217;s &lt;a href="http://www.mouseless.de/index.php?/content/view/14/26/"&gt;homepage&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Mouseless Browsing (&lt;span class="caps"&gt;MLB&lt;/span&gt;) is a Firefox-Extension which enables you to browse the internet with the keyboard. The basic principle is to add small boxes with unique ids behind every link and/or form element. You just have to type in the id and press enter (there is also an automatice mode available) to trigger the corresponding action i.e. following a link, pressing a button or selecting a  textfield.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I could never get &lt;a href="http://w3m.sourceforge.net/"&gt;w3m&lt;/a&gt; working how I liked it so Mouseless Browsing really scratches an itch I have.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=O_lZBM-QpqA:KIvrXpT83lU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=O_lZBM-QpqA:KIvrXpT83lU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=O_lZBM-QpqA:KIvrXpT83lU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=O_lZBM-QpqA:KIvrXpT83lU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=O_lZBM-QpqA:KIvrXpT83lU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/O_lZBM-QpqA" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2008/10/10/throw-away-that-mouse.html</feedburner:origLink></entry>
 
 <entry>
   <title>Speaking of keyboard navigation....</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/sNxBpJXN1fA/speaking-of-keyboard-navigation.html" />
   <updated>2008-10-10T00:00:00-07:00</updated>
   <id>http://sethmason.com/2008/10/10/speaking-of-keyboard-navigation</id>
   <content type="html">&lt;p&gt;Did you know that you can navigate &lt;a href="http://www.google.com"&gt;Google&lt;/a&gt; search results with your keyboard?&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s a &lt;a href="http://labs.google.com"&gt;Google Labs&lt;/a&gt; experiment so you&amp;#8217;ll have to enable it on any machine you want to try it.&lt;/p&gt;
&lt;p&gt;To experience the glory of navigating search results with your keyboard, head on over to &lt;a href="http://www.google.com/experimental/"&gt;Google Experimental Search&lt;/a&gt; and click &amp;quot;Join&amp;quot; for the Keyboard Shortcuts experiment.  Then it&amp;#8217;s simply a matter of pressing &amp;quot;J&amp;quot; to navigate down the search results and &amp;quot;K&amp;quot; to move up  your search results on Google.  Pressing &amp;quot;O&amp;quot; will then open up the link for you.  There are a few others that you might like as well so give this experiment a whirl.&lt;/p&gt;
&lt;p&gt;The keyboard shortcuts key will also show up on your search results page so that&amp;#8217;ll help you remember them.  (Experienced &lt;a href="http://www.vim.org"&gt;vi&lt;/a&gt; users will of course recognize these keyboard shortcuts.)&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=sNxBpJXN1fA:SUvXzXK4JTU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=sNxBpJXN1fA:SUvXzXK4JTU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=sNxBpJXN1fA:SUvXzXK4JTU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=sNxBpJXN1fA:SUvXzXK4JTU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=sNxBpJXN1fA:SUvXzXK4JTU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/sNxBpJXN1fA" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2008/10/10/speaking-of-keyboard-navigation.html</feedburner:origLink></entry>
 
 <entry>
   <title>jQuery and Friendfeed experimentation</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/zteO3ESlzYY/jquery-and-friendfeed-experimentation.html" />
   <updated>2008-07-24T00:00:00-07:00</updated>
   <id>http://sethmason.com/2008/07/24/jquery-and-friendfeed-experimentation</id>
   <content type="html">&lt;p&gt;So, I created a little page that&amp;#8217;ll dump out the last 30 items from my &lt;a href="http://friendfeed.com/slackorama"&gt;Friendfeed&lt;/a&gt; feed.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.jquery.com"&gt;jQuery&lt;/a&gt; and &lt;a href="http://friendfeed.com/api/"&gt;the Friendfeed &lt;span class="caps"&gt;API&lt;/span&gt;&lt;/a&gt; make it incredibly easy.  It only took me about 15 minutes to get it working.  The rest of the time was making it ugly with my crazy design skills.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s over on my &lt;a href="http://www.slackorama.com/projects/friendfeed/jquery-test.html"&gt;vanity site&lt;/a&gt; if you are curious to check it out.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=zteO3ESlzYY:NnJBjgnVGwc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=zteO3ESlzYY:NnJBjgnVGwc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=zteO3ESlzYY:NnJBjgnVGwc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=zteO3ESlzYY:NnJBjgnVGwc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=zteO3ESlzYY:NnJBjgnVGwc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/zteO3ESlzYY" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2008/07/24/jquery-and-friendfeed-experimentation.html</feedburner:origLink></entry>
 
 <entry>
   <title>Google Code Search to the rescue</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/ZwZD6chJQVQ/google-code-search-to-the-rescue.html" />
   <updated>2008-06-18T00:00:00-07:00</updated>
   <id>http://sethmason.com/2008/06/18/google-code-search-to-the-rescue</id>
   <content type="html">&lt;p&gt;Mmkay, this tip is probably a gazillion years late but &lt;a href="http://www.google.com/codesearch"&gt;Google Code Search&lt;/a&gt; is a great resource for a budding developer.  Heck, I&amp;#8217;m a relatively seasoned developer and I use it.&lt;/p&gt;
&lt;p&gt;It allows you to search public source code using a variety of methods.  You can search for an exact string or a regex.  You can search certain files, certain packages and certain languages.&lt;/p&gt;
&lt;p&gt;For instance, today I was curious how to use the Perl &lt;span class="caps"&gt;API&lt;/span&gt; for writing a  &lt;a href="http://www.pidgin.im"&gt;Pidgin&lt;/a&gt; plugin as their documentation is a tad sparce.  A quick search looking for &lt;a href="http://www.google.com/codesearch?q=Purple%3A%3AFind%3A%3ABuddy&amp;amp;hl=en&amp;amp;btnG=Search+Code"&gt;Purple::Find::buddy&lt;/a&gt; and I found a whole bunch of examples.  You can also use it for silly things, like looking for &lt;a href="http://www.google.com/codesearch?hl=en&amp;amp;lr=&amp;amp;q=%22meaning+of+life%22&amp;amp;sbtn=Search"&gt;quotes&lt;/a&gt; from &amp;quot;Hitchiker&amp;#8217;s Guide To The Galaxy.&amp;quot;&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s official, Google now owns me.  &lt;em&gt;sigh&lt;/em&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ZwZD6chJQVQ:9YbLpcWEulk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ZwZD6chJQVQ:9YbLpcWEulk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ZwZD6chJQVQ:9YbLpcWEulk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=ZwZD6chJQVQ:9YbLpcWEulk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ZwZD6chJQVQ:9YbLpcWEulk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/ZwZD6chJQVQ" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2008/06/18/google-code-search-to-the-rescue.html</feedburner:origLink></entry>
 
 <entry>
   <title>Machine specific startup files in BASH</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/nIp3yeEZFo0/machine-specific-startup-files-in-bash.html" />
   <updated>2008-06-10T00:00:00-07:00</updated>
   <id>http://sethmason.com/2008/06/10/machine-specific-startup-files-in-bash</id>
   <content type="html">&lt;p&gt;Here&amp;#8217;s a helpful tip if you use a couple of different machines and need specific things set up on a specific machine.&lt;/p&gt;
&lt;p&gt;Just add the following to your &lt;a href="http://en.wikipedia.org/wiki/Bash"&gt;.bashrc&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="sh"&gt;&lt;span class="c"&gt;## Read Generic RC                                                                            &lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;rcfile in &lt;span class="s2"&gt;&amp;quot;$HOME/.shell/&amp;quot;&lt;/span&gt;*.rc;
&lt;span class="k"&gt;do                        &lt;/span&gt;
&lt;span class="k"&gt;    if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; -r &lt;span class="s2"&gt;&amp;quot;$rcfile&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;; 
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Thus, common things are stored in your .bashrc (like aliases, functions, etc.) and things you want on a specific machine are in their own directory.&lt;/p&gt;
&lt;p&gt;Then, just put whatever machine specific files you want/need in ~/.shell and name them with .rc.  For instance, I have ~/.shell/smurf.rc that sets up some smurf information.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="sh"&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;FAVORITE_SMURF&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Poppa Smurf&amp;quot;&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SMURF_LOVER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/bin/blue_love  
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That way, if I ever need something that&amp;#8217;s specific to a machine, I just drop it in my .shell directory and away we go.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=nIp3yeEZFo0:p_M3IPYcaZU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=nIp3yeEZFo0:p_M3IPYcaZU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=nIp3yeEZFo0:p_M3IPYcaZU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=nIp3yeEZFo0:p_M3IPYcaZU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=nIp3yeEZFo0:p_M3IPYcaZU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/nIp3yeEZFo0" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2008/06/10/machine-specific-startup-files-in-bash.html</feedburner:origLink></entry>
 
 <entry>
   <title>Cost of try/catch in JavaScript</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/Of_i8zI46_w/cost-of-trycatch-in-javascript.html" />
   <updated>2008-02-15T00:00:00-08:00</updated>
   <id>http://sethmason.com/2008/02/15/cost-of-trycatch-in-javascript</id>
   <content type="html">&lt;p&gt;I know that in Java, using a try/catch is fairly expensive vs. a if check.  Since JavaScript has the same syntax for the most part, I wrote up a simple benchmarking script to test it out.   On my box, it outputs:&lt;/p&gt;
&lt;pre&gt;if avg: 0.029
try avg: 1.372&lt;/pre&gt;
&lt;p&gt;Note, that you&amp;#8217;ll need &lt;a href="http://ww.getfirebug.com"&gt;the Firebug plugin&lt;/a&gt; for &lt;a href="http://www.getfirefox.com"&gt;Firefox&lt;/a&gt; in order to run this.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="javascript"&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;tryFunc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;fake&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;hi there&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// eat it!&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;ifFunc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;fake&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;hi there&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;benchmark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;func&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;repeats&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;startTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;endTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;repeats&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;startTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;getTime&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;func&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;call&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;endTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;getTime&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;endTime&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;startTime&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot; avg: &amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;repeats&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;benchmark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;if&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ifFunc&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;benchmark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;try&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;tryFunc&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=Of_i8zI46_w:HSyiH79WLa0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=Of_i8zI46_w:HSyiH79WLa0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=Of_i8zI46_w:HSyiH79WLa0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=Of_i8zI46_w:HSyiH79WLa0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=Of_i8zI46_w:HSyiH79WLa0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/Of_i8zI46_w" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2008/02/15/cost-of-trycatch-in-javascript.html</feedburner:origLink></entry>
 
 <entry>
   <title>HOWTO: Invoke a shell script on a file on save with emacs</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/gm2as-V4nu8/emacs-execute-shell-script.html" />
   <updated>2008-01-22T00:00:00-08:00</updated>
   <id>http://sethmason.com/2008/01/22/emacs-execute-shell-script</id>
   <content type="html">&lt;p&gt;At my &lt;a href="http://www.cheetahmail.com"&gt;current job&lt;/a&gt;, we use a lot of &lt;a href="http://www.template-toolkit.org"&gt;Template Toolkit&lt;/a&gt;.  Due to some design decisions (that I consider a tad strange), we have to run a shell script on the template files (e.g. files that end with &amp;#8220;.tt&amp;#8221;) after they are saved in order for them to be displayed on the dev site.&lt;/p&gt;
&lt;p&gt;Since I started using emacs about two months ago, I&amp;#8217;ve learned quite a bit.  A new thing on the learning heap is the &lt;a href="http://www.gnu.org/software/emacs/elisp/html_node/Saving-Buffers.html"&gt;after-save-hook.&lt;/a&gt; Emacs to the rescue yet again.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a emacs lisp function I wrote to automate the execution of the script when a template file is saved:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="scheme"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;ssm-cheetah-after-save-hook&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="s"&gt;&amp;quot;After saving a tt file, run the language_update file&amp;quot;&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="nv"&gt;buffer-file-name&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;progn&lt;/span&gt;
        &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;is-tt-file&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;numberp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;string-match&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;\.tt$&amp;quot;&lt;/span&gt; &lt;span class="nv"&gt;buffer-file-name&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
        &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="nv"&gt;is-tt-file&lt;/span&gt;
            &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;progn&lt;/span&gt;
              &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;cmd&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;concat&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;B&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/bin/YOURSCRIPTHERE --template=&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
              &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;shell-command&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;concat&lt;/span&gt; &lt;span class="nv"&gt;cmd&lt;/span&gt; &lt;span class="nv"&gt;buffer-file-name&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
              &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;message&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;Updated template with %s&amp;quot;&lt;/span&gt; &lt;span class="nv"&gt;buffer-file-name&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;add-hook&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;after-save-hook&lt;/span&gt; &lt;span class="ss"&gt;&amp;#39;ssm-cheetah-after-save-hook&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;What it does, is first defines a function that checks to see if we have a file name, (which should probably always be true since we are saving now that I look at it).  If we do, check to see if the name ends with &amp;#8220;.tt.&amp;#8221;  If it does, pass the name of the file to the shell script and output a message to the user saying the template was updated.  Finally, the function is added to the after save hook.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=gm2as-V4nu8:6pKf6_hl6Eo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=gm2as-V4nu8:6pKf6_hl6Eo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=gm2as-V4nu8:6pKf6_hl6Eo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=gm2as-V4nu8:6pKf6_hl6Eo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=gm2as-V4nu8:6pKf6_hl6Eo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/gm2as-V4nu8" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2008/01/22/emacs-execute-shell-script.html</feedburner:origLink></entry>
 
 <entry>
   <title>Emacs Tips</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/LM3RJ9yEi0Q/emacs-tips.html" />
   <updated>2007-12-28T00:00:00-08:00</updated>
   <id>http://sethmason.com/2007/12/28/emacs-tips</id>
   <content type="html">&lt;p&gt;Since I&amp;#8217;ve been programming more Perl than Java lately, I&amp;#8217;ve started using emacs as my primary &lt;span class="caps"&gt;IDE&lt;/span&gt;.  Been checking out a few sites with tips and tricks to help me along the path of conversion from vi to emacs.  &lt;a href="http://trey-jackson.blogspot.com/"&gt;Trey Jackson&amp;#8217;s blog&lt;/a&gt; seems pretty promising.&lt;/p&gt;
&lt;p&gt;Hopefully, he can keep up the tip a week format.  Allegedly, he has 150 tips so he should be good for 3 or so years.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=LM3RJ9yEi0Q:7dhjSh_Nu08:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=LM3RJ9yEi0Q:7dhjSh_Nu08:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=LM3RJ9yEi0Q:7dhjSh_Nu08:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=LM3RJ9yEi0Q:7dhjSh_Nu08:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=LM3RJ9yEi0Q:7dhjSh_Nu08:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/LM3RJ9yEi0Q" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/12/28/emacs-tips.html</feedburner:origLink></entry>
 
 <entry>
   <title>Lisp Fun</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/ATdYGcKaLD0/lisp-fun.html" />
   <updated>2007-10-30T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/10/30/lisp-fun</id>
   <content type="html">&lt;p&gt;Interested in learning &lt;a href="http://en.wikipedia.org/wiki/Lisp_%28programming_language%29"&gt;Lisp&lt;/a&gt;?  A new site has launched with screencast episodes about developing an application in Lisp.  The site is &lt;a href="http://www.lispcast.com/"&gt;LispCast&lt;/a&gt; and so far there are three videos up.  It&amp;#8217;s about building a web application that is a clone of &lt;a href="http://www.reddit.com"&gt;Reddit&lt;/a&gt;.  The subject of the videos so far are writing it, developing tests and refactoring. They each clock in at about twenty minutes and are quite helpful.&lt;br /&gt;
It looks like the creator, one Eric Normand,  has some pretty big plans for the site.  Let&amp;#8217;s hope that he is able to do it.  I know I&amp;#8217;m rooting for him.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ATdYGcKaLD0:x6_XOtjEIQ0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ATdYGcKaLD0:x6_XOtjEIQ0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ATdYGcKaLD0:x6_XOtjEIQ0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=ATdYGcKaLD0:x6_XOtjEIQ0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ATdYGcKaLD0:x6_XOtjEIQ0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/ATdYGcKaLD0" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/10/30/lisp-fun.html</feedburner:origLink></entry>
 
 <entry>
   <title>Intellij IDEA and Linux: Not Like Peanut Butter and Chocolate</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/M2LtzKuYJy0/intellij-idea-and-linux-not-like-peanut-butter-and-chocolate.html" />
   <updated>2007-10-22T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/10/22/intellij-idea-and-linux-not-like-peanut-butter-and-chocolate</id>
   <content type="html">&lt;p&gt;I love me some Intellij and I love me some Linux.  Unfortunately, they don&amp;#8217;t play too well together.  Lots of keyboard shortcuts do operating system commands.&lt;/p&gt;
&lt;p&gt;For instance, &lt;code&gt;CTRL+ALT+L&lt;/code&gt; reformats your code in Intellij but it never gets a chance to that because that keyboard sequence locks the desktop on Ubuntu.  Besides changing quite a few keyboard shortcuts in the administration screen, does anyone have any tips or tricks?&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=M2LtzKuYJy0:CBPSmrssjhI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=M2LtzKuYJy0:CBPSmrssjhI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=M2LtzKuYJy0:CBPSmrssjhI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=M2LtzKuYJy0:CBPSmrssjhI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=M2LtzKuYJy0:CBPSmrssjhI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/M2LtzKuYJy0" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/10/22/intellij-idea-and-linux-not-like-peanut-butter-and-chocolate.html</feedburner:origLink></entry>
 
 <entry>
   <title>Editing Huge Amounts of Files Easily</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/XUm1dha4_Zw/editing-huge-amounts-of-files-easily.html" />
   <updated>2007-10-06T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/10/06/editing-huge-amounts-of-files-easily</id>
   <content type="html">&lt;p&gt;Where I &lt;a href="http://www.ign.com"&gt;work&lt;/a&gt;, we have tons of static html files that are published using our custom built Content Management System.  Sometimes, we have to change a single line on every single page.  For example, the latest case involved a change involving the size of ads that were on the pages.  Rather than use publishing and database resources just to make this relatively simple change, I use the power of the shell.  Specifically, I use &lt;a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?find"&gt;&lt;code&gt;find&lt;/code&gt;&lt;/a&gt;, &lt;a href="http://www.grymoire.com/Unix/Sed.html"&gt;&lt;code&gt;sed&lt;/code&gt;&lt;/a&gt; and a shell script that I wrote.  It&amp;#8217;s based on a shell script in the &lt;a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;amp;location=http%3A%2F%2Fwww.amazon.com%2FPower-Tools-Third-Shelley-Powers%2Fdp%2F0596003307%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1191730398%26sr%3D8-1&amp;amp;tag=slackorama-20&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=9325"&gt;Unix Power Tools&lt;/a&gt; book.&lt;/p&gt;
&lt;p&gt;First off, we need to find all the files.  I usually accomplish this with something simple like&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="sh"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;find /www -type f -name &lt;span class="s2"&gt;&amp;quot;*.html&amp;quot;&lt;/span&gt; -print
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This simply finds that end with .html in the /www directory.  You can do more complex things with &lt;code&gt;find&lt;/code&gt; like find all files modified in the last 2 days by Frank if you needed to change files like that.&lt;/p&gt;
&lt;p&gt;The results of this will be passed off to a file named &lt;code&gt;replace.sh&lt;/code&gt; located in my &lt;code&gt;~/bin&lt;/code&gt; directory.  &lt;code&gt;Replace.sh&lt;/code&gt; is reproduced here:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="sh"&gt;&lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;
&lt;span class="nv"&gt;temp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/tmp/replace&lt;span class="nv"&gt;$$&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; -n &lt;span class="s2"&gt;&amp;quot;editing $1: &amp;quot;&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;$1&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; sedscr; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; -n &lt;span class="s2"&gt;&amp;quot;Not editing sedscript!&amp;quot;&lt;/span&gt;
&lt;span class="k"&gt;elif &lt;/span&gt;&lt;span class="nb"&gt;test&lt;/span&gt; -s &lt;span class="nv"&gt;$1&lt;/span&gt;; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;         &lt;/span&gt;sed -f sedscr &lt;span class="nv"&gt;$1&lt;/span&gt; &amp;gt; &lt;span class="nv"&gt;$temp&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="nb"&gt;test&lt;/span&gt; -s &lt;span class="s2"&gt;&amp;quot;$temp&amp;quot;&lt;/span&gt;; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;        if &lt;/span&gt;cmp -s &lt;span class="s2"&gt;&amp;quot;$1&amp;quot;&lt;/span&gt; &lt;span class="nv"&gt;$temp&lt;/span&gt;; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;            &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; -n &lt;span class="s2"&gt;&amp;quot;FILE NOT CHANGED: &amp;quot;&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;
            &lt;span class="c"&gt;# save original, just in case&lt;/span&gt;
            &lt;span class="c"&gt;# mv $1 $1.bak&lt;/span&gt;
            cp &lt;span class="nv"&gt;$temp&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;$1&amp;quot;&lt;/span&gt;
        &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="k"&gt;        &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; -n &lt;span class="s2"&gt;&amp;quot;done&amp;quot;&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
&lt;span class="k"&gt;        &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; -n &lt;span class="s2"&gt;&amp;quot;Sed produced an empty file \&lt;/span&gt;
&lt;span class="s2"&gt;- check your sedscript&amp;quot;&lt;/span&gt;.
    &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
&lt;span class="k"&gt;    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; -n &lt;span class="s2"&gt;&amp;quot;ORIGINAL FILE IS EMPTY&amp;quot;&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
rm -f &lt;span class="nv"&gt;$temp&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So, the command we would run would now look like this:&lt;/p&gt;
&lt;p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="sh"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;find /www -type f &lt;span class="se"&gt;\&lt;/span&gt;
      -name &lt;span class="s2"&gt;&amp;quot;*.html&amp;quot;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
      -exec ~/bin/replace.sh &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;This does the same as above but passes each file found by the &lt;code&gt;find&lt;/code&gt; command above  to the &lt;code&gt;~/bin/replace.sh&lt;/code&gt; script.&lt;/p&gt;
&lt;p&gt;You&amp;#8217;ll notice that the &lt;code&gt;replace.sh&lt;/code&gt; file calls &lt;code&gt;sed&lt;/code&gt; using a file named &lt;code&gt;sedscr.&lt;/code&gt;  The next step is creating the &lt;code&gt;sedscr&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;sedscr&lt;/code&gt; files simple contains &lt;code&gt;sed&lt;/code&gt; commands.  It must exist in the same directory that you call the &lt;code&gt;find&lt;/code&gt; command above from.  Here&amp;#8217;s a sample &lt;code&gt;sedscr&lt;/code&gt; that just does a simple replace.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="sh"&gt;s/BigHonkingAd/NiceSmallAd/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can enter in as many complex &lt;a href="http://main.rtfiber.com.tw/~changyj/sed/"&gt;&lt;code&gt;sed&lt;/code&gt; commands&lt;/a&gt; as you want.  It&amp;#8217;s &lt;code&gt;sed&lt;/code&gt; so the power is there!&lt;/p&gt;
&lt;p&gt;This simply replaces all instances of BigHonkingAd with NiceSmallAd in each of your  files found by the &lt;code&gt;find&lt;/code&gt; command.  The nice thing about the &lt;code&gt;replace.sh&lt;/code&gt; script is that it will not edit the file if the contents of your &lt;code&gt;sedscr&lt;/code&gt; don&amp;#8217;t produce an altered file.  Also, if you want the &lt;code&gt;replace.sh&lt;/code&gt; to make a backup of your original file, just uncomment the &lt;code&gt;mv&lt;/code&gt; line.&lt;/p&gt;
&lt;p&gt;Using this methodology, I&amp;#8217;m able to edit about 5000 files a minute.  It could probably be faster if I used &lt;a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?xargs"&gt;xargs&lt;/a&gt; and the output of &lt;code&gt;replace.sh&lt;/code&gt; is a little verbose but this solution has worked for me for years and if it ain&amp;#8217;t broke, why fix it?&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=XUm1dha4_Zw:NWOOQ2XnFag:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=XUm1dha4_Zw:NWOOQ2XnFag:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=XUm1dha4_Zw:NWOOQ2XnFag:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=XUm1dha4_Zw:NWOOQ2XnFag:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=XUm1dha4_Zw:NWOOQ2XnFag:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/XUm1dha4_Zw" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/10/06/editing-huge-amounts-of-files-easily.html</feedburner:origLink></entry>
 
 <entry>
   <title>Vim Tip: Select Column</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/ImQMQfqiRAQ/vim-tip-select-column.html" />
   <updated>2007-09-27T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/09/27/vim-tip-select-column</id>
   <content type="html">&lt;p&gt;&lt;img src="http://sethmason.com/images/11.png" align="left"/&gt; How many times have you wanted to replace a column of text with something.  With &lt;a href="http://vim.org"&gt;vim&lt;/a&gt; it&amp;#8217;s easy.  Just use &lt;code&gt;CTRL-V&lt;/code&gt; to select a column using a visual block.&lt;/p&gt;
&lt;p&gt;Once it&amp;#8217;s selected, you can do a search and replace, yank, cut and other actions.  For example, here&amp;#8217;s the keystrokes to change a column.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Put cursor and beginning of text to select&lt;/li&gt;
	&lt;li&gt;Press &lt;code&gt;CTRL-V&lt;/code&gt; to begin select of the column&lt;/li&gt;
	&lt;li&gt;When you reach the end of your select, type &amp;#8216;&lt;code&gt;c&lt;/code&gt;&amp;#8217;&lt;/li&gt;
	&lt;li&gt;Type the new text.  Note that this will only replace the first instance.&lt;/li&gt;
	&lt;li&gt;Now hit &lt;code&gt;&amp;lt;ESC&amp;gt;&amp;lt;ESC&amp;gt;&lt;/code&gt;.  All the text has been changed!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The same thing works with plain old &amp;#8216;&lt;code&gt;v&lt;/code&gt;&amp;#8217; (select character by character) and &lt;code&gt;SHIFT-V&lt;/code&gt; (select by line).&lt;/p&gt;
&lt;p&gt;Happy vimming!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ImQMQfqiRAQ:7iHRDxloT70:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ImQMQfqiRAQ:7iHRDxloT70:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ImQMQfqiRAQ:7iHRDxloT70:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=ImQMQfqiRAQ:7iHRDxloT70:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ImQMQfqiRAQ:7iHRDxloT70:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/ImQMQfqiRAQ" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/09/27/vim-tip-select-column.html</feedburner:origLink></entry>
 
 <entry>
   <title>Just Cuz'</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/MLPAIfNm7pE/just-cuz.html" />
   <updated>2007-09-20T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/09/20/just-cuz</id>
   <content type="html">&lt;p&gt;OK, I&amp;#8217;ve decided that the next programming langauge I learn is Lisp.  I just love all the parenthesis I guess.  An excellent &lt;a href="http://www.gigamonkeys.com/book/"&gt;Lisp tutorial&lt;/a&gt; is Peter Siebel&amp;#8217;s  book &lt;a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;amp;location=http%3A%2F%2Fwww.amazon.com%2FPractical-Common-Lisp-Peter-Seibel%2Fdp%2F1590592395%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1190332229%26sr%3D8-1&amp;amp;tag=slackorama-20&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=9325"&gt;Practical Common Lisp&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Fun stuff.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=MLPAIfNm7pE:0EV33FpFssQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=MLPAIfNm7pE:0EV33FpFssQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=MLPAIfNm7pE:0EV33FpFssQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=MLPAIfNm7pE:0EV33FpFssQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=MLPAIfNm7pE:0EV33FpFssQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/MLPAIfNm7pE" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/09/20/just-cuz.html</feedburner:origLink></entry>
 
 <entry>
   <title>Command Line Fun</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/WCfuWDYbeuA/command-line-fun.html" />
   <updated>2007-07-15T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/07/15/command-line-fun</id>
   <content type="html">&lt;p&gt;If you use the command line in bash, you should check out the &lt;span class="caps"&gt;CDPATH&lt;/span&gt; environment variable.  It&amp;#8217;ll make your life tons easier.&lt;/p&gt;
&lt;p&gt;From the &lt;a href="http://www.linuxcommand.org/man_pages/bash1.html"&gt;bash man pages&lt;/a&gt;, &lt;span class="caps"&gt;CDPATH&lt;/span&gt; is defined as:&lt;/p&gt;
&lt;blockquote&gt;The search path for the cd command.  This is a colon-separated list  of directories in which the shell looks for destination directories specified by the cd command.  A sample value is &amp;#8220;.:~:/usr&amp;#8221;.&lt;/blockquote&gt;
&lt;p&gt;In my .bashrc, I&amp;#8217;ve got the following defined:&lt;br /&gt;
&lt;code&gt;
CDPATH='.:..:../..:~/projects'
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This allows me to just type &lt;code&gt;cd app&lt;/code&gt; when I want to go to &lt;code&gt;~/projects/app&lt;/code&gt;.  Another great part of it is that if I am in &lt;code&gt;/var/log&lt;/code&gt; and want to go to &lt;code&gt;/var/www&lt;/code&gt; I only need to type &lt;code&gt;cd www&lt;/code&gt;.  The &lt;code&gt;..&lt;/code&gt; in the &lt;span class="caps"&gt;CDPATH&lt;/span&gt; takes care of finding it.&lt;/p&gt;
&lt;p&gt;The important part of it is the first one.  The single period allows for &lt;code&gt;cd&lt;/code&gt; to work normally and find directories in your current directory.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=WCfuWDYbeuA:bx_fbfknq7Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=WCfuWDYbeuA:bx_fbfknq7Q:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=WCfuWDYbeuA:bx_fbfknq7Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=WCfuWDYbeuA:bx_fbfknq7Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=WCfuWDYbeuA:bx_fbfknq7Q:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/WCfuWDYbeuA" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/07/15/command-line-fun.html</feedburner:origLink></entry>
 
 <entry>
   <title>Ten Keyboard Shortcuts for IntelliJ IDEA</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/r8fmZA1ZmBw/ten-keyboard-shortcuts-for-intellij-idea.html" />
   <updated>2007-06-29T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/06/29/ten-keyboard-shortcuts-for-intellij-idea</id>
   <content type="html">&lt;center&gt;&lt;img src="http://sethmason.com/images/10.png" height="157" width="400" /&gt;&lt;/center&gt;
&lt;p&gt;&lt;br /&gt;
For my &lt;a href="http://www.ign.com" title="IGN"&gt;day job&lt;/a&gt; I use Java quite a bit.  And to edit I use &lt;a href="http://www.jetbrains.com/idea/" title="The Most Intelligent Java IDE"&gt;IntelliJ &lt;span class="caps"&gt;IDEA&lt;/span&gt;&lt;/a&gt;.   I used to use &lt;a href="http://eclipse.org"&gt;Eclipse&lt;/a&gt; but work paid for an IntelliJ &lt;span class="caps"&gt;IDEA&lt;/span&gt; license and I&amp;#8217;ve become hooked.  The refactorings and clean interface are a boon to my productivity.&lt;/p&gt;
&lt;p&gt;Well this post isn&amp;#8217;t an IntelliJ &lt;span class="caps"&gt;IDEA&lt;/span&gt; fanboy post so let&amp;#8217;s get back on track.  Here&amp;#8217;s a list of shortcuts that I find most helpful for use with IntelliJ &lt;span class="caps"&gt;IDEA&lt;/span&gt;.  Note that these aren&amp;#8217;t the obvious ones (like &lt;strong&gt;Alt-Space&lt;/strong&gt; for code completion).  These are some hidden ones that you might not know about it.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;strong&gt;Ctrl-/&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;Comment out the selected lines with //. &lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Ctrl-D&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;Copy the current line and paste it.&lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Ctrl-Y&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;Delete the current line.&lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Ctrl-&lt;span class="caps"&gt;BACKSPACE&lt;/span&gt;&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;Delete to word end from cursor.&lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Ctrl-&lt;span class="caps"&gt;DEL&lt;/span&gt;&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;Delete to word start from cursor.&lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Ctrl-W&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;Select the current word.  Press it again and it selects more of the code block.&lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Shift+F10&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;Run the configuration&lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Shift+F9&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;Debug the configuration&lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Alt+F7&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;Find usages of the current word&lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Ctrl-J&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;Bring up the &lt;a href="http://www.jetbrains.com/idea/docs/help/editing/livetemplates/definetemplates.html"&gt;Live Template&lt;/a&gt; context menu.  If you don&amp;#8217;t know about Live Templates, you can save major keystrokes by defining them.&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;For a complete list of keyboard shortcuts for IntelliJ &lt;span class="caps"&gt;IDEA&lt;/span&gt;, there&amp;#8217;s a &lt;a href="http://www.jetbrains.com/idea/docs/IntelliJIDEA8_ReferenceCard.pdf" title="PDF of IntelliJ IDEA keyboard shortcuts"&gt;&lt;span class="caps"&gt;PDF&lt;/span&gt;&lt;/a&gt; issued by JetBrains floating around.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=r8fmZA1ZmBw:Lix4OJpXjXw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=r8fmZA1ZmBw:Lix4OJpXjXw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=r8fmZA1ZmBw:Lix4OJpXjXw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=r8fmZA1ZmBw:Lix4OJpXjXw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=r8fmZA1ZmBw:Lix4OJpXjXw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/r8fmZA1ZmBw" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/06/29/ten-keyboard-shortcuts-for-intellij-idea.html</feedburner:origLink></entry>
 
 <entry>
   <title>Linux Cut and Paste</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/BJr6va-o-rk/linux-cut-and-paste.html" />
   <updated>2007-06-20T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/06/20/linux-cut-and-paste</id>
   <content type="html">&lt;p&gt;&lt;img src="http://sethmason.com/images/9.png" width="182" height="78"
class="noline" alt="Linux logo" align="left"/&gt;&lt;br /&gt;
Since I&amp;#8217;m in the process of switching to &lt;a href="www.ubuntu.com/"&gt;Ubuntu&lt;/a&gt; I&amp;#8217;ve been hunting down tips and tricks.  One great resource is the &lt;a href="http://ubuntu.wordpress.com"&gt;Ubuntu Blog&lt;/a&gt;.  Today they had a &lt;a href="http://ubuntu.wordpress.com/2006/12/12/cut-copy-paste-clipboard-management/"&gt;great tip for copying and pasting in &lt;span class="caps"&gt;GNOME&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Basically, what you do is highlight the text in one application (for example Firefox), switch to another application and then click the middle mouse button where you want the text to show up.  Your highlighted text is now exactly where you want it.  If you don&amp;#8217;t feel like using the mouse, you can use Shift+Insert in the second application to paste the text.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=BJr6va-o-rk:DAKdUgtzn_Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=BJr6va-o-rk:DAKdUgtzn_Q:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=BJr6va-o-rk:DAKdUgtzn_Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=BJr6va-o-rk:DAKdUgtzn_Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=BJr6va-o-rk:DAKdUgtzn_Q:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/BJr6va-o-rk" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/06/20/linux-cut-and-paste.html</feedburner:origLink></entry>
 
 <entry>
   <title>Cygwin And SSH Tip</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/Kg2FwbF6DLQ/cygwin-and-ssh-tip.html" />
   <updated>2007-06-13T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/06/13/cygwin-and-ssh-tip</id>
   <content type="html">&lt;p&gt;&lt;img src="http://sethmason.com/images/8.png" height="111" width="480" /&gt;&lt;/p&gt;
&lt;p&gt;Auto completion for &lt;code&gt;ssh&lt;/code&gt; under cygwin was driving me nuts.  It wasn&amp;#8217;t parsing the &lt;code&gt;~/.ssh/known_hosts&lt;/code&gt; file like it should have and using those values to auto-complete.  Investigating, (by using &lt;code&gt;ssh -v&lt;/code&gt;) I found out that my &lt;code&gt;known_hosts&lt;/code&gt; didn&amp;#8217;t exist in &lt;code&gt;${HOME}/.ssh&lt;/code&gt; and &lt;code&gt;ssh&lt;/code&gt; was using the one in &lt;code&gt;C:/Documents and Settings/smason/.ssh&lt;/code&gt;.  Uh, &lt;em&gt;excuse me&lt;/em&gt;?  My &lt;code&gt;$HOME&lt;/code&gt; is &lt;code&gt;/home/smason&lt;/code&gt;.  I &lt;code&gt;cd ~&lt;/code&gt; and I&amp;#8217;m in &lt;code&gt;/home/smason&lt;/code&gt;.  Bafflement ensued.&lt;/p&gt;
&lt;p&gt;Turns out my &lt;code&gt;/etc/passwd&lt;/code&gt; was all mucked up.  It had my &lt;code&gt;HOME&lt;/code&gt; directory set to the one in my &lt;code&gt;Documents and Settings&lt;/code&gt; directory.  I manually edited my &lt;code&gt;/etc/passwd&lt;/code&gt; and now &lt;code&gt;ssh&lt;/code&gt; auto completion works.&lt;/p&gt;
&lt;p&gt;Wow, the &lt;a href="http://sethmason.com/blog/17/bashrc-fun-with-subversion" title=".bashrc Fun With Subversion"&gt;second post&lt;/a&gt;  in a row dealing with auto completion.  I guess I &lt;strong&gt;really&lt;/strong&gt; like auto-completion.  Think of the keystrokes I&amp;#8217;m saving you!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=Kg2FwbF6DLQ:Ds1EZWLm_EA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=Kg2FwbF6DLQ:Ds1EZWLm_EA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=Kg2FwbF6DLQ:Ds1EZWLm_EA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=Kg2FwbF6DLQ:Ds1EZWLm_EA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=Kg2FwbF6DLQ:Ds1EZWLm_EA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/Kg2FwbF6DLQ" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/06/13/cygwin-and-ssh-tip.html</feedburner:origLink></entry>
 
 <entry>
   <title>.bashrc Fun With Subversion</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/qEVMAtdBrR0/bashrc-fun-with-subversion.html" />
   <updated>2007-06-12T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/06/12/bashrc-fun-with-subversion</id>
   <content type="html">&lt;p&gt;Do you use Subversion a lot from the command line in bash?  Then this tip is for you.&lt;/p&gt;
&lt;p&gt;Add the following to your .bashrc&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="sh"&gt;&lt;span class="c"&gt;# svn completion&lt;/span&gt;
_svn &lt;span class="o"&gt;()&lt;/span&gt;
&lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;local &lt;/span&gt;cur prev
    &lt;span class="nv"&gt;COMPREPLY&lt;/span&gt;&lt;span class="o"&gt;=()&lt;/span&gt;
    &lt;span class="nv"&gt;cur&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;COMP_WORDS&lt;/span&gt;&lt;span class="p"&gt;[COMP_CWORD]&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
    &lt;span class="nv"&gt;prev&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;COMP_WORDS&lt;/span&gt;&lt;span class="p"&gt;[COMP_CWORD-1]&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$COMP_CWORD&lt;/span&gt; -eq 1 &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;${prev:0:1}&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;COMPREPLY&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt; &lt;span class="k"&gt;$(&lt;/span&gt; &lt;span class="nb"&gt;compgen&lt;/span&gt; -W &lt;span class="s1"&gt;&amp;#39;add blame cat checkout cleanup commit copy \&lt;/span&gt;
&lt;span class="s1"&gt;        delete diff export help import info list lock log merge mkdir move \&lt;/span&gt;
&lt;span class="s1"&gt;        propdel propedit propget proplist propset resolved revert status \&lt;/span&gt;
&lt;span class="s1"&gt;        switch unlock update&amp;#39;&lt;/span&gt; &lt;span class="nv"&gt;$cur&lt;/span&gt; &lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
&lt;span class="k"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;COMPREPLY&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt; &lt;span class="k"&gt;$(&lt;/span&gt; &lt;span class="nb"&gt;compgen&lt;/span&gt; -f &lt;span class="nv"&gt;$cur&lt;/span&gt; &lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="k"&gt;    return &lt;/span&gt;0
&lt;span class="o"&gt;}&lt;/span&gt;
ccomplete -F _svn -o default -X &lt;span class="s1"&gt;&amp;#39;@(*/.svn|.svn)&amp;#39;&lt;/span&gt; svn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Save your .bashrc, source it (using &lt;code&gt;source .bashrc&lt;/code&gt;) and now Subversion commands will complete.  For example, enter &lt;code&gt;svn upd&lt;/code&gt; press the Tab key and you&amp;#8217;ll get &lt;code&gt;svn update&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Think of all the keystrokes you&amp;#8217;ll be saving.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I just found Subversion&amp;#8217;s own &lt;a href="http://svn.collab.net/repos/svn/trunk/tools/client-side/bash_completion"&gt;bash completion script&lt;/a&gt;  which has a ton more options.  Mine is easier to maintain. :)&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=qEVMAtdBrR0:hd7aUOE_wMc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=qEVMAtdBrR0:hd7aUOE_wMc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=qEVMAtdBrR0:hd7aUOE_wMc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=qEVMAtdBrR0:hd7aUOE_wMc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=qEVMAtdBrR0:hd7aUOE_wMc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/qEVMAtdBrR0" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/06/12/bashrc-fun-with-subversion.html</feedburner:origLink></entry>
 
 <entry>
   <title>Got Ugly SQL?  </title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/S9wU_msQzsU/got-ugly-sql.html" />
   <updated>2007-06-09T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/06/09/got-ugly-sql</id>
   <content type="html">&lt;p&gt;&lt;img src="http://sethmason.com/images/6.png" alt="SQL Formatter screen shot" width="479" height="200" /&gt;&lt;/p&gt;
&lt;p&gt;Sometimes you have a bunch of &lt;span class="caps"&gt;SQL&lt;/span&gt; statements that are very long, very verbose and very unreadable.  Would you spend minutes of your time to format the &lt;span class="caps"&gt;SQL&lt;/span&gt; in strings so that it&amp;#8217;s readable?  Would you paste the ugly &lt;span class="caps"&gt;SQL&lt;/span&gt; in your source code letting some future maintainer try and decipher it?  Well, I&amp;#8217;m about to save you a metric ton of time as well as your reputation with maintainers of your code.  Use &lt;a href="http://www.sqlinform.com/" title="SQL Formatter formats SQL statements"&gt;&lt;span class="caps"&gt;SQL&lt;/span&gt; Formatter&lt;/a&gt; and it&amp;#8217;ll do all the grunt work for you.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s bloody easy to use.  Just Accept the usage agreement, paste in your offending &lt;span class="caps"&gt;SQL&lt;/span&gt; statement and choose the formatting and output you want.  Bingo!  Nicely formatted &lt;span class="caps"&gt;SQL&lt;/span&gt;.  You can even choose to format it as a string in the language of your choice so you can just copy and paste it into your source.&lt;/p&gt;
&lt;p&gt;If you don&amp;#8217;t feel comfortable using an online tool, there&amp;#8217;s a desktop version that&amp;#8217;s &lt;a href="http://en.wikipedia.org/wiki/Postcardware" title="Definition of postcardware on wikipedia"&gt;postcardware&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.sqlinform.com/" title="SQL Formatter"&gt;Give it a whirl!&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=S9wU_msQzsU:dn9jZFw_3xM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=S9wU_msQzsU:dn9jZFw_3xM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=S9wU_msQzsU:dn9jZFw_3xM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=S9wU_msQzsU:dn9jZFw_3xM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=S9wU_msQzsU:dn9jZFw_3xM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/S9wU_msQzsU" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/06/09/got-ugly-sql.html</feedburner:origLink></entry>
 
 <entry>
   <title>Keeping It Real Safe And Real Easy</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/XCjt7joO3L8/keeping-it-real-safe-and-real-easy.html" />
   <updated>2007-06-02T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/06/02/keeping-it-real-safe-and-real-easy</id>
   <content type="html">&lt;p&gt;&lt;img src="http://sethmason.com/images/7.png" width="468" height="64" alt="Subversion logo" /&gt;&lt;/p&gt;
&lt;p&gt;OK, I&amp;#8217;ve fallen in love with putting my home directory in &lt;a href="http://subversion.tigris.org/" title="A version control system to rival CVS"&gt;Subversion&lt;/a&gt;.   The benefits are enormous.  They include (but are not limited to):&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;ease of setting up environment on new system&lt;/li&gt;
	&lt;li&gt;backup&lt;/li&gt;
	&lt;li&gt;ability to go &amp;#8220;back in time&amp;#8221; using Subversion &lt;a href="http://svnbook.red-bean.com/nightly/en/svn.branchmerge.tags.html" title="Tags rule"&gt;tags&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Mind you I don&amp;#8217;t put everything in there, just the important stuff like my shell configuration files and my &lt;a href="http://www.vim.org" title="The one true editor"&gt;vim&lt;/a&gt; configuration files.  Other important files  (like pictures and music I spent ages ripping) are backed up in other  ways.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s what I currently have saved in svn:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;svn ls http://my.svn.server/svn/home-dir/trunk/
.Xdefaults
.antrc
.bash_profile
.bashrc
.dircolors
.inputrc
.irbrc
bin/
vim_local/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So now when I&amp;#8217;m on a system, I&amp;#8217;ll have the same look and feel and same functionality as the utilities I use will be available in my &lt;code&gt;~/bin&lt;/code&gt; directory.&lt;/p&gt;
&lt;p&gt;For those astute readers, you&amp;#8217;ll notice that I don&amp;#8217;t have a  .vimrc file in there.  That&amp;#8217;s because I&amp;#8217;m using an excellent tip from Amir Salihefendic&lt;br /&gt;
about &lt;a href="http://amix.dk/blog/viewEntry/162"&gt;taming your vim config&lt;/a&gt;.  Basically on each system I have a specialized but simple .vimrc that sources the vim_local for what it needs.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve found this setup works great on the many different systems I use throughout a given week (e.g. Windows, Mac and Linux).  And I&amp;#8217;m safe in the knowledge that my configuration files won&amp;#8217;t disappear should my machines suddenly implode.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=XCjt7joO3L8:3crtVF14ewQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=XCjt7joO3L8:3crtVF14ewQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=XCjt7joO3L8:3crtVF14ewQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=XCjt7joO3L8:3crtVF14ewQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=XCjt7joO3L8:3crtVF14ewQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/XCjt7joO3L8" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/06/02/keeping-it-real-safe-and-real-easy.html</feedburner:origLink></entry>
 
 <entry>
   <title>Debugging Is Sexy Good Times</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/vOiWSx73l4M/debugging-is-sexy-good-times.html" />
   <updated>2007-05-24T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/05/24/debugging-is-sexy-good-times</id>
   <content type="html">&lt;p&gt;I love me some &lt;a href="http://json.org" title="JavaScript Object Notation"&gt;&lt;span class="caps"&gt;JSON&lt;/span&gt;&lt;/a&gt;.  The problem with it is that it&amp;#8217;s not too human readable when you need to see what it&amp;#8217;s returning.  Sure you could litter your code with alerts or console.debug (if you are using &lt;a href="http://www.getfirebug.com" title="Awesome JavaScript debugger"&gt;Firebug&lt;/a&gt; and &lt;a href="http://www.getfirefox.com" title="Awesome web browser"&gt;Firefox&lt;/a&gt; to figure out what values are you getting back.&lt;/p&gt;
&lt;p&gt;But if you&amp;#8217;ve got the Firefox/Firebug setup (and why don&amp;#8217;t you if you don&amp;#8217;t?) then you can just use  the Firebug console to display the &lt;span class="caps"&gt;JSON&lt;/span&gt; data. Say for instance you have the following data returned from your service (but imagine it&amp;#8217;s a bazillion lines long):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="javascript"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;SomeObject&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Attrib1&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;foo&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
               &lt;span class="s2"&gt;&amp;quot;Attrib2&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;bar&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
               &lt;span class="s2"&gt;&amp;quot;SubObject&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;SubAttrib1&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;bar&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
              &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Just wrap that in an &lt;code&gt;eval&lt;/code&gt; function, plug it into the console and you get back a nice little tree of your data in the &lt;span class="caps"&gt;DOM&lt;/span&gt; view.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://sethmason.com/images/5.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Now isn&amp;#8217;t that sexy?&lt;/p&gt;

&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=vOiWSx73l4M:7lKt7rOf2Co:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=vOiWSx73l4M:7lKt7rOf2Co:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=vOiWSx73l4M:7lKt7rOf2Co:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=vOiWSx73l4M:7lKt7rOf2Co:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=vOiWSx73l4M:7lKt7rOf2Co:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/vOiWSx73l4M" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/05/24/debugging-is-sexy-good-times.html</feedburner:origLink></entry>
 
 <entry>
   <title>Writing Tests For Fun And Profit</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/ao87kU7ZLWg/writing-tests-to-expand-your-brain.html" />
   <updated>2007-05-22T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/05/22/writing-tests-to-expand-your-brain</id>
   <content type="html">&lt;p&gt;Learning a new programming language historically starts off with the classic &amp;#8220;Hello World&amp;#8221; example.  I&amp;#8217;ve probably written a  variation on that a bazillion times.  From there you take more steps into advanced parts of the language.  If you are smart, you save your example programs to refer back to them later. But there&amp;#8217;s a better way. And that better way is to write test cases that exercise the capabilities of the language you are trying to learn.  This also works for new libraries within a language you are trying to learn.&lt;/p&gt;
&lt;p&gt;The advantages of writing test cases are plentiful. It gets you writing actual code which helps you remember, they can be usually be run easily, they serve as an extra source of documentation about what you are trying to do  (e.g. &amp;#8220;How do I use &lt;code&gt;gsub&lt;/code&gt; again? Oh yeah, it&amp;#8217;s in that string  test I wrote?&amp;#8221;) and finally writing tests is fun.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;An Example&lt;/strong&gt;&lt;br /&gt;
After ignoring it for way too long, I recently started trying out the &lt;a href="http://developer.yahoo.com/yui" title="Yahoo! User Interface Library"&gt;Yahoo! User Interface Library&lt;/a&gt;.  It&amp;#8217;s a JavaScript library with scads of useful utilities for buidling web applications.  So, I pulled up the documentation and started writing a tests based on what&amp;#8217;s documented.  Since it&amp;#8217;s JavaScript, I used &lt;a href="http://jsunit.net" title="JsUnit is a Unit Testing framework"&gt;JsUnit&lt;/a&gt; since I&amp;#8217;m used to &lt;a href="http://www.junit.com" title="JUnit -- Java Unit Test framework"&gt;JUnit&lt;/a&gt; on the Java side of things.  And &lt;em&gt;voila&lt;/em&gt; we have our first test:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Test Yahoo&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; 
        &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;jsUnitCore.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; 
        &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;yahoo.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="c"&gt;&amp;lt;!--&lt;/span&gt;
        &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;testIsArray&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;assertTrue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;YAHOO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isArray&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]));&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="c1"&gt;//--&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    A test document.
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;(I know it&amp;#8217;s very simple but I just wanted to get a feel for the first method in the global library and type it so my brain remembered it.)&lt;/p&gt;
&lt;p&gt;So, now I drop the test file into my test runner and here we have the results:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://sethmason.com/images/4.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Can&amp;#8217;t you just feel your brain expanding with the possibilities?&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ao87kU7ZLWg:wBndFBPAxtM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ao87kU7ZLWg:wBndFBPAxtM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ao87kU7ZLWg:wBndFBPAxtM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=ao87kU7ZLWg:wBndFBPAxtM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=ao87kU7ZLWg:wBndFBPAxtM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/ao87kU7ZLWg" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/05/22/writing-tests-to-expand-your-brain.html</feedburner:origLink></entry>
 
 <entry>
   <title>Welcome</title>
   <link href="http://feedproxy.google.com/~r/sethmason/~3/uURhz80jobY/welcome-to-sethmasoncom.html" />
   <updated>2007-05-22T00:00:00-07:00</updated>
   <id>http://sethmason.com/2007/05/22/welcome-to-sethmasoncom</id>
   <content type="html">&lt;p&gt;Hello and welcome to sethmason.com.   This site is basically an experiment to set up a site that&amp;#8217;s a resume of sorts.  It will feature articles about technology that reflect my depth of knowledge.&lt;/p&gt;
&lt;p&gt;The site itself is set up using &lt;a href="http://textpattern.com" title="TextPattern - easy-to-use content management system for all kinds of websites"&gt;TextPattern&lt;/a&gt;.  Normally, I would &lt;a href="http://en.wikipedia.org/wiki/Eat_one&amp;#39;s_own_dog_food" title="wikipedia definition for eat your own dogfood"&gt;eat my own dog food&lt;/a&gt; and use a Java based content management system but I wanted to give &lt;span class="caps"&gt;PHP&lt;/span&gt; and Textile a test.  So far, I&amp;#8217;m impressed.&lt;/p&gt;
&lt;p&gt;For more information about myself, check out my &lt;a href="/about" title="about -- all about Seth Mason"&gt;about page&lt;/a&gt;.  And feel free to leave a comment.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=uURhz80jobY:UqWK9r-K6Mg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=uURhz80jobY:UqWK9r-K6Mg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=uURhz80jobY:UqWK9r-K6Mg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?i=uURhz80jobY:UqWK9r-K6Mg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/sethmason?a=uURhz80jobY:UqWK9r-K6Mg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/sethmason?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sethmason/~4/uURhz80jobY" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://sethmason.com/2007/05/22/welcome-to-sethmasoncom.html</feedburner:origLink></entry>
 
 
</feed>
