<?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>Bernat Farrero</title>
	<atom:link href="http://bernatfarrero.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bernatfarrero.com</link>
	<description>Personal Blog</description>
	<lastBuildDate>Tue, 17 Sep 2013 23:30:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.3.1</generator>
	<item>
		<title>The art of living under pressure</title>
		<link>http://bernatfarrero.com/under-pressure/</link>
		<comments>http://bernatfarrero.com/under-pressure/#comments</comments>
		<pubDate>Tue, 17 Sep 2013 21:20:46 +0000</pubDate>
		<dc:creator><![CDATA[bernat]]></dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://bernatfarrero.com/?p=605</guid>
		<description><![CDATA[One of skills most difficult to detect on people and probably least appreciated by recruiters or investors is people&#8217;s ability to stand pressure or extreme tension. The more I feel it myself, the more I realize how completely indispensable is this skill for entrepreneurs or managers. Indeed, standing it isn&#8217;t just enough, the tricky part [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>One of skills most difficult to detect on people and probably least appreciated by recruiters or investors is people&#8217;s ability to stand pressure or extreme tension. The more I feel it myself, the more I realize how completely indispensable is this skill for entrepreneurs or managers. Indeed, standing it isn&#8217;t just enough, the tricky part is not propagating it to others and persevering on whatever you think will definitely fix it.</p>
<p>On startups pressure manifests itself in lots of ways: cashflow rollercoasters, negative market metrics, failing to meet deadlines, difficulty to find good people to work with, team disagreements, board discussions, investor pressure, etc.</p>
<p>Most of this problems are solved by two main actions:</p>
<p>1. Control communication, do not reveal anxiety or caos, keep your cards for you.<br />
2. Make a fast decision whether to persevere with all your strengths or decisively implement a radical change.</p>
<p>By the time, dealing with extreme tension makes one develop patience, tolerance, diplomacy, self-cheering, optimism and, most specially, means learning to be self-satisfied by your work, not requiring others neither to save your ass nor to recognize your efforts. Unfortunately, for a lot of people it means lots of trouble in their personal life too&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://bernatfarrero.com/under-pressure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Expanding your startup internationally by Richard Moross</title>
		<link>http://bernatfarrero.com/expanding-your-startup-internationally/</link>
		<comments>http://bernatfarrero.com/expanding-your-startup-internationally/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 00:21:46 +0000</pubDate>
		<dc:creator><![CDATA[bernat]]></dc:creator>
				<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://bernatfarrero.com/?p=590</guid>
		<description><![CDATA[I find specially interesting the case of Richard Moross and MOO.com. They started out by partnering flickr, which made them global right from the early days. At the time, they were sending their fancy boxes and business cards everywhere in the world from their headquarters in London. After some time, they had gathered enough data [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><iframe width="100%" height="300px" src="http://www.youtube.com/embed/CcgG_R26SJs" frameborder="0" allowfullscreen></iframe></p>
<p>I find specially interesting the case of Richard Moross and MOO.com. They started out by partnering flickr, which made them global right from the early days. At the time, they were sending their fancy boxes and business cards everywhere in the world from their headquarters in London. After some time, they had gathered enough data to analyse what countries were showing greater traction. That seems to me a very Lean approach to internationalization taken by Moross. From their business model perspective, their strong focus on developing key partnerships initially and using their $5M VC money to give away <a href="http://uk.moo.com/partner/freepack/" title="convert flickr pictures into moo cards">freebies</a> in exchange for critical mass proved to be a successful strategy.</p>
<p>The top 1 country was, indeed, the USA. So, after two years, they established there they second base of operations, at Rhode Island. Today MOO.com is one of the 10 best companies in UK according to the Guardian Newspaper and they have almost a hundred employees.</p>
]]></content:encoded>
			<wfw:commentRss>http://bernatfarrero.com/expanding-your-startup-internationally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Business and hackers</title>
		<link>http://bernatfarrero.com/business-and-hackers/</link>
		<comments>http://bernatfarrero.com/business-and-hackers/#comments</comments>
		<pubDate>Wed, 20 Feb 2013 01:46:54 +0000</pubDate>
		<dc:creator><![CDATA[bernat]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bernatfarrero.com/?p=478</guid>
		<description><![CDATA[Two interesting concepts taken from an interview to Paul Graham in 2005: [talking about types of founders] The big difference between hackers and business guys, at least in the beginning, is that what you need is hackers and not business guys. When you are young, you finished school, it is the best time to invest. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Two interesting concepts taken from an interview to Paul Graham in 2005:</p>
<blockquote><p>[talking about types of founders] The big difference between hackers and business guys, at least in the beginning, is that what you need is hackers and not business guys.</p>
<p>When you are young, you finished school, it is the best time to invest. There&#8217;s time to cash in later. Do something hard, take a work where you can learn, start a business. Don&#8217;t satisfy yourself by doing something you know you can do.</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://bernatfarrero.com/business-and-hackers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In place editing with Javascript, jQuery and Rails 3</title>
		<link>http://bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/</link>
		<comments>http://bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 22:09:12 +0000</pubDate>
		<dc:creator><![CDATA[bernat]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[in-place-edit]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[rails 3]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://blog.bernatfarrero.com/?p=469</guid>
		<description><![CDATA[In the project I&#8217;m working on I had to create a script that would allow users to update their information directly from their (show) views. From a general perspective, I think it is useful to give users the option to edit-in-place contents by just clicking them, leaving forms for when there is no other alternative [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In the project I&#8217;m working on I had to create a script that would allow users to update their information directly from their (show) views.<br />
From a general perspective, I think it is useful to give users the option to edit-in-place contents by just clicking them, leaving forms for when there is no other alternative (such as creating new objects). To me, an in-place editor feels more natural and usable and helps notably the user experience. The obvious fact is that most real world applications, such as Flickr or Facebox have implemented this feature in most of their interfaces.</p>
<p>To do that, I wanted to think of a general solution, one that could be applied to my other projects. Even a framework agnostic solution. I decided I would write it completely in Javascript and communicate with the server in a conventional RESTful way. Doing a bit of research before starting out, I ran across the project of Jan Varwig called <a href="https://github.com/janv/rest_in_place">Rest In Place</a> which did precisely the same thing. So I examined carefully his code, fixed some stuff and extended it to support all usage cases I wanted to cover, this is how <b>BestInPlace</b> is born.</p>
<p>Basically, BestInPlace makes possible to tag (via HTML classes and HTML5 data* attributes) any field that is going to be user-editable so that the script automatically converts it to an form input when the user clicks on it, with no further muss or fuss for the developer.  Of course, this field can take the form of a one-line text input, a textarea for longer texts, a select dropdown that will populate with your custom collection of options or boolean sort of data that works the same way a checkbox would, and allows value customization as well. Additionally, the script will trim and sanitize all user input, display server errors in case the format is not proper, it will also allow you to provide an external handler to activate the input.</p>
<p>Before getting into details.</p>
<p style="text-align: center;"><b><a href="http://bipapp.heroku.com/">SEE THE DEMO</a> | <a href="https://github.com/bernat/best_in_place">SEE THE CODE</a></b></p>
<p><span id="more-469"></span></p>
<h2>Installation</h2>
<p>Simply copy and load the files from the folder the following JS files in your application (in the same order):</p>
<ul>
<li><a href="http://docs.jquery.com/Downloading_jQuery">jquery-1.4.2.js</a></li>
<li><a href="https://github.com/bernat/best_in_place/raw/master/public/javascripts/jquery.purr.js">jquery.purr.js</a></li>
<li><a href="https://github.com/bernat/best_in_place/raw/master/public/javascripts/best_in_place.js"><b>best_in_place.js</b></a></li>
</ul>
<p>Add the following line to your onLoad block:</p><pre class="crayon-plain-tag">$(document).ready(function() {
/* Activating Best In Place */
jQuery(&quot;.best_in_place&quot;).best_in_place()
});</pre><p></p>
<h3>Installation of the Rails 3 Gem</h3>
<p>Only add the folloging line to your application&#8217;s Gemfile and run <em>bundle install</em>:</p><pre class="crayon-plain-tag">gem &quot;best_in_place&quot;</pre><p>You still need to load the onLoad block, jQuery.js and jquery.purr.js in your application, but you can use the generator to copy (and update when necessary) the best_in_place.js script:</p><pre class="crayon-plain-tag">rails g best_in_place:setup</pre><p></p>
<h2>Usage</h2>
<p>First of all, you should write your controllers in a RESTful way and make sure they respond properly to a json request. Here you can see an example of how a standard update action should look like in a Rails app:</p><pre class="crayon-plain-tag">def update
    @user = User.find(params[:id])

    respond_to do |format|
      if @user.update_attributes(params[:user])
        format.html { redirect_to(@user, :notice =&gt; 'User was successfully updated.') }
        format.json { head :ok }
      else
        format.html { render :action =&gt; &quot;edit&quot; }
        format.json { respond_with_bip(@user) }
      end
    end
  end</pre><p>At the same time, if you want to perform server-side validations so that errors are displayed when users introduce invalid data, then the models should look something like this:</p><pre class="crayon-plain-tag">class User &lt; ActiveRecord::Base
      validates :name,
        :length =&gt; { :minimum =&gt; 2, :maximum =&gt; 24, :message =&gt; &quot;has invalid length&quot;},
        :presence =&gt; {:message =&gt; &quot;can't be blank&quot;}
      validates :last_name,
        :length =&gt; { :minimum =&gt; 2, :maximum =&gt; 24, :message =&gt; &quot;has invalid length&quot;},
        :presence =&gt; {:message =&gt; &quot;can't be blank&quot;}
      validates :address,
        :length =&gt; { :minimum =&gt; 5, :message =&gt; &quot;too short length&quot;},
        :presence =&gt; {:message =&gt; &quot;can't be blank&quot;}
      validates :email,
        :presence =&gt; {:message =&gt; &quot;can't be blank&quot;},
        :format =&gt; {:with =&gt; /^([^@s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})$/i,
                                :message =&gt; &quot;has wrong email format&quot;}
      validates :zip, :numericality =&gt; true, :length =&gt; { :minimum =&gt; 5 }
    end</pre><p>Now all defined messages will be shown to the user if he introduces invalid data and the field will remain unchanged. Notice that messages will be displayed in a jquery.purr pop up. Take time to style it the way you prefer.</p>
<h3>Options / Parameters</h3>
<p>Best in Place will be wrapped into an html object (<span style="text-decoration: underline;">div/span</span> preferred) with the following attributes:</p>
<ul>
<li>class = &#8220;best_in_place&#8221;</li>
<li>data-url = Object Path</li>
<li>data-object = Object name</li>
<li>data-attribute = Object field</li>
<li>data-type = &#8220;input&#8221;, &#8220;textarea&#8221;, &#8220;select&#8221;, &#8220;checkbox&#8221; (defaults to input)</li>
<li>data-collection = &#8220;[[key, &#8216;value&#8217;], [key, &#8216;value&#8217;],&#8230;]&#8221; (a structured JSON containing all possible values in the collection in case of the select or a couple of values in case of a checkbox [&#8220;falsevalue&#8221;, &#8220;truevalue&#8221;].</li>
<li>data-activator = &#8220;#DOM-OBJECT&#8221;.Dom object that will convert the text into an input. In case it is not specified it will work by clicking on the text.</li>
</ul>
<p>Beware: All attributes are assigned underscore strings.</p>
<p style="font-weight: normal;">If you are using the <b>Rails 3 Gem</b>, you only need to tag user in-place editable fields like this:</p>
<h4>best_in_place object, field, OPTIONS</h4>
<h5>Params:</h5>
<ul>
<li><b>object</b> (Mandatory): The Object parameter represents the object itself you are about to modify</li>
<li><b>field</b> (Mandatory): The field (passed as symbol) is the attribute of the Object you are going to display/edit.</li>
</ul>
<h5>Options:</h5>
<ul>
<li>:<b>type</b> It can be only [:input, :textarea, :select, :checkbox] or if undefined it defaults to :input.</li>
<li>:<b>collection</b>: In case you are using the :select type then you must specify the collection of values it takes. In case you are using the :checkbox type you can specify the two values it can take, or otherwise they will default to Yes and No.</li>
<li>:<b>path</b>: URL to which the updating action will be sent. If not defined it defaults to the :object path.</li>
<li>:<b>nil</b>: The nil param defines the content displayed in case no value is defined for that field. It can be something like &#8220;click me to edit&#8221;. If not defined it will show &#8220;-&#8220;.</li>
<li>:<b>activator</b>: Is the DOM object that can activate the field. If not defined the user will making editable by clicking on it.</li>
<li>:<b>sanitize</b>: True by default. If set to false it will allow users to introduce html tags to the input/textarea.</li>
</ul>
<p style="font-weight: bold;"><span style="font-weight: normal;">Let&#8217;s  see now how to create user-editable fields by some examples. We&#8217;ll use a generic User show action, as I did in the <a href="https://github.com/bernat/best_in_place/tree/master/test_app">Test Application</a>.</span></p>
<h3>Inputs</h3>
<p>In regular HTML:</p><pre class="crayon-plain-tag">&lt;span class='best_in_place' id='best_in_place_user_name' data-url='/users/4' data-object='user'
data-attribute='name' data-type='input'&gt;Dominic&lt;/span&gt;</pre><p>Using the Rails 3 gem:</p><pre class="crayon-plain-tag">&lt;%= best_in_place @user, :name, :type =&gt; :input %&gt;
&lt;%= best_in_place @user, :name, :type =&gt; :input, :nil =&gt; &quot;Click me to add content!&quot; %&gt;
&lt;%= best_in_place @user, :name, :activator =&gt; &quot;#activator&quot; %&gt;</pre><p></p>
<h3>Textarea</h3>
<p>In regular HTML:</p><pre class="crayon-plain-tag">&lt;span class='best_in_place' id='best_in_place_user_description' data-url='/users/4'
data-object='user'data-attribute='description' data-type='textarea'&gt;
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a lectus et lacus
ultrices auctor. Morbi aliquet convallis tincidunt. Praesent enim libero, iaculis at
commodo nec, fermentum a dolor. Quisque eget eros id felis lacinia faucibus feugiat et ante.
&lt;/span&gt;</pre><p>Using the Rails 3 gem:</p><pre class="crayon-plain-tag">&lt;%= best_in_place @user, :description, :type =&gt; :textarea %&gt;</pre><p>Allowing html tags:</p><pre class="crayon-plain-tag">&lt;%= best_in_place @user, :description, :type =&gt; :textarea, :sanitize =&gt; false %&gt;</pre><p></p>
<h3>Select dropdowns</h3>
<p>In regular HTML:</p><pre class="crayon-plain-tag">&lt;span class='best_in_place' id='best_in_place_user_country' data-url='/users/4'
data-object='user' data-collection='[[1,&quot;Spain&quot;],[2,&quot;Italy&quot;],[3,&quot;Germany&quot;],[4,&quot;France&quot;]]'
data-attribute='country' data-type='select'&gt;Germany&lt;/span&gt;</pre><p>Using the Rails 3 gem:</p><pre class="crayon-plain-tag">&lt;%= best_in_place @user, :country, :type =&gt; :select, :collection =&gt; [[1, &quot;Spain&quot;], [2, &quot;Italy&quot;],
[3, &quot;Germany&quot;], [4, &quot;France&quot;]] %&gt;</pre><p></p>
<h3>Checkbox values</h3>
<p>In regular HTML:</p><pre class="crayon-plain-tag">&lt;span class='best_in_place' id='best_in_place_user_receive_email' data-url='/users/4'
data-object='user' data-collection='[&quot;No thanks&quot;,&quot;Yes of course&quot;]'
data-attribute='receive_email' data-type='checkbox'
&gt;Yes of course&lt;/span&gt;</pre><p>Using the Rails 3 gem:</p><pre class="crayon-plain-tag">&lt;%= best_in_place @user, :receive_emails, :type =&gt; :checkbox, :collection =&gt; [&quot;No, thanks&quot;, &quot;Yes, of course!&quot;] %&gt;</pre><p></p>
<h2>Wrapping up</h2>
<p>Best In Place will make easier your application interfaces by letting users modify in-line every content. At the same time, it will control user input and display errors. Let me know if there&#8217;s something you would do different or don&#8217;t hesitate to give me a pull request if you contribute anyhow.</p>
]]></content:encoded>
			<wfw:commentRss>http://bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>How I manage the WordPress theme with Git</title>
		<link>http://bernatfarrero.com/how-t-manage-the-wordpress-theme-with-git/</link>
		<comments>http://bernatfarrero.com/how-t-manage-the-wordpress-theme-with-git/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 00:05:29 +0000</pubDate>
		<dc:creator><![CDATA[bernat]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[two remote repositories]]></category>
		<category><![CDATA[wordpres github]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress theme]]></category>

		<guid isPermaLink="false">http://blog.bernatfarrero.com/?p=431</guid>
		<description><![CDATA[I thought it might help somebody the way I&#8217;m currently managing my WordPress theme. First of all, I have to say it would be better to have an actual WordPress installation in my localhost, so it would be easier trying out changes (on themes and plugins) before committing them. I&#8217;m just too lazy for that, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I thought it might help somebody the way I&#8217;m currently managing my WordPress theme. First of all, I have to say it would be better to have an actual WordPress installation in my localhost, so it would be easier trying out changes (on themes and plugins) before committing them. I&#8217;m just too lazy for that, so I&#8217;d rather have only one running installation of WordPress on my server and a moving git repository for the theme alone. So this is how I do:</p>
<p>1. I have a Github public repository to share my theme (not like anyone is interested anyway)<br />
2. I have another private repository in my server to store all the changes of the theme and actually update it.<br />
3. I have a local repository in my computer for the theme.<br />
4. The theme is actually stored at <em>my_server_root</em>/<em>my_wordpress_path</em>/wp-content/themes/bernatfarrero/</p>
<p><span id="more-431"></span></p>
<p>Let&#8217;s start out creating the local repository in <strong>your local computer</strong>:</p><pre class="crayon-plain-tag">mkdir bftheme &amp;amp;&amp;amp; cd bftheme
scp -r my_server_root/my_wordpress_path/wp-content/themes/bftheme .
git init #We initialize the local repository
git commit -a -m &quot;Initial commit&quot; # And we make the first commit</pre><p>We&#8217;ve just made a local copy of our theme and we&#8217;ve set up a local Git repository. Now let&#8217;s synchronize it with our server&#8217;s repository. In my server I have a special directory for all my repositories called repo. So, now I have to login via ssh <strong>to my server</strong> and do the following:</p><pre class="crayon-plain-tag">cd my_server_root/repo #this is were I store my repositories
mkdir bftheme.git &amp;amp;&amp;amp; cd bftheme.git
git init --bare
git config core.worktree my_server_root/my_wordpress_path/wp-content/themes/bftheme
git config core.bare false
git config receive.denycurrentbranch ignore
vim hooks/post-receive #Open this file with your favorite editor and write inside it:

#!/bin/sh
git checkout -f

#Save it and close it
chmod +x hooks/post-receive #Give it running permissions</pre><p>The <em>denycurrentbranch</em> set to ignore (or warn) basically makes the server not complain for having uncommitted changes on the remote repository. Even so, as we only want it to mirror our local changes, we don&#8217;t care. We&#8217;ve set the post-receive hook so it resets our repository to the latest changes received by our last push. Now <strong>in our local computer</strong>, we have to tell our repository who will be the remote:</p><pre class="crayon-plain-tag">git remote add origin username@host.com:repo/bftheme.git
git push origin master</pre><p>And that&#8217;s it. We&#8217;ve established the connection between our local repository and the actual changes made public in our blog. In order to deploy your changes just do:</p><pre class="crayon-plain-tag">git push</pre><p>And you should see them right away. If you do not, there will be some problem with the paths, or make sure you don&#8217;t have any caching plugin (like <em>Super Cache</em>) activated at the moment. If you are like me and want to push every now and then the changes to Github, you can do (in your local computer):</p><pre class="crayon-plain-tag">git remote add public git@github.com:bernat/blog.bernatfarrero.git #In my case
git push public master</pre><p>You can do that every once in a while. In case you don&#8217;t want to push all commits to Github because you are shy to show a zillion of irrellevant changes, what you can do is set the Github repository as origin and the other as, say, deploy. Every 10 commits or so, you can do (in your local computer):</p><pre class="crayon-plain-tag">git rebase -i master~10

pick A
pick B
pick C
pick D</pre><p>replace all the pick by squash (except for the first one) and then give it a nice message name. This way you assemble one big commit with the changes of your last ten commits. Then, to push it to Github, you can do:</p><pre class="crayon-plain-tag">git push origin master #In case you set Github remote as origin</pre><p>This way you will push a bigger and more controlled set of changes to Github and only after a while. In the meantime, to see your changes in your actual blog you would just go</p><pre class="crayon-plain-tag">git push deploy master</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://bernatfarrero.com/how-t-manage-the-wordpress-theme-with-git/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Thunderbird crashing on start up</title>
		<link>http://bernatfarrero.com/thunderbird-crash-on-start-up/</link>
		<comments>http://bernatfarrero.com/thunderbird-crash-on-start-up/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 11:03:20 +0000</pubDate>
		<dc:creator><![CDATA[bernat]]></dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[mozilla thunderbird bug]]></category>
		<category><![CDATA[thunderbird crash]]></category>

		<guid isPermaLink="false">http://blog.bernatfarrero.com/?p=394</guid>
		<description><![CDATA[Thunderbird has always been my favourite email reading program, though lately it seems like every time I upgrade to its new version something bad happens. This time the program would not start anymore. The icon shook for a while, the white light lingered some seconds, and then it faded away. Even if I rebooted my [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Thunderbird has always been my favourite email reading program, though lately it seems like every time I upgrade to its new version something bad happens. This time the program would not start anymore. The icon shook for a while, the white light lingered some seconds, and then it faded away. Even if I rebooted my computer it wouldn&#8217;t work, neither would if I regenerated the preferences file ~/Library/Preferences/org.mozilla.thunderbird.plist.</p>
<p>This is how I fixed it, in case it is useful to someone else. I&#8217;m running MacOS Snow Leopard 10.6.4 on a Macbook Pro:</p>
<p>First I created another profile for Thunderbird. The profile manager is launched by this command [you must type this in your terminal]:</p><pre class="crayon-plain-tag">/Applications/Thunderbird.app/Contents/MacOS/thunderbird-bin -profilemanager</pre><p>Now starting with the other profile it worked just fine, so I figured it must have been something on my profile that got corrupted in the upgrading process. What I did next was to copy all the files in my old profile folder to the new one. Remember that the profiles are stored in the folder <strong>~/Library/Thunderbird/Profiles/ </strong>[the ~means the home directory]. In this process I realised what was the problem: the file <strong>compreg.dat</strong>.</p>
<p>Usually this file regenerates itself with the new configuration, but for some reason this time did not. So all I did to fix the problem was to replace this file for the new one of the new profile. And that was it, it worked again! You can also copy all your folders and files of the old profile to the new one except for this single file. Be aware to make backups of the folders before trying anything, or you will loose all your mail data.</p>
]]></content:encoded>
			<wfw:commentRss>http://bernatfarrero.com/thunderbird-crash-on-start-up/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Semàntic Podcast</title>
		<link>http://bernatfarrero.com/semantic-podcast/</link>
		<comments>http://bernatfarrero.com/semantic-podcast/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 21:56:49 +0000</pubDate>
		<dc:creator><![CDATA[bernat]]></dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[catalan podcast]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[it news]]></category>
		<category><![CDATA[semàntic podcast]]></category>

		<guid isPermaLink="false">http://blog.bernatfarrero.com/?p=333</guid>
		<description><![CDATA[I haven&#8217;t been particularly active recently, I&#8217;m actually preparing myself for the last exams I (might) ever do in my university. Tough stuff! Nonetheless, I&#8217;ll be back on (working, learning and posting) next month! In the meantime, I&#8217;d like to present the new podcast in which I happen to participate. It is called Semàntic. Unfortunately for [&#8230;]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">I haven&#8217;t been particularly active recently, I&#8217;m actually preparing myself for the last exams I (might) ever do in my university. Tough stuff! Nonetheless, I&#8217;ll be back on (working, learning and posting) next month! In the meantime, I&#8217;d like to present the new podcast in which I happen to participate. It is called <strong>Semàntic</strong>. Unfortunately for the English reader, it&#8217;s only in <a href="http://en.wikipedia.org/wiki/Catalan_language">Catalan</a> (my native language) and can be found in <a href="http://semantic.cat">http://semantic.cat</a>.</p>
<p style="text-align: justify;">I had the idea of creating this podcast after being repeatedly disappointed by the little choice of podcasting we have in Catalunya. I&#8217;m kind of addicted to many American and British podcasts and I always thought I&#8217;d like to have some of those in my own language&#8230; so what the hell, I talked with some colleagues, Jordi and Masumi, and they (surprisingly) found the idea interesting, so that&#8217;s how Semàntic was born, in our uni&#8217;s bar. We&#8217;ve only recorded 4 episodes but it has already shown some success. People in and out of our university is subscribed and follows our episodes. We got our feet wet quite unprofessionally, but we&#8217;re improving over time, and we hope to do a lot more!</p>
<p style="text-align: justify;">Of course, we have a<a href="http://guides.rails.info/3_0_release_notes.html"> Rails3</a> website, a <a href="http://www.sinatrarb.com/">Sinatra</a> Wiki (ingeniously built by <a href="http://jrom.net">Jordi</a>), we coordinate ourselves through <a href="http://talkerapp.com/">Talke</a>r and record with the help of some <a href="http://www.amazon.com/Samson-Mic-Compact-USB-Microphone/dp/B001R76D42">Samson unexpensive condenser microphones</a>.  So if you&#8217;re interested in technology and computer science, and you understand Catalan of course, don&#8217;t hesitate to <a href="http://itunes.apple.com/podcast/id374246709">subscribe to Semàntic Podcast</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://bernatfarrero.com/semantic-podcast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple&#8217;s autosaving software</title>
		<link>http://bernatfarrero.com/garageband-lost-file/</link>
		<comments>http://bernatfarrero.com/garageband-lost-file/#comments</comments>
		<pubDate>Mon, 31 May 2010 08:38:43 +0000</pubDate>
		<dc:creator><![CDATA[bernat]]></dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[apple software policy]]></category>
		<category><![CDATA[garage band lost file]]></category>
		<category><![CDATA[imovie lost project]]></category>

		<guid isPermaLink="false">http://blog.bernatfarrero.com/?p=325</guid>
		<description><![CDATA[One of the things I hate the most on software makers is when they treat all users as if they were dumb. This is the case of Apple software. Every time I use iMovie to make a recording I spend some time worrying about where the actual stuff is stored at every point. The program [&#8230;]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">One of the things I hate the most on software makers is when they treat all users as if they were dumb. This is the case of Apple software. Every time I use iMovie to make a recording I spend some time worrying about where the actual stuff is stored at every point. The program is supposed to be so &#8220;smart&#8221; that duplicates your videos to the local iMovie library and then it saves the project and your modifications automatically, &#8220;magically&#8221;. Theoretically without you having to worry about it whatsoever and only having to wow at every new beautiful feature you come across. However, the opposite is true, and factual evidence is easily noticed when searching for &#8220;imovie lost project&#8221; in Google and finding tons of frustrated folks (i.e: <a href="http://forums.macrumors.com/showthread.php?t=425551">this is one</a>, <a href="http://www.mac-forums.com/forums/movies-video/189337-helppppp-lost-imovie-project.html">this is another</a>, <a href="http://www.mac-forums.com/forums/os-x-applications-games/170416-imovie-09-all-projects-lost.html">and yet another</a>, &#8230;).</p>
<p style="text-align: justify;">Same stuff happens with GarageBand. Today we recorded a 40minutes podcast episode with GB and when we were done, happy and satisfied with the episode, preparing stuff to get back home, we happened to go &#8220;Save as&#8221; and, wow, all the &#8220;magic behind the scenes&#8221; of Apple slapped in our faces and the .aif file of the recording got deleted forever. Now, if there&#8217;s any notion any software engineering or user experience engineer should ever have clear from the start is interface metaphors are meant to be accurate. That is, when a user click &#8220;Save&#8221;, she is probably not looking forward to delete the whole damn thing. <a href="http://discussions.apple.com/thread.jspa?threadID=2287431&amp;tstart=0&amp;start=30">Have a look at the endless thread for this problem at Apple&#8217;s Garageband forum</a>.</p>
<p style="text-align: justify;">But it all comes from the same principle of Apple, the principle of they controlling everything and users just wowing at the company&#8217;s wonders and playing their sheep role, doing baby-like limited options and sticking to them forever. We developers are given a couple of more options and a thousand of more rules to follow but that&#8217;s it. This is <a href="http://techcrunch.com/2010/05/15/steve-jobs-spars-with-gawker-blogger-over-revolutions-freedom-and-porn/">Steve Job&#8217;s concept of freedom</a>.</p>
<p style="text-align: justify;">Well, it turns out I don&#8217;t need anyone to manage my work, I want to write my software and give it, or sell it the way I want. I want to use programs and save the stuff when and where I feel like. I&#8217;d rather stick to my old-looking but reliable interfaces.</p>
]]></content:encoded>
			<wfw:commentRss>http://bernatfarrero.com/garageband-lost-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t use Mozy!</title>
		<link>http://bernatfarrero.com/dont-use-mozy/</link>
		<comments>http://bernatfarrero.com/dont-use-mozy/#comments</comments>
		<pubDate>Sat, 22 May 2010 19:16:39 +0000</pubDate>
		<dc:creator><![CDATA[bernat]]></dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[mozy problems]]></category>
		<category><![CDATA[online backup]]></category>

		<guid isPermaLink="false">http://blog.bernatfarrero.com/?p=317</guid>
		<description><![CDATA[Are you looking for an onlike backup system for your Mac computer? Well, let me give you a piece of advise: do not use Mozy! Yesterday I sent this email to their customer service after fighting for a week with their program and their support FAQ. Dear Madame/Sir I subscribed to your service of online [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Are you looking for an onlike backup system for your Mac computer? Well, let me give you a piece of advise: do not use Mozy! Yesterday I sent this email to their customer service after fighting for a week with their program and their support FAQ.</p>
<blockquote><p><span style="font-family: Verdana;"> </span></p>
<div id="_mcePaste">
<div id="_mcePaste">Dear Madame/Sir</div>
<div id="_mcePaste">I subscribed to your service of online backup approximately one week from now and since then I haven&#8217;t been able to perform a single backup yet. I have to say that the program you offer for MacOS is one of the worst pieces of software I&#8217;ve dealt with recently. It is not usable and it is not smart. It is painfully obtrusive, it slows down my computer, it eats up more than 9Gb of space from my disk leaving my system out of temporal and virtual memory. And it offers almost no options for customization&#8230; Instead of dealing with the files to backup in small quantities, and according to the bandwidth and the ability to send them to your servers, it tries to deal with them all from the start, encrypting the full stack and leaving the computer utterly KO.</div>
<div id="_mcePaste">I&#8217;ve used other online backup services before (such as Dropxbox), and they offer software way more efficient and smart for dealing with backups. Coming from EMC I thought Mozy would be trustworthy, it turns out I was wrong. I request the cancellation of my account and the refund of my payment. I hope that at least customer service proves satisfactory.</div>
<div id="_mcePaste">Yours faithfully,</div>
<div id="_mcePaste">Bernat Farrero.-</div>
</div>
</blockquote>
<p>The answer to this was: Go to your panel, complete the questionnaire and cancel your account. No word about the refund. So don&#8217;t be misled by their low prices, it will make you waste your time and money.</p>
<p><strong>Update</strong>: At the end, two weeks later, I did receive the refund. I lost 1,10€ in the transaction, but I&#8217;m satisfied enough =)</p>
]]></content:encoded>
			<wfw:commentRss>http://bernatfarrero.com/dont-use-mozy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://blog.bernatfarrero.com/audio/dont_use_mozy.mp3" length="audio/mpeg" type="" />
		</item>
		<item>
		<title>jQuery and Rails 3: A mini tutorial</title>
		<link>http://bernatfarrero.com/jquery-and-rails-3-mini-tutorial/</link>
		<comments>http://bernatfarrero.com/jquery-and-rails-3-mini-tutorial/#comments</comments>
		<pubDate>Fri, 07 May 2010 18:53:45 +0000</pubDate>
		<dc:creator><![CDATA[bernat]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[rails 3]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.bernatfarrero.com/?p=274</guid>
		<description><![CDATA[As most of Rails developers, recently I&#8217;ve been through a process of unlearning all concepts of older versions of Rails and learning again the new ones of 3. But hey! I must admit that so far it&#8217;s been more pleasure than pain as things only get simpler and more natural than they used to be! Here I&#8217;d [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As most of Rails developers, recently I&#8217;ve been through a process of unlearning all concepts of older versions of Rails and learning again the new ones of 3. But hey! I must admit that so far it&#8217;s been more pleasure than pain as things only get simpler and more natural than they used to be!</p>
<p style="text-align: left;">Here I&#8217;d like to talk about how simple it has become to integrate unobtrusive jQuery to a Rails app. Let&#8217;s use as an example a system of comments. I&#8217;ll create a simple app to create YouTube like comments:</p>
<p style="text-align: left;"><span id="more-274"></span></p>
<p><a href="http://bernatfarrero.com/wp-content/uploads/2010/05/mostra1.jpg"><img class="alignnone  wp-image-559" alt="mostra1" src="http://bernatfarrero.com/wp-content/uploads/2010/05/mostra1.jpg" width="100%" /></a></p>
<p>Start typing in your teminal:</p><pre class="crayon-plain-tag">rails myCommentsApp
rails g resource Comment name:string body:text
rake db:migrate</pre><p>Then we have to include the jQuery library and the <a href="http://github.com/rails/jquery-ujs/blob/master/src/rails.js">jQuery driver file</a> and place it inside /public/javascripts/ (or grab the <a href="http://github.com/CodeOfficer/jquery-helpers-for-rails3">helpers generator of Code Officer</a> and do it automatically if you wish).  Now remove the  <em>javascript_include_tag :defaults</em> in the layout and add the following includes:<br />
<em><span style="color: #888888;"><a href="http://github.com/bernat/myCommentsApp/blob/master/app/views/layouts/application.html.erb"><span style="color: #888888;">/app/views/layouts/application.html.erb</span></a></span></em></p>
<p>&nbsp;</p><pre class="crayon-plain-tag">javascript_include_tag  &quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;
javascript_include_tag  &quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js&quot;
javascript_include_tag &quot;jquery-rails.js&quot;</pre><p>Now let&#8217;s add some logic to our program.  We&#8217;ll start out with an index action that will get all the comments:<br />
<em><span style="color: #888888;"><a href="http://github.com/bernat/myCommentsApp/blob/master/app/controllers/comments_controller.rb"><span style="color: #888888;">/app/controllers/comments_controller.rb</span></a></span></em></p><pre class="crayon-plain-tag">def index
    @comments = Comment.all
    respond_to do |format|
      format.html # index.html.erb
      format.rss
    end
  end</pre><p>And the views for the index will look like this:<br />
<em><span style="color: #888888;"><a href="http://github.com/bernat/myCommentsApp/blob/master/app/views/comments/index.html.erb"><span style="color: #888888;">/app/views/comments/index.html.erb</span></a></span></em></p><pre class="crayon-plain-tag">&lt;span id=&quot;comments_count&quot;&gt;&lt;%= pluralize(@comments.count, &quot;Comment&quot;) %&gt;&lt;/span&gt;
&lt;div id=&quot;comments&quot;&gt;
  &lt;%= render :partial =&gt; @comments, :locals =&gt; { :list =&gt; true } %&gt;
&lt;/div&gt;

&lt;hr /&gt;

&lt;div id=&quot;comment-notice&quot;&gt;&lt;/div&gt;

&lt;h2&gt;Say something!&lt;/h2&gt;
&lt;% form_for Comment.new, :remote =&gt; true do |f| %&gt;
	&lt;%= f.label :name, &quot;Your name&quot; %&gt;&lt;br /&gt;
	&lt;%= f.text_field :name %&gt;&lt;br /&gt;
	&lt;%= f.label :body, &quot;Comment&quot; %&gt;&lt;br /&gt;
	&lt;%= f.text_area :body, :rows =&gt; 8 %&gt;&lt;br /&gt;
	&lt;%= f.submit &quot;Add comment&quot; %&gt;
&lt;% end %&gt;</pre><p>Notice that the new attribute <strong>remote</strong> is all we need to worry about when creating a form that will submit with Ajax. Rails 3 works with HTML5 attributes, so it only adds the attribute <em>data-remote=&#8221;true&#8221;</em> to the form and that&#8217;s it, the jQuery driver will handle the rest.<br />
We&#8217;ll create a partial for the comments:<br />
<em><span style="color: #888888;"><a href="http://github.com/bernat/myCommentsApp/blob/master/app/views/comments/_comment.html.erb"><span style="color: #888888;">/app/views/comments/_comment.html.erb</span></a></span></em></p><pre class="crayon-plain-tag">&lt;%= div_for comment do %&gt;
  &lt;span class=&quot;dateandoptions&quot;&gt;
    Posted &lt;%=time_ago_in_words(comment.created_at)%&gt; ago&lt;br /&gt;
    &lt;%= link_to 'Delete', comment_path(comment), :method =&gt; :delete, :class =&gt; &quot;delete&quot;, :remote =&gt; true  %&gt;
  &lt;/span&gt;
	&lt;p&gt;&lt;b&gt;&lt;%= comment.name %&gt;&lt;/b&gt; wrote:&lt;/p&gt;
	&lt;br /&gt;
  &lt;%= content_tag(:p, comment.body, :class =&gt; &quot;comment-body&quot;) %&gt;
&lt;% end %&gt;</pre><p>So now let&#8217;s add the fireworks! That is, the asynchronous creation and deletion of comments along with some trendy effects. We come back to the CommentsController and add the actions:<br />
<em><span style="color: #888888;"><a href="http://github.com/bernat/myCommentsApp/blob/master/app/controllers/comments_controller.rb"><span style="color: #888888;">/app/controllers/comments_controller.rb</span></a></span></em></p><pre class="crayon-plain-tag">def create
    @comment = Comment.create!(params[:comment])
    flash[:notice] = &quot;Thanks for commenting!&quot;
    respond_to do |format|
      format.html { redirect_to comments_path }
      format.js
    end
  end

  def destroy
     @comment = Comment.find(params[:id])
     @comment.destroy
     respond_to do |format|
       format.html { redirect_to comments_path }
       format.js
     end
   end</pre><p>And we are done with the logic part! A few javascript lines will end the work:<br />
<em><span style="color: #888888;"><a href="http://github.com/bernat/myCommentsApp/blob/master/app/views/comments/create.js.erb"><span style="color: #888888;">/app/views/comments/create.js.erb</span></a></span></em></p><pre class="crayon-plain-tag">/* Insert a notice between the last comment and the comment form */
$(&quot;#comment-notice&quot;).html('&lt;div class=&quot;flash notice&quot;&gt;&lt;%= escape_javascript(flash.delete(:notice)) %&gt;&lt;/div&gt;');

/* Replace the count of comments */
$(&quot;#comments_count&quot;).html(&quot;&lt;%= pluralize(Comment.count, 'Comment') %&gt;&quot;);

/* Add the new comment to the bottom of the comments list */
$(&quot;#comments&quot;).append(&quot;&lt;%= escape_javascript(render(@comment)) %&gt;&quot;);

/* Highlight the new comment */
$(&quot;#comment_&lt;%= @comment.id %&gt;&quot;).effect(&quot;highlight&quot;, {}, 3000);

/* Reset the comment form */
$(&quot;#new_comment&quot;)[0].reset();</pre><p><em><span style="color: #888888;"><a href="http://github.com/bernat/myCommentsApp/blob/master/app/views/comments/destroy.js.erb"><span style="color: #888888;">/app/views/comments/destroy.js.erb</span></a></span></em></p><pre class="crayon-plain-tag">/* Eliminate the comment by fading it out */
$('#comment_&lt;%= @comment.id %&gt;').fadeOut();
/* Replace the count of comments */
$(&quot;#comments_count&quot;).html(&quot;&lt;%= pluralize(Comment.count, 'Comentari') %&gt;&quot;);</pre><p><strong>Finish!</strong> That&#8217;s all the effort you need nowadays to a create a Web 2.0 fashionable feature such as this one. Of course, you need some styling with CSS, and you would need tons of more things in the real world (such as antispam, authentication, something to comment about&#8230;) but that&#8217;s the part I chose to talk about today!</p>
<p>I pushed <a href="http://github.com/bernat/myCommentsApp">myCommentsApp</a> to Github in case you want to have a closer look (or download the <a href="http://github.com/bernat/myCommentsApp/zipball/master">zip version</a>).</p>
<p>You might be interested in checking out <a href="http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/">my script for letting user in-place edit your application contents</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bernatfarrero.com/jquery-and-rails-3-mini-tutorial/feed/</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.337 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2015-11-18 00:15:16 -->
