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’t work, neither would if I regenerated the preferences file ~/Library/Preferences/org.mozilla.thunderbird.plist.
This is how I fixed it, in case it is useful to someone else. I’m running MacOS Snow Leopard 10.6.4 on a Macbook Pro:
First I created another profile for Thunderbird. The profile manager is launched by this command [you must type this in your terminal]:
/Applications/Thunderbird.app/Contents/MacOS/thunderbird-bin -profilemanager
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 ~/Library/Thunderbird/Profiles/ [the ~means the home directory]. In this process I realised what was the problem: the file compreg.dat.
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.
Tags: mozilla thunderbird bugthunderbird crash
Rss Feed
Tweeter button
Facebook button
Technorati button
Reddit button
Linkedin button
Delicious button
Digg button
Meneame button
No Comments »
Make stuff accessible! This has become a general dogma in the web. Rightfully so. This is particularly true when working for public institutions, since they are bound by law to be accessible from as long as 2002. And yet, if you do a tour through the websites of councils (Ajuntaments), province administrations (Diputacions), ministries and so on, it will only make you laugh (or cry). It is a law no one knows how to enforce.
Impaired/disabled people, users accessing through different architectures, platforms or reading software, machines trying to classify your webs, spiders, search bots, they are usually denied access to most websites content. I find it to be specially outraging for impaired people, since they are no less citizens nor content consumers than others and yet they’ve got no other alternative of access.
Sadly enough, if you are just a normal content creator and try to understand what the WCAG2 regulations are about, you will probably end up crazy. In my real life, I try to tackle accessibility as a philosophy for doing stuff. Most of the principles are the same my parents told me when I was a kid: Tidy stuff up, be organized, be clear,… If I create some content, I’ll try first to express it clearly and organize it (index, sitemaps, categories, tags, clear titles, beautiful permalinks). When that’s done, I’ll try to give as many ways of access to it as possible (HTML Standards, RSS feed, MP3 reading, etc.). Of course, I’ll take it into account in all details I code, for example if I insert an image I’ll provide it with an alternative description (in case someone can’t see it, or it is not rendered). If I post a link, I’ll provide it with a title (so it displays a tooltip indicator of where I’m taking the user). If I insert a script, I’ll wonder and handle the usage-case in which the user can’t interpret it. All of this should not be considered once I finishing my work, but right away while I’m doing it. As my mother used to tell me, stuff is extremely easy and simple when you address it right away and you make it become a habit, if you leave it for later, it will pile up and be an unbearable burden.
All this thoughts came to me today while I was thinking of the nice and clean design of Marcelino Llano’s website (he is a user experience engineer). Why not all blogs give the possibility to listen to the posts instead of reading them? After all, it takes nothing to read the post after writing it, you do it anyway to check your spelling… I’ll start with my own =)
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Tags: accessibilityread postscreen readerswcag2
Rss Feed
Tweeter button
Facebook button
Technorati button
Reddit button
Linkedin button
Delicious button
Digg button
Meneame button
3 Comments »
I haven’t been particularly active recently, I’m actually preparing myself for the last exams I (might) ever do in my university. Tough stuff! Nonetheless, I’ll be back on (working, learning and posting) next month! In the meantime, I’d like to present the new podcast in which I happen to participate. It is called Semàntic. Unfortunately for the English reader, it’s only in Catalan (my native language) and can be found in http://semantic.cat.
I had the idea of creating this podcast after being repeatedly disappointed by the little choice of podcasting we have in Catalunya. I’m kind of addicted to many American and British podcasts and I always thought I’d like to have some of those in my own language… so what the hell, I talked with some colleagues, Jordi and Masumi, and they (surprisingly) found the idea interesting, so that’s how Semàntic was born, in our uni’s bar. We’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’re improving over time, and we hope to do a lot more!
Of course, we have a Rails3 website, a Sinatra Wiki (ingeniously built by Jordi), we coordinate ourselves through Talker and record with the help of some Samson unexpensive condenser microphones. So if you’re interested in technology and computer science, and you understand Catalan of course, don’t hesitate to subscribe to Semàntic Podcast!
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Tags: catalan podcastComputer Scienceit newssemàntic podcast
Rss Feed
Tweeter button
Facebook button
Technorati button
Reddit button
Linkedin button
Delicious button
Digg button
Meneame button
No Comments »
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 “smart” that duplicates your videos to the local iMovie library and then it saves the project and your modifications automatically, “magically”. 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 “imovie lost project” in Google and finding tons of frustrated folks (i.e: this is one, this is another, and yet another, …).
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 “Save as” and, wow, all the “magic behind the scenes” of Apple slapped in our faces and the .aif file of the recording got deleted forever. Now, if there’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 “Save”, she is probably not looking forward to delete the whole damn thing. Have a look at the endless thread for this problem at Apple’s Garageband forum.
But it all comes from the same principle of Apple, the principle of they controlling everything and users just wowing at the company’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’s it. This is Steve Job’s concept of freedom.
Well, it turns out I don’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’d rather stick to my old-looking but reliable interfaces.
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Tags: apple software policygarage band lost fileimovie lost project
Rss Feed
Tweeter button
Facebook button
Technorati button
Reddit button
Linkedin button
Delicious button
Digg button
Meneame button
No Comments »
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 backup approximately one week from now and since then I haven’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’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… 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.
I’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.
Yours faithfully,
Bernat Farrero.-
The answer to this was: Go to your panel, complete the questionnaire and cancel your account. No word about the refund. So don’t be misled by their low prices, it will make you waste your time and money.
Update: At the end, two weeks later, I did receive the refund. I lost 1,10€ in the transaction, but I’m satisfied enough =)
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Tags: mozy problemsonline backup
Rss Feed
Tweeter button
Facebook button
Technorati button
Reddit button
Linkedin button
Delicious button
Digg button
Meneame button
3 Comments »
As most of Rails developers, recently I’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’s been more pleasure than pain as things only get simpler and more natural than they used to be!
Here I’d like to talk about how simple it has become to integrate unobtrusive jQuery to a Rails app. Let’s use as an example a system of comments. I’ll create a simple app to create YouTube like comments:

Start typing in your teminal:
rails myCommentsApp
rails g resource Comment name:string body:text
rake db:migrate
Then we have to include the jQuery library and the jQuery driver file and place it inside /public/javascripts/ (or grab the helpers generator of Code Officer and do it automatically if you wish). Now remove the javascript_include_tag :defaults in the layout and add the following includes:
/app/views/layouts/application.html.erb
javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"
javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"
javascript_include_tag "jquery-rails.js"
Now let’s add some logic to our program. We’ll start out with an index action that will get all the comments:
/app/controllers/comments_controller.rb
def index
@comments = Comment.all
respond_to do |format|
format.html # index.html.erb
format.rss
end
end
And the views for the index will look like this:
/app/views/comments/index.html.erb
<span id="comments_count"><%= pluralize(@comments.count, "Comment") %></span>
<div id="comments">
<%= render :partial => @comments, :locals => { :list => true } %>
</div>
<hr />
<div id="comment-notice"></div>
<h2>Say something!</h2>
<% form_for Comment.new, :remote => true do |f| %>
<%= f.label :name, "Your name" %><br />
<%= f.text_field :name %><br />
<%= f.label :body, "Comment" %><br />
<%= f.text_area :body, :rows => 8 %><br />
<%= f.submit "Add comment" %>
<% end %>
Notice that the new attribute remote 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 data-remote=”true” to the form and that’s it, the jQuery driver will handle the rest.
We’ll create a partial for the comments:
/app/views/comments/_comment.html.erb
<%= div_for comment do %>
<span class="dateandoptions">
Posted <%=time_ago_in_words(comment.created_at)%> ago<br />
<%= link_to 'Delete', comment_path(comment), :method => :delete, :class => "delete", :remote => true %>
</span>
<p><b><%= comment.name %></b> wrote:</p>
<br />
<%= content_tag(:p, comment.body, :class => "comment-body") %>
<% end %>
So now let’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:
/app/controllers/comments_controller.rb
def create
@comment = Comment.create!(params[:comment])
flash[:notice] = "Thanks for commenting!"
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
And we are done with the logic part! A few javascript lines will end the work:
/app/views/comments/create.js.erb
/* Insert a notice between the last comment and the comment form */
$("#comment-notice").html('<div class="flash notice"><%= escape_javascript(flash.delete(:notice)) %></div>');
/* Replace the count of comments */
$("#comments_count").html("<%= pluralize(Comment.count, 'Comment') %>");
/* Add the new comment to the bottom of the comments list */
$("#comments").append("<%= escape_javascript(render(@comment)) %>");
/* Highlight the new comment */
$("#comment_<%= @comment.id %>").effect("highlight", {}, 3000);
/* Reset the comment form */
$("#new_comment")[0].reset();
/app/views/comments/destroy.js.erb
/* Eliminate the comment by fading it out */
$('#comment_<%= @comment.id %>').fadeOut();
/* Replace the count of comments */
$("#comments_count").html("<%= pluralize(Comment.count, 'Comentari') %>");
Finish! That’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…) but that’s the part I chose to talk about today!
I pushed myCommentsApp to Github in case you want to have a closer look (or download the zip version).
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Tags: ajaxcommentsjqueryrails 3tutorial
Rss Feed
Tweeter button
Facebook button
Technorati button
Reddit button
Linkedin button
Delicious button
Digg button
Meneame button
2 Comments »
Last week in Artificial Intelligence (5th year’s subject in FIB, my university), we worked in a project analysing the empirical differences among some local search algorithms. We were given AIMA, an AI Java framework, and a problem to solve with those algorithms. The problem consisted basically of creating optimal K bus routes in a squared city (called SquareTown) for a randomly generated set of P bus stops. By optimal they meant minimal cover distance including all stops and minimal difference between the distances of every two consecutive stops. The algorithms to be used were Hill Climbing and Simulated Annealing. The full formulation of the problem can be found here (in Spanish).
Our findings were quite interesting, and I will sum them up in the following points:
- The HC (Hill Climbing) algorithm is extremely fast (it gets to a solution almost instantly).
- If HC starts from a smart initial solution it can get pretty good results (30-40% better than random initial solution).
- SA (Simulated Annealing) is slower than the former (like 100x slower).
- If well parametrized (by trial and error, of course), SA gets better results than HC (from 0.5x to 2.5x times better).
- SA doesn’t care about the initial solution, even using a smart one we got results only 3-5% better.
- Using a completely indeterministic (random) initial solution, it improves the performance of SA even better than using the smart initial solution, conversely to what happens with HC.
- If we run HC consecutively with an indeterministic initial solution each time (indeed for a unique problem), we get even better results than SA in its best conditions. The number of iterations is chosen to be equivalent to the time taken by SA. In our case, we were getting the same results of SA with half its elapsed time. This approach is called RRHC (Random Restart Hill Climbing).
- The bigger the problem gets (the space to search) the worse are the results for both approaches.
Our code (of Jordi and I) is now public in Github and can be used by anyone (read the REAME). The important files are SquareTown.java, where we implement the whole problem and Main.java, where we execute the experimentation (pay no attention to the code of the Main, due to the last-minute policy of coding projects for university, it is quite filthy). The project’s final documentation can be found here (in Catalan).
Update: We got a 8/10 for the project.
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Tags: artificial intelligencefibhill climbingiajavalocal search algorithmssimulated annealing
Rss Feed
Tweeter button
Facebook button
Technorati button
Reddit button
Linkedin button
Delicious button
Digg button
Meneame button
2 Comments »
Over the time, the concept of value in our society has evolved in ways none of the pioneers (from Adam Smith / Ricardo to Karl Marx) would have possibly imagined. Conversely to what Marx argued, value keeps no longer proportion with labor [of production]. At the contrary, now value takes the form of all possible shapes but those related to production. Starting with banks who magically create money as loans. We’ve seen how hedge funds and investment groups make money out of lots of NOTHING by just moving virtual debts around (as mortgages). Others make money just by buying and selling huge amounts of currency among different countries. No real economy here, no goods produced, no value added, and yet money seems to appear from the void.
However, money does not appear from the void, there must always be a loosing part. And that’s the point of my article. As the ways of value creation change, society should change with it or at least understand what the change is all about if people do not want to be fooled. The current economic meltdown is nothing but us not understanding the model of value creation. Now as ever, our ignorance is their allowance to do it.
IT is my field, and it is clear to me the role information is taking in value creation. Information is crucial for competition, and I’m not talking about market’s information (that is obvious), but also the information of every step of any firm’s value chain. Take, for instance, logistics. The fact of controlling where your trucks are, how they move, organize the routes, the deliveries through information systems have improved dramatically the business efficiency and reduced final costs (See Virtual Value Chain). To the point that it intrinsically determinates who takes the markets. It’s fun to see how the classic value chain model of a firm is getting covered by so many transversal layers that, at the end, it makes no sense whatsoever. Someone could just think of changing the model, though getting stuff simple and readable has never been the aim of Economics.
Of course, in recent years this revolution of the way firms learned to use information took place, precisely, within the business sector, away from normal people. Business actors learned all ways to gather information of their own processes and activities and obtain value from it. Indeed, it couldn’t take long ’til someone realized this same technique could be applied on people.
Thus were born the “free” services delivered over the Internet. Basically, we’re given a new way to perform our normal activities, all through their services. Google probably deserves the first place in this new ranking of business, fully devoted on gathering huge amounts of personal data, studying and transforming it to valuable information. Facebook is just another simple example (over $10 billion worth of stock value) of a company fully devoted to it. One could think these companies were a bit lost in the beginning, as Twitter has proved over the past years (though listen to Gary Vaynerchuck), they knew all of this data would proof profitable and valuable somehow in the future but didn’t quite know how. Now they surely do.
Marx couldn’t think of this new era of value creation, though his principles remain the same. Some people still take profit of others ignorance and “alienation” to make money out of it. Most people still don’t understand the value of information, and would fill out or answer any survey without knowing how valuable are those minutes to a company. At the same time, people use Internet services happily thinking everything is free and naively give up all their personal data that will be acquired after by all sorts of companies with all possible aims. In other words, privacy is no longer a fundamental personal right, but also a tradeable commodity that people is selling out for FREE.
Information has already become the exchange unit of value nowadays. The specific description of the way we go to the toilet is worth money and if we make it public to one of these companies I promise they’ll find someone interested in buying it. If you are prepared to give out all this information for free, it’s up to you, though just be aware of it, and think businesses are out there to increase their profits, not give stuff for free.
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Tags: free internet servicesit economicsvalue creationvirtual value
Rss Feed
Tweeter button
Facebook button
Technorati button
Reddit button
Linkedin button
Delicious button
Digg button
Meneame button
No Comments »
I needed to copy the EXIF information data from one image to another and I found the nicest program ever: ExifTool, a Perl command-line program by Phil Harvey. It works on Mac and Windows. Once installed, you open your terminal and type:
exiftool image.jpg #To read exif data
exiftool -tagsFromFile original.jpg new.jpg #To copy EXIF tags from original.jpg to new.jpg
You can also read the docs to know how to change any field of the EXIF data and so on. Very handy, thanks Phil Harvey!
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Tags: copy exif dataexiftool
Rss Feed
Tweeter button
Facebook button
Technorati button
Reddit button
Linkedin button
Delicious button
Digg button
Meneame button
1 Comment »
I found odd how few places were talking about reading a WordPress database from a Rails app.
If you want to flash your blog updates somewhere in your Rails app it comes handy to have your WP posts mapped as if they were any other Rails model. How to do so is not complicated so long as you consider a few details.
First off, add a new database in your config/database.yml.
blog:
adapter: mysql
encoding: utf8
host: YOUR HOST
database: DATABASE OF YOUR WP
username: USERNAME
password: PASS
Add your WP model: /app/models/wp_post.rb:
class WpBlogPost < ActiveRecord::Base
establish_connection :blog
set_primary_key 'ID'
set_table_name "wp_XXXXX_posts"
#Only in case you want to add comments as well:
has_many :comments, :class_name => "WpComment", :foreign_key => "comment_post_ID"
end
In case you want to add comments as well, /app/models/wp_comment.rb:
class WpBlogComment < ActiveRecord::Base
establish_connection :blog
set_table_name "wp_XXXXX_comments"
set_primary_key "comment_ID"
belongs_to :post , :class_name => "WpPost", :foreign_key => "comment_post_ID"
end
Attention! You need to tell Rails what field is the primary key since these tables do not follow the Rails convention, and also you need to specify the name of the table within the WP database, something like wp_234f8_posts, or wp_234f8_comments.
When that’s done, you can start using it from your controllers and views. Remember to get all posts marked as “publish”, as WP registers a lot of redundant data in the DB as well. Something like this would work:
@posts = WpBlogPost.find(:all, :conditions => ['post_status = "publish"'], :limit => 10)
One other important thing should be considered. Be sure you configured your host db server to accept access from the outside if you want to try your controllers from your local development server. Also, you need the last MySQL installed as a gem (sudo gem install mysql).
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Tags: active recordruby on railsWordpress
Rss Feed
Tweeter button
Facebook button
Technorati button
Reddit button
Linkedin button
Delicious button
Digg button
Meneame button
2 Comments »