<?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>lixo.org &#187; Geek</title>
	<atom:link href="http://www.lixo.org/archives/category/general/geek/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lixo.org</link>
	<description>letting the problem solve itself</description>
	<lastBuildDate>Tue, 11 May 2010 04:39:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Balances between agile and usability</title>
		<link>http://www.lixo.org/archives/2008/11/27/balances-between-agile-and-usability/</link>
		<comments>http://www.lixo.org/archives/2008/11/27/balances-between-agile-and-usability/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 23:04:58 +0000</pubDate>
		<dc:creator>Carlos Villela</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.lixo.org/archives/2008/11/27/balances-between-agile-and-usability/</guid>
		<description><![CDATA[Jakob Nielsen on the use of Agile methods: Agile&#8217;s biggest threat to system quality stems from the fact that it&#8217;s a method proposed by programmers and mainly addresses the implementation side of system development. As a result, it often overlooks interaction design and usability, which are left to happen as a side effect of the [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
 <a href="http://www.flickr.com/photos/admiller/2761925206/" title="photo sharing"><img src="http://farm4.static.flickr.com/3246/2761925206_f12a3bd2ac_m.jpg" alt="" style="border: solid 2px #000000;" /></a>
</div>
<p>Jakob Nielsen on <a href="http://www.useit.com/alertbox/agile-methods.html">the use of Agile methods</a>:</p>
<blockquote><p>Agile&#8217;s biggest threat to system quality stems from the fact that it&#8217;s a method proposed by programmers and mainly addresses the implementation side of system development. As a result, it often overlooks interaction design and usability, which are left to happen as a side effect of the coding.</p>
</blockquote>
<p>In my experience, mostly as a developer, it is really easy to dismiss interaction and usability design for two reasons.</p>
<p>The first comes from the developers themselves, trading prettiness and consistency of user experience for cleaner and sounder domain models whenever they go in opposite directions. Signs this is happening are developers crying <a href="http://c2.com/xp/YouArentGonnaNeedIt.html"><span class="caps">YAGNI</span></a> when the stakeholders ask for a zoomable chart or <a href="http://c2.com/xp/DoTheSimplestThingThatCouldPossiblyWork.html"><span class="caps">DTSTTCPW</span></a> when a sortable, paginated data table is required.</p>
<p>Next time you see a system where there are enormous listings of items with no search, pagination or sorting, ask the developers if they have ever watched a typical user at work; chances are they have only thought about the system as they see it: since the testing dataset is usually small, a loop spitting out a bit of <span class="caps">HTML</span> for each element isn&#8217;t such a big deal. They might even say there&#8217;s a story to implement all that lovely stuff later on, but they just get moved over and over to the bottom of the backlog barrel&#8230; until everyone watches a person struggle to find needles in a tabular haystack all day. This is a simple example &#8211; almost too trivial actually, but one I&#8217;ve seen happen way too many times.</p>
<p>Changing the perception that usability is just the icing on the cake draws attention to all that wasted time to the stakeholders, and should enable a much better dialogue: developers get to write an application users will love, stakeholders spend their money wisely on something that will actually increase return on investment (as productivity gains), users feel empowered and less likely to make mistakes. Everybody wins.</p>
<p>The second reason UI design and usability get overlooked, and this is the one <a href="http://blog.franktrindade.com">Frank</a> alludes to in his <a href="http://blog.franktrindade.com/2008/11/25/agile-vs-usability">latest post</a>, is that some agile teams rely a bit too heavily on the stakeholder&#8217;s descriptions of what is wanted. It instantly reminded me of one my favourite quotes from <a href="http://www.imdb.com/title/tt0317219/">Cars</a>:</p>
<blockquote><p><strong>Lightning McQueen:</strong> All right, Luigi, give me the best set of black walls you&#8217;ve got.</p>
<p><strong>Luigi:</strong> No, no, no! You don&#8217;t know what you want! Luigi know what you want. Black-wall tires, they blend into the pavement, but these white-wall tires, they say look at me, here I am, love me.</p>
<p><strong>Lightning McQueen:</strong> All right, you&#8217;re the expert.</p>
</blockquote>
<p>I find it rare for the stakeholders to know exactly what they want, down to what the end-user experience should be like. Thinking about a reasonably-sized application at this level of detail can only be done as a series of small, incremental steps and having someone on the team who is really obsessed about making every single pixel on the screen be in the right place. And if you read the last sentence and thought &#8220;well, that&#8217;s not exactly the role of my stakeholder!&#8221; you get the point: the stakeholders should not have the final word as to what the usability and experience details should be, in the same way they simply delegate to and rely on the expertise of the development team to flesh out the details of a persistence layer.</p>
<p>Have look and feel expertise in your team, and trust it, in the same way you would trust the database or network connectivity expertise.</p>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lixo.org/archives/2008/11/27/balances-between-agile-and-usability/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Git Iterator</title>
		<link>http://www.lixo.org/archives/2008/07/22/git-iterator/</link>
		<comments>http://www.lixo.org/archives/2008/07/22/git-iterator/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 18:11:09 +0000</pubDate>
		<dc:creator>Carlos Villela</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.lixo.org/archives/2008/07/22/git-histogram/</guid>
		<description><![CDATA[I wanted to generate some visualizations of our project&#8217;s growth, so I decided to put together a little shell script that looked at the output from git log to spit out some metrics. So git-iterate was born: run anything through your entire project&#8217;s history, and get the results in something easily converted into a beautiful [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
 <a href="http://www.flickr.com/photos/jesus-h-shatner/1489971035/" title="photo sharing"><img src="http://farm2.static.flickr.com/1173/1489971035_9d6c0a399d_m.jpg" alt="" style="border: solid 2px #000000;" /></a>
</div>
<p>I wanted to generate some visualizations of our project&#8217;s growth, so I decided to put together a little shell script that looked at the output from <code>git log</code> to spit out some metrics.</p>
<p>So <code>git-iterate</code> was born: run anything through your entire project&#8217;s history, and get the results in something easily converted into a beautiful chart!</p>
<p>It does that by running <code>git-reset --hard $COMMIT</code> for every commit in the repository, and then calling the script given to it as the first argument. It passes the commit ID to the script too, so this:</p>
<pre><code>
git-iterate echo
</code></pre>
<p>&#8230;will generate a list of all your commit IDs, most recent last.</p>
<p>The code is <a href="http://github.com/cv/git-utils">on GitHub</a>, as usual. I&#8217;m running a few stats on some projects I have access to, and will upload a few charts as soon as they&#8217;re ready. Meanwhile, feel free to send me the output of this:</p>
<pre><code>
git-iterate 'echo `flog app` `flog spec`' # if needed, replace "spec" for "test"
</code></pre>
<p>&#8230;and I&#8217;ll chart those for comparison as well. Also, it shouldn&#8217;t be difficult to port git-iterate to other source control systems (all of them have a checkout command, right?) and, if you do that, make sure to plug it in the comments.</p>
<p>Have fun! <img src='http://www.lixo.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<br/><br />
<strong>Update:</strong> fresh off the oven, here&#8217;s <a href="http://spreadsheets.google.com/pub?key=pZ_qxWU0Fx8l2aH906srLJQ&#038;oid=2&#038;output=image">Rails&#8217; total lines of code</a>. Neat, huh?<br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lixo.org/archives/2008/07/22/git-iterator/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Binary Guitar</title>
		<link>http://www.lixo.org/archives/2008/04/20/binary-guitar/</link>
		<comments>http://www.lixo.org/archives/2008/04/20/binary-guitar/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 02:45:27 +0000</pubDate>
		<dc:creator>Carlos Villela</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.lixo.org/archives/2008/04/20/binary-guitar/</guid>
		<description><![CDATA[The Binary Guitar is a little experiment (took about a day or two to put together) I played with a couple of months ago, and I thought it was fun enough to share. Installation is seriously clunky &#8211; I have never tried it on anything but MacOS X Leopard running on a MacBook Pro so [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
<object type="application/x-shockwave-flash" width="260" height="213" data="http://www.flickr.com/apps/video/stewart.swf?v=1.173" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="intl_lang=en-us&amp;photo_secret=1135d65517&amp;photo_id=2399863051&amp;show_info_box=true"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=1.173"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=1.173" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&amp;photo_secret=1135d65517&amp;photo_id=2399863051&amp;flickr_show_info_box=true" height="213" width="260"></embed></object><br />

</div>
<p>The Binary Guitar is a little experiment (took about a day or two to put together) I played with a couple of months ago, and I thought it was fun enough to share.</p>
<p>Installation is seriously clunky &#8211; I have never tried it on anything but MacOS X Leopard running on a MacBook Pro so far, and even then there are lots of moving parts, but if you go through the pain of setting it all up, you should have some pretty decent sounds coming out of a <span class="caps">USB</span> Guitar Hero Controller (mine&#8217;s the X-Plorer, which comes with Guitar Hero II for the Xbox 360).</p
<p><strong>You&#8217;ll need:</strong></p>
<ul>
<li><a href="http://puredata.info">PureData</a></li>
<li><a href="http://developer.apple.com/graphicsimaging/quartz/quartzcomposer.html">Quartz Composer</a></li>
<li><a href="http://www.apple.com/downloads/macosx/audio/midipipe.html">MidiPipe</a></li>
<li><a href="http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/OsxDriver">Xbox 360 Controller Driver</a></li>
<li><a href="http://www.apple.com/ilife/garageband/">GarageBand</a> or other software that understands <span class="caps">MIDI</span></li>
</ul>
<p><strong>Running:</strong></p>
<ol>
<li>Install everything</li>
<li>Open PD to <span class="caps">MIDI</span>.mipi in MidiPipe</li>
<li>Open Binary Guitar.pd in PureData</li>
<li>Go to Pure Data / Preferences / <span class="caps">MIDI</span> settings&#8230; and point the <span class="caps">MIDI</span> inputs and outputs to MidiPipe</li>
<li>Open Binary Guitar.qtz in Quartz Composer</li>
<li>Connect the X-Plorer Guitar. If everything&#8217;s working correctly, the Quartz Composer viewer should be black (rather <br />
than a checkered pattern)</li>
<li>Open GarageBand, select your favourite virual instrument.</li>
<li>Rock on!</li>
</ol>
<p>Grab it in <a href="http://github.com/cv/compositions/tree/master/Binary%20Guitar">my github repository</a>.</p>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lixo.org/archives/2008/04/20/binary-guitar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaScript: Put everything in a namespace</title>
		<link>http://www.lixo.org/archives/2007/09/14/javascript-put-everything-in-a-namespace/</link>
		<comments>http://www.lixo.org/archives/2007/09/14/javascript-put-everything-in-a-namespace/#comments</comments>
		<pubDate>Fri, 14 Sep 2007 16:02:01 +0000</pubDate>
		<dc:creator>Carlos Villela</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.lixo.org/archives/2007/09/14/javascript-put-everything-in-a-namespace/</guid>
		<description><![CDATA[Yes, everything. Put it in a namespace. Everything. No exceptions and no excuses, unless yours is &#8220;I have just been thawed.&#8221; In this case, I want to be the first to warmly welcome you to the 21st century. Here&#8217;s a simple and reasonably OK way to do it and be nice to your friends, other [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
 <a href="http://www.flickr.com/photos/86953562@N00/455843984/" title="photo sharing"><img src="http://farm1.static.flickr.com/173/455843984_a4a8fe4b52_m.jpg" alt="" style="border: solid 2px #000000;" /></a>
</div>
<p>Yes, everything. Put it in a namespace. Everything. No exceptions and no excuses, unless yours is &#8220;I have just been thawed.&#8221; In this case, I want to be the first to warmly welcome you to the 21st century.</p>
<p>Here&#8217;s a simple and reasonably OK way to do it and be nice to your friends, other libraries and the world at large:</p>
<pre>
var Article = Article ? Article : new Object();
Article.title = "Report: School Shootings Help Prepare Students For Being Shot In Real World";
Article.save = function() {
  alert("Saving " + this.title);
}
</pre>
<p>You could save a few keystrokes, though. Just use the object literal notation directly:</p>
<pre>
var Article = Article ? Article : {
  title: "Report: School Shootings Help Prepare Students For Being Shot In Real World",
  save: function() {
    alert("Saving " + this.title) 
  }
}
</pre>
<p>These two last examples are great if you&#8217;re not that concerned about exposing the &#8216;title&#8217; attribute to the rest of the world. If there is a chance that problems could arise if some other piece of code changed it directly, there is a solution:</p>
<pre>
var Article = Article ? Article : function() {
  var private = {
    title: "Report: School Shootings Help Prepare Students For Being Shot In Real World"
  };

  var public = {
    getTitle: function() {
      return private.title;
    },

    save: function() {
      alert("Saving " + this.getTitle());
    }  
  }

  return public;
}();
</pre>
<p>I find this a bit hard to get used to, after so many years of developing in languages that explicitly allow me to set access control. It makes sense, though: by creating an anonymous function that returns the object I want to define, and then immediately calling it (note the &#8216;()&#8217; at the last line), I can hide whatever I don&#8217;t want other parts of the code to see &#8211; it&#8217;s all tucked away in the local context of that anonymous function.<br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lixo.org/archives/2007/09/14/javascript-put-everything-in-a-namespace/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>The Project Game</title>
		<link>http://www.lixo.org/archives/2007/06/13/the-project-game/</link>
		<comments>http://www.lixo.org/archives/2007/06/13/the-project-game/#comments</comments>
		<pubDate>Wed, 13 Jun 2007 20:33:17 +0000</pubDate>
		<dc:creator>Carlos Villela</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://www.lixo.org/archives/2007/06/13/the-project-game/</guid>
		<description><![CDATA[After reading A Theory Of Fun, I started seeing projects (and many other human activities) modelled as a game. In the book, Raph Koster describes a series of game development rules, and I found that they can be mapped to the software development project domain with some interesting results: A project, just like a game, [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
 <a href="http://www.flickr.com/photos/ahmedzahid/44627552/" title="photo sharing"><img src="http://farm1.static.flickr.com/31/44627552_7239172823_m.jpg" alt="" style="border: solid 2px #000000;" /></a>
</div>
<p>After reading <a href="http://www.theoryoffun.com">A Theory Of Fun</a>, I started seeing projects (and many other human activities) modelled as a game. In the book, <a href="http://www.raphkoster.com">Raph Koster</a> describes a series of game development rules, and I found that they can be mapped to the software development project domain with some interesting results:</p>
<ul>
<li>A project, just like a game, has roles. In projects, they&#8217;re specific to each role. These rules define the possible actions for each of them. <em>(This one isn&#8217;t described in the book, but I added it just to contextualise.)</em></li>
<li>Role-specific rules should be unambiguous, intelligible and apply to all people in that role.</li>
<li>No project can be developed without the meaningful interaction of the people in all roles.</li>
<li>The outcome of a project has to be uncertain, otherwise it loses its appeal.</li>
<li>Rules and representation of a project are not independent but interact with each other.</li>
<li>People require clear and immediate feedback to understand the relationship between action and outcome.</li>
<li>People require a clear goal so they can perform meaningful actions within the project world.</li>
<li>Conflict and competition against time, budget and scope are essential for everyone&#8217;s motivation.</li>
<li>The challenges of a project should match the skills of the people involved: neither too easy (boring) nor too difficult (frustrating).</li>
<li>Projects can be developed without the need for even skill sets among the team. Instead the people learn through interaction, and this should be allowed and encouraged to happen.</li>
<li>People perform actions within the project world and observe how these actions change the state of the project.</li>
<li>People form a hypothesis about the meaning of a deliverable or action on the basis of their studies.</li>
<li>People recognise and learn fundamental patterns within the project and can apply these to different situations (and, of course, other projects).</li>
</ul>
<p>The more I look at these, the more this matches the way I see people working in agile projects. I&#8217;m sure there&#8217;s a lesson to be learned here&#8230;</p>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lixo.org/archives/2007/06/13/the-project-game/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tip: get your TODOs out of the comments</title>
		<link>http://www.lixo.org/archives/2007/06/06/tip-get-your-todos-out-of-the-comments/</link>
		<comments>http://www.lixo.org/archives/2007/06/06/tip-get-your-todos-out-of-the-comments/#comments</comments>
		<pubDate>Wed, 06 Jun 2007 13:16:47 +0000</pubDate>
		<dc:creator>Carlos Villela</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.lixo.org/archives/2007/06/06/tip-get-your-todos-out-of-the-comments/</guid>
		<description><![CDATA[Developers in most projects I have seen try to establish some sort of convention around leaving TODOs in the code. The most common seems to be &#8220;if you see something funny, try to fix it immediately, but if it&#8217;d take too long and you&#8217;ve got something else to worry about, leave a comment next to [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
 <a href="http://www.flickr.com/photos/psycrow/268021578/" title="photo sharing"><img src="http://farm1.static.flickr.com/118/268021578_467c1e116a_m.jpg" alt="" style="border: solid 2px #000000;" /></a>
</div>
<p>Developers in most projects I have seen try to establish some sort of convention around leaving TODOs in the code. The most common seems to be &#8220;if you see something funny, try to fix it immediately, but if it&#8217;d take too long and you&#8217;ve got something else to worry about, leave a comment next to it starting with TODO, your initials and maybe a date&#8221;.</p>
<p>You know what? Using comments for that is not as cool in Ruby, Python or Java, which has had static imports for a while now. How about creating a TODO method that takes in the initials, date and comment text, or whatever else you might find useful?</p>
<blockquote><pre>
import static my.project.DevelopmentUtils.TODO;

...

public void doStuffThatSmellsFunny() {
   TODO("CV, 21/jan", "Clean this mess up after fixing #3849");
   ...
}
</pre>
</blockquote>
<p>There are some advantages to this: you can actually put some code inside that method to do, say, logging. Another good thing is that now the TODOs can be tracked using the same refactoring tools and features of modern IDEs as just any other code in the project.</p>
<p>It may seem a bit cumbersome, but I&#8217;ve been trying that for a few days now and it feels quite pleasant to use. I got my TODO method to just spit out the message to the console so when I run tests, I can quickly get an idea of what areas of the code touch stinky or incomplete ones.<br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lixo.org/archives/2007/06/06/tip-get-your-todos-out-of-the-comments/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Viral software (and in a good way)</title>
		<link>http://www.lixo.org/archives/2007/05/29/viral-software-and-in-a-good-way/</link>
		<comments>http://www.lixo.org/archives/2007/05/29/viral-software-and-in-a-good-way/#comments</comments>
		<pubDate>Tue, 29 May 2007 22:48:18 +0000</pubDate>
		<dc:creator>Carlos Villela</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WebServices]]></category>

		<guid isPermaLink="false">http://www.lixo.org/archives/2007/05/29/viral-software-and-in-a-good-way/</guid>
		<description><![CDATA[I&#8217;ve been hanging out with friends in São Paulo over the last few days, getting unreasonably drunk, eating too much and attending the Google Developer Day, not necessarily in that order, so I missed the announcements that Facebook had opened up their API. As a software developer with a healthy affection for all things related [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
 <a href="http://www.flickr.com/photos/quiplash/61309174/" title="photo sharing"><img src="http://farm1.static.flickr.com/25/61309174_35c7397efc_m.jpg" alt="" style="border: solid 2px #000000;" /></a>
</div>
<p>I&#8217;ve been hanging out with friends in São Paulo over the last few days, getting unreasonably drunk, eating too much and attending the <a href="http://code.google.com/events/developerday/">Google Developer Day</a>, not necessarily in that order, so I missed the announcements that <a href="http://developers.facebook.com/">Facebook had opened up their API</a>.</p>
<p>As a software developer with a healthy affection for all things related to network effects and emergent behaviours, this is brilliant.</p>
<p>The applications provided get added to a central registry inside Facebook, from where you can pick and choose the ones you want added to your profile. They still have to be deployed separately (as Facebook doesn&#8217;t host them for you), but the user doesn&#8217;t see any of that &#8211; all of it is a very simple and well-designed UI, so &#8220;installing&#8221; an application to your profile is a hell of a lot easier than installing a desktop application to your machine, and gives the user instant feedback.</p>
<p>Leaving important considerations on data ownership and privacy aside, which I won&#8217;t comment on since I haven&#8217;t read the agreements in much detail, I can see this thing eating a huge chunk of what we nowadays use disconnected internet applications for. Instant, mobile and email-like messaging, discussion groups, photo sharing and some other basic kinds of applications are already there, as are little data aggregation tools, like the del.icio.us and Magnolia importers. If this API is successful (and so far, nothing suggests otherwise), other social networks could as well be dragged inside Facebook if they support any kind of external API. And, if not, there are always screen scraping tools like <a href="http://code.whytheluckystiff.net/hpricot/">Hpricot</a>.</p>
<p>Something to watch out for, definitely. Ten years ago, we were wondering what kinds of applications could be made to run on the internet. Facebook is making us wonder what kinds of applications can be made to run on top of a social network. Which ones would you try?<br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lixo.org/archives/2007/05/29/viral-software-and-in-a-good-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Thanks, Oracle</title>
		<link>http://www.lixo.org/archives/2007/04/23/thanks-oracle/</link>
		<comments>http://www.lixo.org/archives/2007/04/23/thanks-oracle/#comments</comments>
		<pubDate>Mon, 23 Apr 2007 13:28:17 +0000</pubDate>
		<dc:creator>Carlos Villela</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.lixo.org/archives/2007/04/23/thanks-oracle/</guid>
		<description><![CDATA[We&#8217;re using Oracle at my current project. I wanted to run some reporting scripts on the database to do some nice graphs with Graphviz and yEd. &#8220;Well, that&#8217;s been done before, should be pretty easy to hook up ActiveRecord to Oracle&#8221;, I thought. It turns out that&#8217;s nearly impossible to do on an Intel Mac [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
 <a href="http://www.flickr.com/photos/stuckincustoms/387019269/" title="photo sharing"><img src="http://farm1.static.flickr.com/182/387019269_068fd16670_m.jpg" alt="" style="border: solid 2px #000000;" /></a>
</div>
<p>We&#8217;re using Oracle at my current project. I wanted to run some reporting scripts on the database to do some nice graphs with Graphviz and yEd. &#8220;Well, that&#8217;s been done before, should be pretty easy to hook up ActiveRecord to Oracle&#8221;, I thought.</p>
<p>It turns out that&#8217;s nearly impossible to do on an Intel Mac running the x86 version of Ruby, since the Oracle Instant Client SDK only ships with PowerPC binaries so far (hence the title). Unless you recompile your whole Ruby install to PPC, something that to me sits somewhere between unspeakable and atrocious, you can&#8217;t link to its libraries, as far as I can tell.</p>
<p>But you can get SQLPlus to run on Rosetta. And you can get SQLPlus to spit out reasonably parseable HTML. And it&#8217;ll run slow &#8211; but for a quick-n-dirty report that you want to generate once every couple of months or so, it&#8217;s&#8230; ok.</p>
<p><code>
<pre>
def select_all(sql)
  html = `echo "#{sql};" | sqlplus -r 3 -l -s -m "html on entmap on" #{@user}/#{@password}@#{@host}`
  doc = Hpricot(html)
  (doc/'tr').collect do |tr| 
    (tr/'td').collect do |td|
      td.innerText.strip if td.innerText 
    end if (tr/'td').size == (doc/'tr/th').collect do |th|
      th.innerText.strip if th.innerText
    end.uniq.size
  end.compact
end
</pre>
<p></code></p>
<p>Look what you made me do, Oracle. You should be ashamed. As you can see, though, I&#8217;m not that easily embarrassed. Some people wouldn&#8217;t ever show this code to anyone, and deny its existence at all possible cost. I think it&#8217;s worth the shock value, though. <img src='http://www.lixo.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lixo.org/archives/2007/04/23/thanks-oracle/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>I love the OSA</title>
		<link>http://www.lixo.org/archives/2007/04/05/i-love-the-osa/</link>
		<comments>http://www.lixo.org/archives/2007/04/05/i-love-the-osa/#comments</comments>
		<pubDate>Thu, 05 Apr 2007 14:32:34 +0000</pubDate>
		<dc:creator>Carlos Villela</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Entertainment]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.lixo.org/archives/2007/04/05/i-love-the-osa/</guid>
		<description><![CDATA[Inspired by Nat Pryce&#8216;s recent scrapheap challenge idea for a Name That Tune style game, and given I&#8217;ve been having so much fun with the Ruby OSA lately, I decided to implement my own solution using it to drive iTunes and I had a lot of fun in the process. I started by grabbing a [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
 <a href="http://www.flickr.com/photos/phraseling/10320340/" title="photo sharing"><img src="http://farm1.static.flickr.com/7/10320340_8d3c0ba7a2_m.jpg" alt="" style="border: solid 2px #000000;" /></a>
</div>
<p>Inspired by <a href="http://nat.truemesh.com/">Nat Pryce</a>&#8216;s recent <a href="http://nat.truemesh.com/archives/000680.html">scrapheap challenge idea</a> for a Name That Tune style game, and given I&#8217;ve been having so much fun with the <a href="http://rubyosa.rubyforge.org/">Ruby OSA</a> lately, I decided to implement my own solution using it to drive <a href="http://www.apple.com/itunes/">iTunes</a> and I had a lot of fun in the process.</p>
<p>I started by grabbing a reference to iTunes:</p>
<p><code>
<pre>
%w(rubygems rbosa).each {|lib| require lib }

itunes = OSA.app("iTunes")
</pre>
<p></code></p>
<p>And then playing about with it until I found the right properties to look at and methods to call. As the game requires a constant stream of random tracks, I thought using the Party Shuffle feature of iTunes to would fit just right. The Party Shuffle is a special playlist that sits inside your library:</p>
<p><code>
<pre>
library = itunes.sources.find {|s| s.kind == OSA::ITunes::ESRC::LIBRARY }
party_shuffle = library.playlists.find {|p| p.special_kind == OSA::ITunes::ESPK::PARTY_SHUFFLE }
</pre>
<p></code></p>
<p>With that <code>party_shuffle</code> (an <code>OSA::ITunes::Playlist</code> object) at hand, it&#8217;s pretty easy to do the rest: playing, changing tracks and figuring out how to score each guess.</p>
<p>If you can grab <a href="http://code.lixo.org/src/toys/name_that_tune.rb">the complete solution</a> and make it into a nice little <a href="http://www.apple.com/macosx/features/dashboard/">dashboard widget</a>, I&#8217;ll be forever in debt!<br />
<br/><br />
<strong>BONUS UPDATE:</strong> I just finished refactoring a couple of things (namely, moving the monkey patching of <code>OSA::ITunes</code> away &#8211; it&#8217;s now in <a href="http://code.lixo.org/src/toys/itunes.rb">itunes.rb</a>) and, in the process of doing so, <a href="http://code.lixo.org/src/toys/tune_fight.rb">Tune Fight</a> was born!</strong><br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lixo.org/archives/2007/04/05/i-love-the-osa/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How would you improve this page?</title>
		<link>http://www.lixo.org/archives/2007/02/08/how-would-you-improve-this-page/</link>
		<comments>http://www.lixo.org/archives/2007/02/08/how-would-you-improve-this-page/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 00:24:50 +0000</pubDate>
		<dc:creator>Carlos Villela</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.lixo.org/archives/2007/02/08/how-would-you-improve-this-page/</guid>
		<description><![CDATA[On an application I&#8217;ve been working during my spare time, I had the need to ask my loyal friends and guinea pigs to give me some feedback, in order to help me fill in the gaps between what I think they want to do and what they really want to do in this application. A [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
 <a href="http://www.flickr.com/photos/cv/383185999/" title="photo sharing"><img src="http://farm1.static.flickr.com/125/383185999_1e9f1b518b_m.jpg" alt="" style="border: solid 2px #000000;" /></a>
</div>
<p>On an application I&#8217;ve been working during my spare time, I had the need to ask my loyal friends and guinea pigs to give me some feedback, in order to help me fill in the gaps between what I think they want to do and what they really want to do in this application.</p>
<p>A quick, cheap and really useful solution I came up with was adding a feedback form right there, on every page the application renders. This can certainly be improved by people more knowledgeable in Rails than myself, as for now it doesn&#8217;t even use AJAX to post the data back (shame, shock and horror!)</p>
<p>After running <code>scaffold_resource Comment body:text uri:string created_by:integer created_at:timestamp</code>, you should be pretty much set to go. Now, on your <code>application.rhtml</code>, you can do something like:</p>
<pre>
&lt;%= render :partial =&gt; "comment", :collection =&gt;<br/>Comment.find_all_by_uri(request.request_uri) %&gt;

&lt;% form_for :comment, Comment.new, :url =&gt; comments_path do |f| %&gt;
  &lt;%= f.hidden_field :uri, :value =&gt; request.request_uri %&gt;
  How would you improve this page?
  &lt;%= f.text_area :body, :rows =&gt; 5 %&gt;
  &lt;%= submit_tag 'Add comment' %&gt;
&lt;% end %&gt;
</pre>
<p>The <code>_comment.rhtml</code> partial is something like this:</p>
<pre>
&lt;%= comment.body %&gt;
Created by &lt;%= if comment.created_by.nil?
    'unknown'
else
    link_to(comment.created_by.name,
      profile_url(comment.created_by.profile))
end %&gt;

&lt;%= time_ago_in_words comment.created_at %&gt; ago

[&lt;%= link_to 'Destroy', comment_path(comment.id), :method =&gt; :delete %&gt;]
</pre>
<p>Customize the Comment controller slightly, and that&#8217;s it &#8212; instant feedback forms everywhere! <img src='http://www.lixo.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lixo.org/archives/2007/02/08/how-would-you-improve-this-page/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.451 seconds -->
<!-- Cached page served by WP-Cache -->
