<?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>Carlos Matallín &#187; Ones and Zeros</title>
	<atom:link href="http://c.matallin.com/category/ones-and-zeros/feed/" rel="self" type="application/rss+xml" />
	<link>http://c.matallin.com</link>
	<description>geek, blogger, entrepreneur and web designer.</description>
	<lastBuildDate>Fri, 13 Nov 2009 12:58:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rails Rumble &#8216;09</title>
		<link>http://c.matallin.com/2009/10/rails-rumble-09/</link>
		<comments>http://c.matallin.com/2009/10/rails-rumble-09/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 03:05:01 +0000</pubDate>
		<dc:creator>Carlos Matallín</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Ones and Zeros]]></category>
		<category><![CDATA[Rails Rumble 2009]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://c.matallin.com/?p=638</guid>
		<description><![CDATA[I know I had this pending SO MUCH time. But when I wanted to write about it I simply couldn&#8217;t find the words to express what I actually felt.
Last August (damn! we are in October now!) was celebrated the most famous competition in the Ruby on Rails community which consists in setting a functional webapp [...]]]></description>
			<content:encoded><![CDATA[<p>I know I had this pending <strong>SO MUCH</strong> time. But when I wanted to write about it I simply couldn&#8217;t find the words to express what I actually felt.</p>
<p>Last August (damn! we are in October now!) was celebrated the most famous competition in the <a href="http://rubyonrails.org">Ruby on Rails</a> community which consists in setting a functional webapp and deploy it in less than 48h: the <a href="http://r09.railsrumble.com/">Rails Rumble</a>.</p>
<p><span id="more-638"></span></p>
<p>The spirit of it is very similar to <a href="http://iweekend.org">iWeekend</a> and they share a lot of things; however, besides similarities they are quite different starting by the number of components which can form the team: as much as four, which let you have some programmers and fewer designers.</p>
<p>I really felt like taking part in such an event while commiting (nice word, huh?) <a href="http://c.matallin.com/2009/04/the-rails-way/">one of my new year&#8217;s resolutions</a>, so I proposed this to <a href="http://iamfelipe.com">Felipe Talavera</a> one of my partners in the startup we cofounded almost a year ago <a href="http://www.biblioteco.com">Biblioteco</a>. I&#8217;m not part of that project anymore but I really admire the work the developers did then in order to have everything up and running. With no doubt they are part of the <a href="http://spain.rb">elite spanish rails developers</a>.</p>
<p>Anyway, I was talking about the <a href="http://r09.railsrumble.com/">Rails Rumble</a>. I came up with this and he told me that they already had a team, <a href="http://r09.railsrumble.com/teams/mallorca">the Mallorca team</a> where I gently was invited.</p>
<p>What came after were <strong>48 hours of real extreme programming and some glances of design work</strong>. I would like to make a deeper analysis about the importance that the interface had in the final polls or the feelings I had about not being able of putting in the par of the rest of the members but as I said before I don&#8217;t really know how to express this.</p>
<p>Which remains from this great experience is a great mail voting system, <a href="http://letsdecide.us">Letsdecide</a><a href="http://letsdecide.us">.us</a> and some impressions like the fact that <a href="http://matallo.tumblr.com/post/119664297">4 people were more capable than 40</a> to have a fully functional webapp.</p>
<p>I also want to congratulate the other Spanish teams which I only can bow to their work:</p>
<ul>
<li><a href="http://letswadus.com/">Lets Wadus</a></li>
<li><a href="http://diversion.r09.railsrumble.com/"> Diversion</a></li>
<li><a href="http://www.parlio.org/">Parlio</a></li>
</ul>
<p>And a enormous thank to the Mallorca team to let me join: Rai, Felipe and Fer. I&#8217;m so grateful for such an experience!</p>
<p>Extra balls: <a href="http://www.fernandoguillen.info/es/blog/2009/08/28/the-rails-rumble-experience/">Fernando Guillen also posted something about this</a> + <a href="http://www.flickr.com/photos/d2clon/sets/72157622168506254/">Photo album</a> +  <a href="http://vimeo.com/6239199">Video demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://c.matallin.com/2009/10/rails-rumble-09/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Rails Way</title>
		<link>http://c.matallin.com/2009/04/the-rails-way/</link>
		<comments>http://c.matallin.com/2009/04/the-rails-way/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 23:54:33 +0000</pubDate>
		<dc:creator>Carlos Matallín</dc:creator>
				<category><![CDATA[Ones and Zeros]]></category>
		<category><![CDATA[piwid]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://c.matallin.com/?p=527</guid>
		<description><![CDATA[These days I am trying to accomplish one of my 2009 New Year&#8217;s resolutions: Learn Ruby on Rails and be able to prototype, code and design one functional web application (you know, I&#8217;m in exams time&#8230;)
I have already worked with Ruby on Rails before, but only from the designer&#8217;s point of view: being able to implement my [...]]]></description>
			<content:encoded><![CDATA[<p>These days I am trying to accomplish one of my 2009 New Year&#8217;s resolutions: <strong>Learn Ruby on Rails and be able to prototype, code and design one functional web application</strong> (you know, I&#8217;m in exams time&#8230;)</p>
<p>I have already worked with <a href="http://rubyonrails.org/">Ruby on Rails</a> before, but only from the designer&#8217;s point of view: being able to implement my designs without the application to crash. Anyway the workflow with <abbr title="Ruby on Rails">RoR</abbr>, the philosophy behind and its singularities <strong>definitely definitely hooked me</strong>. Furthermore I must say to my own shame that I have only coded in C programming language in order to pass my practical lessons at the University.</p>
<p>To gain an insight into what I am talking about <strong>let&#8217;s face a real problem</strong> with which I had to deal while I am building this application.</p>
<p><span id="more-527"></span></p>
<p>Users must be able to register in the application, that will create a visit card for them with their data. One of the <abbr title="Ruby on Rails">RoR</abbr> conventions is the <a href="http://en.wikipedia.org/wiki/Model–view–controller"><abbr title="Model-View-Controller">MVC</abbr></a> architecture pattern that ensures the <abbr title="Don't repeat yourself">DRY</abbr>ness of your code (that&#8217;s a bunch of acronyms!). This is the piece of code from the Controller that was in charge of that (I am taking for granted some knowledge about these terms; if not, go Google them as I did before because they are really easy to understand):<br />
<code>/app/controllers/users_controller.rb</code></p>
<pre>class UsersController < ApplicationController
  def create
    @user = User.new(params[:user])
    @card = Card.new
    @card.user_id = @user.id
    @card.title = "Visit card of #{@user.login}"
    if @user.save &#038;&#038; @card.save
      flash[:notice] = "Account registered!"
      redirect_back_or_default account_url
    else
      render :action => :new
    end
  end
end</pre>
<p>In <abbr title="Ruby on Rails">RoR</abbr>, there are always some <em>mantras</em> that one must follow in order to program good pieces of code, this way we will end up with an application that has everything in its right place and works properly. One of these <em>mantras</em> is <a href="http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model">Skinny Controller Fat Model</a>, which says that many of our business logic must be in the Model instead of the Controller. So taking a look at our code we know we are not doing it well.</p>
<p>We can move some of the code from the Controller to the Model making use of the callback <code>after_create</code>. There is a <a href="http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html">good documentation about that</a> and other people with much more talent than I <a href="http://www.therailsway.com/2006/12/8/idiomatic-ruby">have already written about this</a>.<br />
<code>/app/controllers/users_controller.rb</code></p>
<pre>class UsersController < ApplicationController
  def create
    @user = User.new(params[:user])
    if @user.save
      flash[:notice] = "Account registered!"
      redirect_back_or_default account_url
    else
      render :action => :new
    end
  end
end</pre>
<p><code>/app/models/user.rb</code></p>
<pre>class User &lt; ActiveRecord::Base
  has_one :card

  after_create :create_card

  protected
    def create_card
      Card.create :user_id =&gt; id, :title =&gt; "Visit card of #{login}"
    end
end</pre>
<p>But there&#8217;s even a better solution because having card creation code in the user controller doesn&#8217;t make much sense. Here is where <code>observers</code> come, &#8220;a great way to reduce the clutter that normally comes when the model class is burdened with functionality that doesn‘t pertain to the core responsibility of the class&#8221; as once again <a href="http://api.rubyonrails.org/classes/ActiveRecord/Observer.html">the documentation</a> says. There&#8217;s also a <a href="http://blog.negonation.com/es/gestion-de-eventos-en-rails-observers/">very good article about this</a> in Spanish. So we have to move the card creation to an user <code>Observer</code>, that handles it everytime an user is registered.<br />
<code>/app/models/user.rb</code></p>
<pre>class User &lt; ActiveRecord::Base
  has_one :card
end</pre>
<p><code>/app/controllers/user_observer.rb</code></p>
<pre>class UserObserver &lt; ActiveRecord::Observer
  def after_create(user)
    Card.create :user_id =&gt; user.id, :title =&gt; "Visit card of #{user.login}"
  end
end</pre>
<p>This is &#8220;the rails way&#8221;, <strong>Skinny Model Skinny Controller</strong>.</p>
<p>Finally I want to give thanks to the <a href="http://lists.simplelogica.net/mailman/listinfo/ror-es">ror-es mailing list</a> I signed up <a href="http://c.matallin.com/2009/04/90s-are-comming-back/">recently</a>. I had the luck to work with some of the better rails developers in my past projects and now I have discovered that not only they were great but also the vast majority behind Ruby on Rails community is awesome. Thank you guys.</p>
<p><strong>Update:</strong> I was using the restful_authentication plugin in order to manage the users authentication in the app, but as the comments say this is not the best solution. I have updated the code in order to handle this with the authlogic plugin, which is much better.</p>
]]></content:encoded>
			<wfw:commentRss>http://c.matallin.com/2009/04/the-rails-way/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Jack keane: Al rescate del Imperio Británico</title>
		<link>http://c.matallin.com/2008/06/jack-keane-al-rescate-del-imperio-britanico/</link>
		<comments>http://c.matallin.com/2008/06/jack-keane-al-rescate-del-imperio-britanico/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 20:30:51 +0000</pubDate>
		<dc:creator>Carlos Matallín</dc:creator>
				<category><![CDATA[Ones and Zeros]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Bloguzz]]></category>
		<category><![CDATA[Jack Keane]]></category>
		<category><![CDATA[Videogames]]></category>

		<guid isPermaLink="false">http://c.matallin.com/?p=226</guid>
		<description><![CDATA[I know that I&#8217;ve been kind of missing for some time but I have had some issues that kept me away from the computer. Don&#8217;t worry, you will be informed soon.
One of the pending tasks I had remaining was the review of Jack keane: Al rescate del Imperio Británico, a video game that Bloguzz (I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="lightbox" href="http://c.matallin.com/wp-content/uploads/jack-keane-portada.jpg"><img class="alignright size-medium wp-image-363" title="Jack Keane Portada" src="http://c.matallin.com/wp-content/uploads/jack-keane-portada-283x405.jpg" alt="" width="255" height="365" /></a>I know that I&#8217;ve been kind of missing for some time but I have had some issues that kept me away from the computer. Don&#8217;t worry, you will be informed soon.</p>
<p>One of the pending tasks I had remaining was the review of <strong>Jack keane: Al rescate del Imperio Británico</strong>, a video game that <a href="http://www.bloguzz.com">Bloguzz</a> (I&#8217;ve already told you that I love these people?) had kindly handed over me. This video game has been developed by <a href="http://www.deck13.com/">Deck13</a> and <a href="http://www.10tacle.com">10tacle Studios</a> and distributed by <a href="http://www.fxinteractive.com/">FX Interactive</a>.</p>
<p>I really enjoyed playing this video game (as the staunch fan of graphic adventures that I am); it reminds me the time I used to play <strong>Day of the tentacle</strong> or <strong>Monkey Island</strong>. In fact, I think I won&#8217;t be wrong if I claim that it was deeply inspired in this <strong>LucasArts </strong>saga.</p>
<p><span id="more-226"></span></p>
<p>So, let&#8217;s get it on. The pack comes with the installation/play CD and a very useful handbook that may help you to solve any problem you may encounter during the initial contact. The first thing in order to play is  install the game, which was rather slow. However a new system called <strong>WannaPlay</strong> let me watch some explanatory videos during the installation. Anyway it&#8217;s possible to skip them and turn to the handbook in any case if needed. Once it is installed and the game settings (screen resolution, effects, music and such&#8230;) are configured we are ready to have a great time.</p>
<p style="text-align: center;"><a rel="lightbox" href="http://c.matallin.com/wp-content/uploads/jack-keane-ciudad-del-cabo.jpg"><img class="aligncenter size-medium wp-image-365" title="Jack Keane Ciudad Del Cabo" src="http://c.matallin.com/wp-content/uploads/jack-keane-ciudad-del-cabo-500x375.jpg" alt="" width="500" height="375" /></a></p>
<p>Something I specially liked was the fact that the game started with a quite short and easy first level where you can get used to the controls, actions and response of the character. After this we&#8217;ll have hours of entertainment ahead.</p>
<p>The  plot deals with <strong>Jack Keane</strong>, an intrepid (and a bit unlucky) captain. He is in a secret mission under the orders of the Queen of England who lead his ship to a very mysterious island. Although at first it may seem quite simple and linear, then the plot thickens in a sudden turn of fate, unveiling a very interesting story full of intrigue. Furthermore the witty dialogues, and the numerous references (like the famous &#8220;<a href="http://youtube.com/watch?v=VBGHer3yFyc"><em>Por qué no te callas</em></a>&#8221; or the Indiana Jones quote &#8220;<em>I don&#8217;t like snakes</em>&#8220;) make it very entertaining and funny.</p>
<p style="text-align: center;"><a rel="lightbox" href="http://c.matallin.com/wp-content/uploads/jack-keane-barco.jpg"><img class="aligncenter size-medium wp-image-364" title="Jack Keane Barco" src="http://c.matallin.com/wp-content/uploads/jack-keane-barco-500x375.jpg" alt="" width="500" height="375" /></a></p>
<p>Regarding the graphics it should be noted that a very good work has been done by the developers of the game. A great use of colors, shapes, textures and 3D modeling in general contributes to a pleasant gaming experience, with beautiful landscapes and vivid characters.</p>
<p>Besides all this, another thing that I also find it interesting are the resources that we can find in the <a href="http://www.fxinteractive.com/p180/p180.htm">FX Interactive</a> website. There we can take a look at the guide, which only has some available episodes right now or view the promotional trailer, that I reproduce here.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="src" value="http://www.youtube.com/v/ePqclEd1is0&amp;hl=en&amp;fs=1&amp;color1=0xe1600f&amp;color2=0xfebd01" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/ePqclEd1is0&amp;hl=en&amp;fs=1&amp;color1=0xe1600f&amp;color2=0xfebd01" allowfullscreen="true"></embed></object></p>
<p>Summing up; take Indiana Jones, Guybrush Treepwood (from Monkey Island) and a 3D videogame, mix it up and you will get <strong>Jack keane: Al rescate del Imperio Británico</strong>.</p>
<p>In my opinion a very good game which deserves <strong>4 stars out of 5</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://c.matallin.com/2008/06/jack-keane-al-rescate-del-imperio-britanico/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
