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

<channel>
	<title>bitplane.net &#187; programming</title>
	<atom:link href="http://bitplane.net/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://bitplane.net</link>
	<description>Rants, ramblings, free software</description>
	<lastBuildDate>Tue, 08 May 2012 13:57:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Songs in code</title>
		<link>http://bitplane.net/2009/09/songs-in-code/</link>
		<comments>http://bitplane.net/2009/09/songs-in-code/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 12:46:28 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Junk]]></category>
		<category><![CDATA[humour]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=159</guid>
		<description><![CDATA[Memes become stale fast on Twitter, but I can see #songsincode lasting for a while.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a bit late on commenting on this Twitter meme as it&#8217;s over a month old, like all memes it&#8217;s a variation of something <a href="http://99-bottles-of-beer.net/info.html">as old as the Earth</a> and just recently revived. The concept is simple, just write a song lyric or title as a code snippet, set it as your status and share with others by linking the <a href="http://twitter.com/#search?q=%23songsincode">#songsincode</a> hashtag. That&#8217;s all.</p>
<p>Someone&#8217;s even made a <a title="Songs In Code DB" href="http://songsincodedb.com/" target="_blank">database</a> of all the posts where you can vote on the entries. Most are boring and just consist of lyrics padded out by punctuation, but there are some quite creative, non-obvious ones which use programming constructs to infer the lyrics. <a href="http://songsincodedb.com/poster/twitter/bitplane">Here&#8217;s mine</a>&#8230;</p>
<p>(Hover over the links for spoilers)</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">class</span> BillieJean <span style="color: #008080;">:</span> <span style="color: #0000ff;">public</span> girl
<span style="color: #008000;">&#123;</span> 
  <span style="color: #0000ff;">int</span> i<span style="color: #008080;">;</span> 
  relationship lover<span style="color: #008080;">;</span>
<span style="color: #0000ff;">public</span><span style="color: #008080;">:</span> 
  BillieJean<span style="color: #008000;">&#40;</span>relationship <span style="color: #000040;">&amp;</span>me<span style="color: #008000;">&#41;</span> 
  <span style="color: #008080;">:</span> lover<span style="color: #008000;">&#40;</span><span style="color: #000040;">!</span>me<span style="color: #008000;">&#41;</span>, i<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><span style="color: #008000;">&#125;</span> 
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span></pre></div></div>

<p><a title="BillieJean's lover is not me, she's just a girl, says that i=1">spoil</a></p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">body<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
  print <span style="color: #ff0000;">'&lt;body&gt;'</span> . <span style="color: #202020;">body</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> . <span style="color: #ff0000;">'&lt;/body&gt;'</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span> 
love<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
  body<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><a title="Every &lt;body&gt; needs some (more) &lt;body&gt;, (in order) to love">spoil</a></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* mon = 255; tue=wed=0xaaaaaa; */</span> 
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>friday<span style="color: #009900;">&#41;</span>
  love<span style="color: #339933;">.</span>insert<span style="color: #009900;">&#40;</span>me<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><a title="I don't care if Monday's blue, Tuesday and Wednesday are grey, Thursday is omitted, but if Friday then I'm inserted into the love vector">spoil</a></p>

<div class="wp_syntax"><div class="code"><pre class="http" style="font-family:monospace;">GET /back.html HTTP/1.1
&nbsp;
HTTP/1.1 301
Location: /you_once_belonged.html</pre></div></div>

<p><a title="When you get back.html, you are redirected to where you_once_belonged.html is. (Yes, I know HTTP is a communication protocol rather than a programming language)">spoil</a></p>
<p>Some of my favourites (with slight edits):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">video$ <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #660033;">-9</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">-ef</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> radio<span style="color: #000000; font-weight: bold;">*`</span></pre></div></div>

<p>by <a title="The user 'video' finds the process matching radio*, and kills it" href="http://songsincodedb.com/poster/twitter/brozow" target="_blank">brozow</a></p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
  get_Satisfaction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>by <a title="get_Satisfaction is unreachable due to an early-out" href="http://songsincodedb.com/poster/twitter/stevecooperorg" target="_blank">stevecooperorg</a></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$live</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$you</span><span style="color: #339933;">==</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span></pre></div></div>

<p>by <a title="$live is false, with or without $you" href="http://songsincodedb.com/poster/twitter/o_Freud_o" target="_blank">o_Freud_o</a></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;/HTML&gt;'</span><span style="color: #339933;">;</span></pre></div></div>

<p>by <a title="$i ain't got no &lt;BODY&gt;" href="http://songsincodedb.com/poster/twitter/whybird" target="_blank">whybird</a></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">class</span> City <span style="color: #008080;">:</span> Rock, Roll <span style="color: #008000;">&#123;</span><span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span></pre></div></div>

<p>by <a title="This City is derived from Rock and Roll" href="http://songsincodedb.com/poster/twitter/alexmdac" target="_blank">alexmdac</a></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">try</span> <span style="color: #008000;">&#123;</span>
  get<span style="color: #008000;">&#40;</span>WHAT_YOU_WANT<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span> finally <span style="color: #008000;">&#123;</span>
  get<span style="color: #008000;">&#40;</span>WHAT_YOU_NEED<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>by <a title="You can't always get what you want, but if you use a try block, you just might find, you get what you need" href="http://songsincodedb.com/poster/twitter/rickgrundy" target="_blank">rickgrundy</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000; font-weight: bold;">&lt;&lt;</span> shout<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;</pre></div></div>

<p>by <a title="Shout lets it all out, these are the things stdout could do without" href="http://songsincodedb.com/poster/twitter/plikrg" target="_blank">plikrg</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2009/09/songs-in-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

