<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Alex Rasmussen</title>
	
	<link>http://alexras.info</link>
	<description>Yelling about computers to an empty room since 1999</description>
	<lastBuildDate>Sun, 13 May 2012 06:01:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/alexras" /><feedburner:info uri="alexras" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>paper-pile: Simple Command-Line Paper Management</title>
		<link>http://feedproxy.google.com/~r/alexras/~3/iEDnSNacOtg/</link>
		<comments>http://alexras.info/2012/05/12/paper-pile-simple-command-line-paper-management/#comments</comments>
		<pubDate>Sun, 13 May 2012 06:01:08 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Useful Software]]></category>

		<guid isPermaLink="false">http://alexras.info/?p=1148</guid>
		<description><![CDATA[I&#8217;ve struggled with research paper management for years. I gushed at length about Mendeley last year, but lately I&#8217;ve been having some of the same problems with Mendeley that I had with Evernote. Its metadata lookup functionality, while convenient when it works, doesn&#8217;t seem to work that often for me anymore; this might be because [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve struggled with research paper management for years. I <a href="http://alexras.info/2011/04/17/software-i-use-daily-mendeley/">gushed at length about Mendeley</a> last year, but lately I&#8217;ve been having some of the same problems with Mendeley that I had with Evernote.</p>
<p>Its metadata lookup functionality, while convenient when it works, doesn&#8217;t seem to work that often for me anymore; this might be because I&#8217;m looking up newer papers or papers in an area that they don&#8217;t have a lot of metadata coverage for, who knows. Mendeley&#8217;s note-taking feature leaves a lot to be desired; you essentially have a Notepad window that you&#8217;re writing text down in. Too much formatting is distracting, I&#8217;ll admit, but I&#8217;d like to be able to at least bold and italicize things every once in a while. I also ran into the ceiling of Mendeley&#8217;s free space and had to start paying for extra storage (if you&#8217;ve read my <a href="http://alexras.info/2011/11/28/markupserve-a-diy-evernote-alternative/">markupserve</a> post this is probably sounding familiar), which is irksome considering that I&#8217;ve got so much free Dropbox space available. Exporting BibTeX entries for individual papers in Mendeley is a lot more tedious than I think it should be. The social features of Mendeley would be interesting if any of my friends actually used them, but they don&#8217;t, so I don&#8217;t.</p>
<p>So last month, I sat down and figured out what I wanted &#8211; what I <em>really</em> wanted &#8211; out of a paper management system based on what I&#8217;d done with papers for the past five years. The list basically came out like this:</p>
<ol>
<li>I want to be able to take notes on a paper, both outside and inside of the PDF. It would be nice if I could do things like add images, formatting and links to notes occasionally.</li>
<li>I want to be able to generate a BibTeX for a single paper or groups of papers quickly.</li>
<li>I want to synchronize everything across computers without having to think about it.</li>
</ol>
<p>Everything else, I felt, was a secondary concern.</p>
<p>Taking notes inside a PDF was taken care of &#8211; the PDF standard has supported inline annotations like highlights and comments for a long time. Taking rich notes outside a PDF is also not that hard &#8211; I could do what I&#8217;ve been doing with markupserve (<a href="http://daringfireball.net/projects/markdown/">Markdown</a>, <a href="https://github.com/tanoku/redcarpet">redcarpet</a> and emacs). Generating BibTeX without dealing with BibTeX&#8217;s quirkiness required a metadata format that would be easy to convert into BibTeX. Thankfully, <a href="http://yaml.org/">YAML</a>&#8216;s a pretty painless way to store information like this. As long as this whole thing stays on the file system, I could keep it synchronized with Dropbox. I figured that search wasn&#8217;t that big of a deal; as long as the PDFs were searchable and everything else was plaintext, I could just search with Finder.</p>
<p>The only thing I had left to write was the thing that kept PDF, notes and metadata in one place and allowed me to manipulate them and generate BibTeX. I wrote <a href="https://github.com/alexras/paper-pile">paper-pile</a> to do this. Once paper-pile was relatively stable, I wrote a quick-and-dirty Python script that loaded my Mendeley library into paper-pile by parsing Mendeley&#8217;s BibTeX dump. After paper-pile&#8217;s basic functionality was done, I wrote a simple web server that would display formatted notes using the same libraries I used for markupserve. From start to finish, I figure it took me a couple weeknights to get it all the way I wanted it; most of the complexity was getting Mendeley&#8217;s library to import properly.</p>
<p>It&#8217;s not perfect &#8211; for example, I&#8217;m pretty sure all hell is going to break loose when I generate BibTeX for a paper whose author&#8217;s name has an accented character &#8211; but it gets the job done. When I encounter a bug or a feature that I suddenly wish paper-pile had, I just add it in. If I want to get BibTeX for a bunch of papers at once, I just list the papers&#8217; paper-pile keys and pipe the list through <code>xargs</code>. No impedance mismatches, no GUIs getting in the way, and I&#8217;m in no danger of running out of room for papers on Dropbox.</p>
<p>If this sounds like something you&#8217;d want to use yourself, <a href="https://github.com/alexras/paper-pile">paper-pile is available on GitHub</a>. I make no guarantees as to its performance or correctness (and you probably shouldn&#8217;t make the web UI world-visible), but I use it myself every day, and that has to count for something.</p>
<img src="http://feeds.feedburner.com/~r/alexras/~4/iEDnSNacOtg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://alexras.info/2012/05/12/paper-pile-simple-command-line-paper-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://alexras.info/2012/05/12/paper-pile-simple-command-line-paper-management/</feedburner:origLink></item>
		<item>
		<title>Esoteric Tip #7: SSH Agent Forwarding and Screen Sessions</title>
		<link>http://feedproxy.google.com/~r/alexras/~3/sL6Srf8ozY8/</link>
		<comments>http://alexras.info/2012/03/03/esoteric-tip-7-ssh-agent-forwarding-and-screen-sessions/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 21:41:35 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Esoteric Tips]]></category>

		<guid isPermaLink="false">http://alexras.info/?p=1136</guid>
		<description><![CDATA[I used to have distinct, passwordless SSH key pairs on every machine I used. Once this was in place, I could access any machine from any other without entering a password. Turns out that this wasn&#8217;t a good idea; someone got access to one of my publicly-routable machines, grabbed one of my key pairs, and [...]]]></description>
			<content:encoded><![CDATA[<p>I used to have distinct, passwordless SSH key pairs on every machine I used. Once this was in place, I could access any machine from any other without entering a password. Turns out that this wasn&#8217;t a good idea; someone <a href="http://alexras.info/2011/10/16/secure-your-ssh-keys/">got access to one of my publicly-routable machines</a>, grabbed one of my key pairs, and suddenly had the keys to the kingdom. My immediate reaction was to purge all key pairs and set up new, stronger ones that were protected by passwords, using <code>ssh-agent</code> to limit the number of times I&#8217;d have to enter a password to authenticate.</p>
<p><code>ssh-agent</code> by itself is a pretty good solution, but agent forwarding is what makes it truly effective. In a nutshell, SSH agent forwarding routes any authentication requests back to your <code>ssh-agent</code> instance, rather than handling them on the machine itself. I won&#8217;t retread an explanation of how agent forwarding works, since <a href="http://unixwiz.net/techtips/ssh-agent-forwarding.html#agent">unixwiz.net has already provided a great explanation</a>. Agent forwarding is particularly useful because it limits the number of key pairs you have to create; you can essentially use a single key pair for every machine that you&#8217;ve authorized (and that has agent forwarding enabled in <code>sshd</code>).</p>
<p>Unfortunately, SSH agent forwarding breaks when you introduce shells that persist after you log out, like those generated by <code>screen</code> and <code>tmux</code>. The problem is that certain environment variables set in the shell the first time you logged in with agent forwarding enabled will be stale when you log in a second time. Luckily, <a href="http://www.deadman.org/sshscreen.php">Sam Rowe has already figured out a solution to this problem</a>.</p>
<p>While Mr. Rowe&#8217;s <code>grabssh</code>/<code>fixssh</code> approach works just fine, I didn&#8217;t want to have to bother typing those commands in (or, more likely, forgetting to type them in) to keep my agent state up-to-date. Luckily, it&#8217;s not that hard to automate the process with a bash script. I&#8217;ve only automated this for <code>tmux</code> at this point, since it&#8217;s what I use pretty much all the time these days. <code>tmux</code> exports the <code>TMUX</code> environment variable to all its child shells; this gives me a convenient way to detect if I&#8217;m in a <code>tmux</code> shell or not. The script runs <code>grabssh</code> if I&#8217;m not in a <code>tmux</code> shell, and <code>fixssh</code> if I am. You can <a href="https://github.com/alexras/dotfiles/blob/03280b015ea170c65238c5847ecf6f233d341e8d/bin/updatessh">view the script on Github</a> if you&#8217;re curious.</p>
<p>Keeping the shells themselves up-to-date is fairly straightforward as well; I simply set Bash&#8217;s <code>PROMPT_COMMAND</code> environment variable to <code>source /path/to/script</code>, so it updates the environment state appropriately every time I execute a command. That might sound like a lot of overhead, but I have yet to notice it.</p>
<p><strong>Update</strong>: I&#8217;ve found a solution for <code>tmux</code> that I think is a little more robust, especially in the case of SSH connections within <code>tmux</code> sessions (which my previous solution didn&#8217;t handle properly). In a nutshell, it relies on tmux&#8217;s environment variable forwarding functionality. To enable it, you can add</p>
<p><code>set-option -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"</code></p>
<p>to your <code>.tmux.conf</code> file; this will export the appropriate values to the session&#8217;s environment whenever it&#8217;s reattached. Since <code>tmux</code>&#8216;s environment variable precedence rules seem to be a little weird, I had to modify my <code>updatessh</code> script to grab the appropriate SSH variables from <code>tmux show-environment</code> and export them manually. The modified script is <a href="https://github.com/alexras/dotfiles/blob/e5b0797b41a864fbc7ff6325302b68b799017fe5/bin/updatessh">also on GitHub</a>.</p>
<p>Keep in mind that a malicious root user on remote machines can gain access to your SSH agent if they know what they&#8217;re doing, so you&#8217;re taking a risk. You can always disable SSH agent forwarding by adding</p>
<p><code>ForwardAgent no</code></p>
<p>to your <code>~/.ssh/config</code> file.</p>
<img src="http://feeds.feedburner.com/~r/alexras/~4/sL6Srf8ozY8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://alexras.info/2012/03/03/esoteric-tip-7-ssh-agent-forwarding-and-screen-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://alexras.info/2012/03/03/esoteric-tip-7-ssh-agent-forwarding-and-screen-sessions/</feedburner:origLink></item>
		<item>
		<title>Algorithms (for Hanging) with Friends</title>
		<link>http://feedproxy.google.com/~r/alexras/~3/oFgxSmLS_r0/</link>
		<comments>http://alexras.info/2012/01/15/algorithms-for-hanging-with-friends/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 07:41:52 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Fun and Games]]></category>

		<guid isPermaLink="false">http://alexras.info/?p=1029</guid>
		<description><![CDATA[For the past few months, I&#8217;ve been playing Hanging with Friends with a few friends of mine. Hanging with Friends is a modified version of Hangman: your opponent gives you a word with one of the letters filled in and the rest left as blanks, and you have to guess the word one letter at [...]]]></description>
			<content:encoded><![CDATA[<p>For the past few months, I&#8217;ve been playing <a href="http://www.hangingwithfriends.com/">Hanging with Friends</a> with a few friends of mine. Hanging with Friends is a modified version of <a href="http://en.wikipedia.org/wiki/Hangman_(game)">Hangman</a>: your opponent gives you a word with one of the letters filled in and the rest left as blanks, and you have to guess the word one letter at a time without making too many mistakes. Once you try solving a word, you&#8217;re given a set of letters that you can use to construct a word that your opponent in turn tries to solve. The first person to fail to guess five words loses.</p>
<p>On a recent long, boring drive up I-5 I found myself thinking about Hanging with Friends, and what it would take to have a computer both solve Hanging with Friends puzzles well and come up with good puzzles of its own.</p>
<p><a href="http://alexras.info/wp-content/uploads/2011/12/HangingWithFriends-Gameplay.jpeg"><img src="http://alexras.info/wp-content/uploads/2011/12/HangingWithFriends-Gameplay.jpeg" alt="" title="HangingWithFriends-Gameplay" width="250" height="382" class="aligncenter size-full wp-image-1101" /></a></p>
<h2>Solving Puzzles</h2>
<p>Solving Hanging with Friends puzzles is pretty straightforward from an algorithmic point of view, as long as you have the dictionary of possible words handy. The program is given a template for a word as input (<code>?op?er</code> in the above example, where <code>?</code> represents an unknown letter) and is expected to produce the next letter that the player should guess. One possible solution starts by filtering the dictionary for words that match the template; in the above example, &#8220;copter&#8221; would match the template but &#8220;spam&#8221; or &#8220;bacon&#8221; would not. It then counts the number of times each guessable letter occurs in this set of candidate words, and returns the letter with the largest count. The idea here is that an incorrect guess eliminates the largest number of candidate words.</p>
<p>If you don&#8217;t have a dictionary (or have to operate on the assumption that the dictionary isn&#8217;t perfect), things get a lot harder. You could do arbitrarily sophisticated things here; one thing that comes to mind is using a dictionary to learn what groups of English words tend to go together and guess those in an intelligent way. For example, if you&#8217;re given a word whose last three letters are &#8220;i??&#8221;, you might want to guess n, g, n, t, m or e because of the common word groups &#8220;ing&#8221;, &#8220;int&#8221;, &#8220;ine&#8221; and &#8220;ime&#8221;, or if you&#8217;re given a word where the revealed letter isn&#8217;t a vowel, you might want to guess each of the vowels. You probably would want to take frequency of occurrence of these common word groupings in the dictionary into account here as well. What you&#8217;d probably want is to train some sort of learning system to do this; there are a ton of different possibilities here.</p>
<h2>Making puzzles</h2>
<p>Picking good words to give your opponent is a little more tricky. Abstractly, you may want to pick words that are hard to solve. Typically these are words that are long, probably uncommon, and have a large number of distinct letters, since those words give your opponent more opportunities to make a mistake. You might also want to pick words with high scores. Hanging with Friends rewards you with some amount of in-game currency for each 200 points scored when creating puzzles for your opponent (using Scrabble-style scoring with letter scores and position-based score multipliers). This in-game currency can be exchanged for power-ups that make a word easier to guess by eliminating letters when you&#8217;re the one solving, or feeding you hard-to-solve words when you&#8217;re making the puzzle. In-game currency can also be used to purchase various cutesy avatars and whatnot in their in-game store. Of course you can purchase in-game currency with real money (this is where Zynga&#8217;s signature brand of devious social engineering rears its ugly head), but with two copies of an algorithm like this and a colluding friend, you could mine in-game currency as efficiently as possible. Not that I&#8217;m suggesting such a thing, of course.</p>
<p>To keep things as generic as possible, what you&#8217;re really looking for is the ability to pick a word with the maximum value for some <em>cost function</em> from the set of words that can be generated using the tiles you&#8217;re given. The algorithm when cast this way is also pretty straightforward if you have a dictionary at hand: filter the dictionary to the set of words you can legally play, give each word a score, and pick the highest-scoring word.</p>
<h2>On Word Commonness</h2>
<p>One additional ingredient that&#8217;s missing from the above algorithms is some notion of the commonness of a word. Intuitively, words that aren&#8217;t commonly used are harder to guess; in the above example of &#8220;?op?er&#8221;, I&#8217;m more likely to guess &#8220;copter&#8221;, &#8220;copier&#8221;, or &#8220;gopher&#8221; than I am to guess &#8220;mopier&#8221; or &#8220;dopier&#8221; because I use the former set of words more often than I use the latter. Word commonness is a tricky thing to get right; even if you had a corpus of information the size of the Internet from which to draw (which companies like Google do), the problem is complicated by the fact that many people have trouble with spelling and sometimes use one word when they mean to use another. Another complication is that the frequency of some words can vary substantially based on context; for example, computer scientists use the words &#8220;ping&#8221;, &#8220;packet&#8221; and &#8220;hash&#8221; more frequently than other people do. That said, a good first approximation would be to count the frequency of each of the dictionary words in the largest corpus of English text you could find.</p>
<h2>The Code</h2>
<p>I went ahead and implemented a simple version of the algorithms described above and put it on GitHub as <a href="https://github.com/alexras/hanging-tools">hanging-tools</a>.</p>
<p><strong>Disclaimer</strong> (so that people won&#8217;t immediately stop playing Hanging with Friends with me): I didn&#8217;t use these tools to cheat in any of my Hanging with Friends games, although I did feed it old puzzles as test cases.</p>
<p>If you&#8217;re interested in playing around with this (or fixing my bugs!) I&#8217;d be interested to see what you do with it. That repository also comes with a copy of the ENABLE dictionary, which Zynga apparently uses as the basis for their word database.</p>
<img src="http://feeds.feedburner.com/~r/alexras/~4/oFgxSmLS_r0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://alexras.info/2012/01/15/algorithms-for-hanging-with-friends/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://alexras.info/2012/01/15/algorithms-for-hanging-with-friends/</feedburner:origLink></item>
		<item>
		<title>Year in Review</title>
		<link>http://feedproxy.google.com/~r/alexras/~3/Yckz8GfkP-s/</link>
		<comments>http://alexras.info/2011/12/31/year-in-review/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 02:10:55 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://alexras.info/?p=1104</guid>
		<description><![CDATA[Last year, I made a New Year&#8217;s resolution to post something on this blog every week for a whole year. At the time I made that resolution, that meant that I&#8217;d have to write 50 blog posts before the end of the year. If I count correctly, this post makes 46 total. Not perfect, but [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://alexras.info/2011/01/16/happy-blog-new-year/">Last year</a>, I made a New Year&#8217;s resolution to post something on this blog every week for a whole year. At the time I made that resolution, that meant that I&#8217;d have to write 50 blog posts before the end of the year. If I count correctly, this post makes 46 total. Not perfect, but not bad. At one point, I even had a buffer that was several weeks long!</p>
<p>One of the things that I was curious about going in was what the effect of an increased post volume would be on my pageviews. According to Google Analytics, my number of visits increased by 40% from this time last year. Most of my traffic came from search engines or referrals from Facebook, and most people came for my <a href="http://alexras.info/2011/01/27/esoteric-tip-4-custom-ansi-colors-in-terminal-app">esoteric</a> <a href="http://alexras.info/2011/07/16/esoteric-tip-5-finding-undocumented-files-with-doxygen/">tips</a> or my <a href="http://alexras.info/2011/09/24/advice-for-new-graduate-students/">crotchety advice</a>.</p>
<p>For those who like looking at graphs (because really, who doesn&#8217;t?), here&#8217;s my weekly &#8220;views&#8221; every week this year (blue) vs. last year (orange):</p>
<p><a href="http://alexras.info/wp-content/uploads/2011/12/pageviews.png"><img src="http://alexras.info/wp-content/uploads/2011/12/pageviews.png" alt="" title="pageviews" width="100%" class="aligncenter size-full wp-image-1107" /></a></p>
<p>Truth be told, I started to run out of things to say sometime in November. We&#8217;ll see if I keep this post-a-week thing going into 2012, but it&#8217;s been an interesting experiment at the very least. Happy New Year!</p>
<img src="http://feeds.feedburner.com/~r/alexras/~4/Yckz8GfkP-s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://alexras.info/2011/12/31/year-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://alexras.info/2011/12/31/year-in-review/</feedburner:origLink></item>
		<item>
		<title>Holiday Chipmusic</title>
		<link>http://feedproxy.google.com/~r/alexras/~3/1UFwJB-Objk/</link>
		<comments>http://alexras.info/2011/12/24/holiday-chipmusic/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 07:00:42 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://alexras.info/?p=1087</guid>
		<description><![CDATA[Happy holidays! By now, you might be sick of being bombarded with the same 15 saccharine, dated holiday songs by mall loudspeakers and radio stations everywhere. As my gift to you, Internet, let me point you at something different &#8211; that&#8217;s right, it&#8217;s holiday chipmusic time! Doctor Octoroc &#8211; 8-Bit Jesus: Holiday classics in the [...]]]></description>
			<content:encoded><![CDATA[<p>Happy holidays! By now, you might be sick of being bombarded with the same 15 saccharine, dated holiday songs by mall loudspeakers and radio stations everywhere. As my gift to you, Internet, let me point you at something different &#8211; that&#8217;s right, it&#8217;s holiday chipmusic time!</p>
<p><a href="http://www.doctoroctoroc.com/8-bit-jesus/">Doctor Octoroc &#8211; 8-Bit Jesus</a>: Holiday classics in the style of video game classics. Includes such gems as &#8220;Have Yourself a Final Little Fantasy&#8221;, &#8220;Bubbles We Have Heard on Bobble&#8221;, and &#8220;Super Jingle Bros.&#8221;.</p>
<p><a href="http://georgeandjonathan.com/thebestchristmas/">George and Jonathan &#8211; The Best Christmas</a>: The dynamic duo of pxtone wizardry bring their infectious energy to the holiday season with a Christmas-inspired album.</p>
<p><a href="http://rushcoil.bandcamp.com/album/8-bit-christmas/">Rush Coil &#8211; 8-bit Christmas</a>: Rush Coil covers Christmas music. Deck the halls &#8230; and defeat the Master Robots.</p>
<p><a href="https://8bc.org/music/EvilWezil/Carol+of+the+Bells/">EvilWezil &#8211; Carol of the Bells</a>: The inimitable EvilWezil takes on a holiday classic, and produces this in a <em>day</em>. EvilWezil cannot be stopped!</p>
<img src="http://feeds.feedburner.com/~r/alexras/~4/1UFwJB-Objk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://alexras.info/2011/12/24/holiday-chipmusic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://alexras.info/2011/12/24/holiday-chipmusic/</feedburner:origLink></item>
		<item>
		<title>Sonic CD – Seriously, Just Play It</title>
		<link>http://feedproxy.google.com/~r/alexras/~3/whSQuim0YUU/</link>
		<comments>http://alexras.info/2011/12/22/sonic-cd-seriously-just-play-it/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 07:37:13 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Fun and Games]]></category>

		<guid isPermaLink="false">http://alexras.info/?p=1066</guid>
		<description><![CDATA[Sonic hasn&#8217;t had all that great of a run for most of the past ten years or so. The franchise was handed off to a bunch of different teams in the 2000s, each of which had their own vision of what a Sonic game should look like. Unfortunately, each of those visions was more mediocre [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://alexras.info/wp-content/uploads/2011/12/sonic-cd-sparkles.jpeg"><img src="http://alexras.info/wp-content/uploads/2011/12/sonic-cd-sparkles.jpeg" alt="" title="Ooh, Shiny" width="549" height="383" class="aligncenter size-full wp-image-1072" /></a></p>
<p>Sonic hasn&#8217;t had all that great of a run for most of the past ten years or so. The franchise was handed off to a bunch of different teams in the 2000s, each of which had their own vision of what a Sonic game should look like. Unfortunately, each of those visions was more mediocre than the last. Recently though, the future&#8217;s been looking a little brighter for our spiky blue hero. Sega put a new guy in charge of Sonic&#8217;s future direction last year, and one of the first things his team did was <a href="http://www.eurogamer.net/articles/2010-10-07-average-sonic-games-removed-from-shops">pull all the recent &#8220;average&#8221; Sonic titles from the shelves</a>. Shortly thereafter, they released Sonic Colors, Sonic 4 Episode 1 and Sonic Generations, and they all got pretty good reviews (for next-gen Sonic titles, anyway). Sonic 4 Episode 1 and Sonic Generations both attempt to re-attract the &#8220;older&#8221; generation of Sonic gamers who remember a time when Sonic titles were known for being good instead of, well, laughably awful.</p>
<p>The next big thing in Sonic&#8217;s &#8220;everything old is new again&#8221; renaissance is the <a href="http://www.sega.com/games/sonic-cd-2011/">re-release of Sonic CD</a> on PC, XBox 360, PS3 and iOS devices. I&#8217;ve already played through Sonic CD several times (in emulators and on the Sega CD), but I bought it again for XBox 360, and I&#8217;m <em>really</em> glad I did.</p>
<p>Sonic CD is in many ways the spiritual successor to the original Sonic the Hedgehog, even though it was released a few months after Sonic 2. Most of Sonic&#8217;s sprites are re-used from Sonic 1, special stages are accessible at the end of the level rather than at checkpoint lampposts, and each zone has three acts rather than two. Sonic CD takes advantage of the ill-fated Sega CD&#8217;s hardware, sporting a CD-quality soundtrack (which was a novelty in 1993) and levels that are absolutely massive by comparison to those in the first couple Sonic games.</p>
<p>The big novel gameplay mechanic in Sonic CD is time travel (because really, what series <em>doesn&#8217;t</em> get better with the inexplicable addition of time travel?) Each level in Sonic CD is playable in three time periods: past, present, and future. Sonic gets between time periods by hitting a Time Warp sign (conveniently labeled Past or Future) and then running at top speed for a few seconds without stopping. The future is further subdivided into the &#8220;good&#8221; future and the &#8220;bad&#8221; future. Dr. Robotnik has put a machine in the past on each level that powers his badnik army; if Sonic travels to the past, then finds and destroys this machine, the future is saved (unlocking the &#8220;good&#8221; future); if not, Robotnik has taken over in the future and it isn&#8217;t a very happy place (the &#8220;bad&#8221; future). If you unlock the good future in every level or collect all the Time Stones (the stand-ins for that classic Sonic macguffin, the Chaos Emeralds), you get the good ending.</p>
<p>Sonic CD is pretty much tied with Sonic the Hedgehog 2 on my list of the best Sonic games of all time. The fact that every level is essentially <em>four</em> levels is a testament to the enormous amount of room the designers had to work with on the Sega CD. The different time periods aren&#8217;t just palette swaps either; they actually went through the effort to modify the graphics and level design and write different background tracks for each one. The soundtrack (while <em>very</em> &#8217;90s) is pretty great in both Japanese and English versions (the <a href="http://youtu.be/wXLQHs89c-U">Japanese boss music</a> is by far my favorite). The &#8220;go really fast for a while without stopping&#8221; requirement for time travel actually inspired some really inventive level design; speed traps and loops that were just nuisances before become things the player actively seeks out. Seeking out Dr. Robotnik&#8217;s machines in the past puts a much larger emphasis on exploration, although you can still race through the levels at full speed if you want. It&#8217;s got &#8220;replay value&#8221; in spades.</p>
<p>What really sets Sonic CD apart from any other Sonic game from that era are the boss battles.</p>
<p><a href="http://alexras.info/wp-content/uploads/2011/12/20111215-000321.jpeg"><img src="http://alexras.info/wp-content/uploads/2011/12/20111215-000321.jpeg" alt="" title="20111215-000321" width="512" height="288" class="aligncenter size-full wp-image-1075" /></a></p>
<p>Typically a boss battle in a Sonic game is a pretty standard affair. Dr. Robotnik shows up in some kind of mech whose design is inspired by the level&#8217;s overall theme (i.e. if you&#8217;re in an ice level, that mech&#8217;s gonna have a freeze ray), you hit him seven or eight times while dodging his attacks, most of his mech explodes and he runs away. Sonic CD&#8217;s bosses are in that same vein, but are a lot less conventional. You&#8217;re still fighting Robotnik in a mech most of the time, but in one level he&#8217;s at the top of a giant diabolical pinball machine and you only have to reach him and hit him once to end the whole thing. In another, he locks you in a room containing a fearsome death trap and watches in mounting dismay as the death trap slowly tears itself (and his conveniently placed adjacent control room) apart. In still another, he traps you underwater only to make the critical mistake of making a shield for his mech out of air bubbles. Really inspired and original stuff, some of the best of the whole series.</p>
<p>Oh, and did I mention that in one level there&#8217;s a shrink ray?</p>
<p><a href="http://alexras.info/wp-content/uploads/2011/12/Shrink-Ray.jpg"><img src="http://alexras.info/wp-content/uploads/2011/12/Shrink-Ray.jpg" alt="" title="Shrink Ray!" width="108" height="78" class="aligncenter size-full wp-image-1070" /></a></p>
<p>Yeah, in one level? There&#8217;s a <em>shrink ray</em>.</p>
<p>To their massive credit, Sega has really done Sonic CD justice with this re-release. Rather than sticking a huge border around the old VGA graphics like a lot of 16-bit game conversions, they actually took the time to port it to 16:9 native. Many people think the US soundtrack wasn&#8217;t as good as the Japanese soundtrack, so they included <em>both soundtracks</em>. They even added Tails in as a playable character. I mean seriously. That&#8217;s pretty awesome.</p>
<p>Seriously. Play this game. It&#8217;s well worth the $3-$5 you&#8217;ll pay for it on your platform of choice.</p>
<img src="http://feeds.feedburner.com/~r/alexras/~4/whSQuim0YUU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://alexras.info/2011/12/22/sonic-cd-seriously-just-play-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://alexras.info/2011/12/22/sonic-cd-seriously-just-play-it/</feedburner:origLink></item>
		<item>
		<title>Two Months Working with GitHub: A Retrospective</title>
		<link>http://feedproxy.google.com/~r/alexras/~3/2YmEEyhIwfk/</link>
		<comments>http://alexras.info/2011/12/13/two-months-working-with-github-a-retrospective/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 07:50:38 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Opinions (Uninformed)]]></category>

		<guid isPermaLink="false">http://alexras.info/?p=1031</guid>
		<description><![CDATA[For a long time, my thesis work was housed in a Mercurial repository on the department NFS server. We had a mailing list where team members could discuss ideas and report bugs. Ideas, to-dos and &#8220;bug reports&#8221; were kept in a combination of e-mail logs, Google Sites, Google Docs, and various text notes. We tried [...]]]></description>
			<content:encoded><![CDATA[<p>For a long time, my <a href="http://tritonsort.eng.ucsd.edu/">thesis</a> <a href="https://sites.google.com/a/eng.ucsd.edu/themis/">work</a> was housed in a Mercurial repository on the department NFS server. We had a mailing list where team members could discuss ideas and report bugs. Ideas, to-dos and &#8220;bug reports&#8221; were kept in a combination of e-mail logs, Google Sites, Google Docs, and various text notes. We tried getting code review to work with a few different tools, but I quickly grew tired of keeping them running. About two months ago, in response to the team&#8217;s increasing size and in preparation for releasing the code to some teams within UCSD, we decided to move the project to a private repository on <a href="https://www.github.com/">GitHub</a>.</p>
<p>All the cool kids seem to be hosting their source code in GitHub these days, and it&#8217;s not that surprising. GitHub&#8217;s UI is pretty, responsive, and knows when to stay out of your way. Adding things like post-commit hooks are really straightforward. It&#8217;s &#8220;social&#8221; without being in-your-face about it all the time. We liked the idea of having code review, issue tracking, and a wiki all in one place that we didn&#8217;t have to maintain ourselves. Also, we liked the idea of having a private repository that could be made public with the flick of a switch<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>.</p>
<p>Switching over to GitHub was a big adjustment, but in the end I think we made the right decision.</p>
<p>The one big thing that made us hesitant to switch over to GitHub was Git. Nobody on the team was really familiar with it, and frankly it looked kind of scary compared to Mercurial. Lots of commands, the ability to edit history, etc. It looked really heavyweight. I can say though, that in the long run I&#8217;m really glad that we switched to Git, GitHub or no GitHub. Git&#8217;s technical complexity is a little daunting at first, and I&#8217;m still frightened of rebasing, but the transition was a lot less rocky than I&#8217;d expected it would be and I&#8217;m happy enough with Git that I find myself picking it over Mercurial even for projects that (for various reasons) aren&#8217;t hosted in GitHub.</p>
<p>Moving from &#8220;hack, hack, commit, push, hack&#8221; to &#8220;branch, hack, send a pull request, branch, hack&#8221; also seems to have been an easier adjustment than I expected. Once we got comfortable with the idea that branching and merging frequently was OK, things went pretty smoothly. Most of us are old school(?) CVS and Subversion guys who remember when branching was largely more trouble than it was worth (tree conflicts, anyone?), so dealing with many branches at once was a bit of a shock. As it turns out, frequent branching has been more of a boon than a burden. <code>git branch</code> and <code>git stash</code> together have changed my whole workflow. Being able to jump back and forth between tasks without having to have a dozen copies of the repository littering my directory tree is really liberating.</p>
<p>By far my favorite piece of GitHub&#8217;s tool suite is the code review system. Having every line of code looked at by at least one other person before it gets committed has really improved our code quality. It also helps to prevent any single person from being the only one who knows how a given module works. Being able to have conversations about parts of the code with other team members and having those comments show up in context is a huge win over ad-hoc fumbling with e-mail (&#8220;on line 20 of foo.cc: this thing should change this way; on line 25 of foo.cc: that other thing should change too&#8221;, etc).</p>
<p>I&#8217;m really impressed with GitHub overall, so much so that I&#8217;ve been slowly migrating repositories to them from other services. If you&#8217;re looking for a place to host your team&#8217;s code, they&#8217;ve got a really solid offer and you can&#8217;t beat the price (especially considering it&#8217;s free for public repositories).</p>
<div class="footnotes">
<hr />
<ol>
<li id="fn:1">
We&#8217;re going to open source this work sometime before I graduate. Just not now. It&#8217;s not ready now.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a>
</li>
</ol>
</div>
<img src="http://feeds.feedburner.com/~r/alexras/~4/2YmEEyhIwfk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://alexras.info/2011/12/13/two-months-working-with-github-a-retrospective/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://alexras.info/2011/12/13/two-months-working-with-github-a-retrospective/</feedburner:origLink></item>
		<item>
		<title>MarkupServe – A DIY Evernote Alternative</title>
		<link>http://feedproxy.google.com/~r/alexras/~3/_lwDbYrMVBc/</link>
		<comments>http://alexras.info/2011/11/28/markupserve-a-diy-evernote-alternative/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 04:00:23 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Useful Software]]></category>

		<guid isPermaLink="false">http://alexras.info/?p=1021</guid>
		<description><![CDATA[I&#8217;ve gushed at length in the past about how much I love Evernote. I upgraded to Evernote Pro about half a year ago so that I could attach arbitrary file types to notes. After a while, though, a couple of things about my workflow with Evernote were starting to irk me. First, I wasn&#8217;t even [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve gushed at length in the past about <a href="http://alexras.info/2011/06/21/software-i-use-daily-evernote/">how much I love Evernote</a>. I upgraded to Evernote Pro about half a year ago so that I could attach arbitrary file types to notes. After a while, though, a couple of things about my workflow with Evernote were starting to irk me.</p>
<p>First, I wasn&#8217;t even coming close to using Evernote Pro&#8217;s generous data cap. Second, I wasn&#8217;t sure that paying $5 a month so that I could attach a PDF to a note was worth it given how infrequently I was attaching PDFs to notes. Third, and maybe most critically, their WYSIWYG editor has always kind of bugged me; lists never really indent the right way, sometimes formatting leaks to the next paragraph in unpredictable ways, etc. It&#8217;s just really hard generally to get precision control over how your text looks in Evernote&#8217;s editor (at least on the Mac, I have no experience with the Windows editor). Its lack of Linux compatibility isn&#8217;t a problem for me anymore, but it might become a problem if I start working on Linux boxes again in the future.</p>
<p>I figured the &#8220;paying for space I don&#8217;t use&#8221; problem would be solved if I could find something that would sync with <a href="https://www.dropbox.com/">Dropbox</a>. I have a couple GB of free space with them that is really underutilized and I would prefer using that space instead of paying for <em>more</em> underutilized space. For the &#8220;imprecise editing&#8221; problem, I decided that what I really wanted was the ability to write notes in a markup language like Markdown (which I also <a href="http://alexras.info/2011/08/19/the-joys-of-markdown/">love and have gushed about here</a>), do my writing in Emacs, and be able to view the notes in HTML easily.</p>
<p>I couldn&#8217;t find any pre-existing solution that I really liked, so I decided to roll my own.</p>
<p>Dropbox support wasn&#8217;t a problem; I just exported my notes from Evernote, used <a href="http://www.aaronsw.com/2002/html2text/">html2text</a> to convert the exported notes into Markdown, and moved the folder containing the converted notes to my Dropbox folder, where it happily synchronized. Dropbox, you are awesome.</p>
<p>At first, I used <a href="http://markedapp.com/">Marked</a> to render and view notes individually. Marked is a great app, but I wanted to be able to interact with rendered versions of my files more quickly. I had thought about writing up a read-only filesystem with <a href="http://fuse.sourceforge.net/">FUSE</a> that would do the rendering of Markdown to HTML transparently and just present a filesystem of HTML files, but that sounded like overkill even for me. I figured that writing up a simple web server with <a href="http://bottlepy.org/">Bottle</a> to display the rendered files would get me to a working solution much more quickly. After a couple hours of coding on Thanksgiving, I had <a href="https://github.com/alexras/markupserve">MarkupServe</a> working.</p>
<p>MarkupServe is pretty basic at this point. It&#8217;s given a directory tree containing markup files and presents that directory tree as a directory listing similar to the one httpd gives you if you don&#8217;t have an index page. It has simple keyword search (which just runs <code>grep</code> at the root of the directory tree and HTML-ifies the results) and renders notes to HTML on-the-fly when they&#8217;re clicked on. I made MarkupServe extensible enough that it should support more than just Markdown, in case others would find something like this useful but want to use other markup languages. It&#8217;s not the fastest or prettiest thing ever, but it works.</p>
<p>The last hurdle was making attaching files in Emacs comfortable. Evernote exports all attachments for a note <code>note.html</code> in a directory named <code>note.resources</code>, so I figured I&#8217;d stick to that convention. I made MarkupServe ignore directories that ended in <code>.resources</code> so that it wouldn&#8217;t clutter up the file listing. Then I wrote a couple little elisp functions that create a <code>.resources</code> directory for a note and &#8220;attach&#8221; a file by copying it into the appropriate <code>.resources</code> directory and inserting a Markdown-style link to the new copy. I&#8217;ve posted those functions in a <a href="https://gist.github.com/1397027">GitHub gist</a> if you&#8217;re interested in looking at those.</p>
<p>One big piece that this system is missing is a mobile app. Evernote&#8217;s iPhone app is terrific, and I&#8217;m going to miss it. At this point, my solution is to use <a href="http://www.secondgearsoftware.com/elements/">Elements</a> to edit notes and add photos taken with my phone&#8217;s camera to notes manually if the need arises. It&#8217;s sort of awkward, but I used the image attachment feature so infrequently in Evernote that I&#8217;m not really concerned about it. The system also lacks Evernote&#8217;s slick image OCR capability, but that was another feature I never really used (my handwriting&#8217;s pretty awful and the OCR could never really parse it well).</p>
<p>I&#8217;m sure I&#8217;ll tweak this setup considerably as I get more experience with it, but it was surprisingly quick to throw together and has proven really useful so far. Hopefully open-sourcing this stuff will help any other people who might have a similar itch to scratch.</p>
<img src="http://feeds.feedburner.com/~r/alexras/~4/_lwDbYrMVBc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://alexras.info/2011/11/28/markupserve-a-diy-evernote-alternative/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://alexras.info/2011/11/28/markupserve-a-diy-evernote-alternative/</feedburner:origLink></item>
		<item>
		<title>Escape to New York</title>
		<link>http://feedproxy.google.com/~r/alexras/~3/zj94xxfr7lk/</link>
		<comments>http://alexras.info/2011/11/24/escape-to-new-york/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 18:47:34 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://alexras.info/?p=1005</guid>
		<description><![CDATA[I got the opportunity to spend some time in New York a few weeks ago. Officially, I was there to attend Hadoop World, but I flew up a few days early to visit friends and see the city. I hadn&#8217;t been there since middle school (and I can&#8217;t really say I&#8217;ve been to New York [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://farm8.staticflickr.com/7151/6387559039_e7e1d428ca.jpg" alt="Big buildings are big" style="display: block; margin-left: auto; margin-right: auto" /></p>
<p>I got the opportunity to spend some time in New York a few weeks ago. Officially, I was there to attend <a href="http://www.hadoopworld.com/">Hadoop World</a>, but I flew up a few days early to visit friends and see the city. I hadn&#8217;t been there since middle school (and I can&#8217;t really say I&#8217;ve <em>been</em> to New York if I was twelve years old and with a tour group). My friend Mangesh and his roommate graciously let me crash on their couch for a couple of days until my official (and reimbursable!) conference hotel room was available. They are wonderful people.</p>
<p>I had a couple of days to walk around and enjoy the city. Spent most of Sunday at the <a href="http://www.amnh.org/">American Museum of Natural History</a>. The museum was just as great as I remember it being back in 1997, and their newly-renovated planetarium is absolutely spectacular.</p>
<p>I spent most of Monday wandering around Manhattan. Since a lot of the touristy things like museums are closed on Mondays, I spent a good deal of time in Central Park and wandered around Times Square and Rockefeller Center. There&#8217;s this amazingly stark contrast between Central Park and the rest of Manhattan. The decision to put the park there rather than developing that land was a really inspired choice on the part of city planners; it was a great place to wander around and relax after spending so much time getting jostled on the streets. The weather was perfect while I was there, which was a lucky break considering that the weather is apparently pretty erratic there in November.</p>
<p>I spent Tuesday and Wednesday at Hadoop World, hobnobbing with fellow big data geeks and interested businesspeople, talking about the state of Hadoop and the big data landscape in general. Since I&#8217;m in this weird pre-thesis-writing-but-thinking-about-graduation state right now, I spent much of the time getting a feel for what the various companies in the big data space were up to and doing a bit of shameless evangelizing of our group&#8217;s work with Themis (our follow-on work that has grown out of <a href="http://tritonsort.eng.ucsd.edu/">TritonSort</a>). My friend Yanpei (who is now wrapping up a Ph.D. at Cal) gave a great talk along with Todd Lipcon from Cloudera on <a href="http://www.cloudera.com/resource/hadoop-world-2011-presentation-slides-hadoop-and-performance">measuring and improving Hadoop&#8217;s performance</a> that you should check out if you&#8217;re interested in that kind of thing.</p>
<p>Tuesday night was spent at EMC/Greenplum&#8217;s bowling-for-charity event, in which I affirmed that a) I am not that great of a bowler and b) tech companies know how to throw a party. The attendees (with the help of sponsors) ended up raising over $20,000 for <a href="http://www.artistsforelephants.org/">Artists for Elephants</a>, which is also pretty cool. If the choice of charity sounds random, it&#8217;s worth noting that Hadoop&#8217;s mascot is a little yellow elephant. We are actively considering adopting an adorable mascot for the Themis project.</p>
<p>In general, my impression of New York was a lot more positive than I thought it would be. I&#8217;m not a huge fan of crowds, but for some reason Manhattan felt a lot less crowded than I imagined it would be, although there were still a ton of people everywhere. I can definitely see why people want to live in New York; there&#8217;s so much cultural diversity and so many things to do and see there. On the other hand, the ridiculously high cost of living (granted, my exposure to the city at this point has been Manhattan, which is probably not representative) and the constant crowds would kind of deter me from moving there.</p>
<p>I took a <a href="http://flic.kr/s/aHsjwTAnPt">ton of photos</a> during my trip that are up on Flickr.</p>
<img src="http://feeds.feedburner.com/~r/alexras/~4/zj94xxfr7lk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://alexras.info/2011/11/24/escape-to-new-york/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://alexras.info/2011/11/24/escape-to-new-york/</feedburner:origLink></item>
		<item>
		<title>tmux: the new hotness for terminal management</title>
		<link>http://feedproxy.google.com/~r/alexras/~3/pW22SdLMorg/</link>
		<comments>http://alexras.info/2011/11/03/tmux-the-new-hotness-for-terminal-management/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 04:53:21 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Useful Software]]></category>

		<guid isPermaLink="false">http://alexras.info/?p=998</guid>
		<description><![CDATA[Some time ago I talked about using GNU Screen to effectively manage a bunch of terminal windows. Turns out screen has some serious competition: tmux. One thing that&#8217;s pretty cool about tmux is the way it handles windows. tmux&#8217;s window management model is purely client-server; windows are clients, and clients are managed by a single [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago I talked about <a href="http://alexras.info/2011/08/13/power-using-gnu-scree/">using GNU Screen</a> to effectively manage a bunch of terminal windows. Turns out screen has some serious competition: <a href="http://tmux.sourceforge.net/">tmux</a>.</p>
<p>One thing that&#8217;s pretty cool about tmux is the way it handles windows. tmux&#8217;s window management model is purely client-server; windows are clients, and clients are managed by a single server tmux process. This allows you to do things like move a window between sessions or attach the same window in multiple sessions. I haven&#8217;t run into a situation where this was useful yet, but it&#8217;s nice to know that it&#8217;s possible.</p>
<p>The thing that I <em>have</em> found useful is the fact that tmux is reasonably scriptable. In order to get the list of windows in a screen session, I had to create a dummy window, stuff the real window list into it, dump the contents of the dummy window to a file and parse that file. With tmux, I call</p>
<p><code>tmux list-windows</code></p>
<p>from any window in the session, or</p>
<p><code>tmux list-windows -t &lt;session name&gt;</code></p>
<p>outside the session, and parse the output. Not only that, but tmux displays none of the weird &#8220;I can only make calls that change a session once per second&#8221; problems that I&#8217;ve been seeing in practice with screen.</p>
<p>Like screen, tmux won&#8217;t auto-sort windows by name or make their numbering contiguous. My <a href="https://github.com/alexras/py-screnum/">py-screnum</a> tool for sorting and compacting Screen windows takes several seconds to re-arrange windows and is 95 lines of Python (according to <a href="http://www.dwheeler.com/sloccount/">sloccount</a>). The analog for tmux, <a href="https://github.com/alexras/tmux-screnum/">tmux-screnum</a>, is only 57 lines, and re-arranges windows instantly. I won&#8217;t claim that either of these programs are minimal, but 50% fewer lines of code and <em>faster</em> is a winning combination.</p>
<p>There are times when I still have to use one or the other; many non-BSD machines come with screen installed by default but not tmux. I&#8217;m starting to prefer tmux whenever I have a choice, though.</p>
<img src="http://feeds.feedburner.com/~r/alexras/~4/pW22SdLMorg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://alexras.info/2011/11/03/tmux-the-new-hotness-for-terminal-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://alexras.info/2011/11/03/tmux-the-new-hotness-for-terminal-management/</feedburner:origLink></item>
	</channel>
</rss>

