Open Source Linux Solutions Open Source Linux Solutions: Linux Programs, Reviews Programs, Ruby on Rails, Tutorials for Web 2.0 2013-02-12T17:50:22Z WordPress admin <![CDATA[Web 2.0 time: never redesign buttons]]> 2013-01-24T17:52:26Z 2013-02-12T17:50:22Z There’s something that I really can’t understand about the web. Every time people design a new web application, they usually re-draw “buttons” using Photoshop or similar programs.

This is very common especially in this Web 2.0 time, where anyone wants to have cool brightly buttons.

HTML provide us a full feature set of web controls and each of them can be used through a simple tag on a page.

Why don’t people like them?

Why do they need to change what’s actually working well?

I’m not a designer, but have to admit that it happens to me sometimes. The truth is that every time we design a new web site we partially waste our time in users confusing tasks. They gratify ourselves, not the end user.

Let me explain why. A user can learn everything, but I’m pretty sure that there’s something which he’s already used to. It’s the operating system he has chosen (or not) to install on his PC.

The great part of the PC users have a Wintel platform and I suppose they know it quite well. In any case, if a user has chosen a different OS, he probably likes it and he knows what its basic user interface controls mean. They definitely know what a button is and how it looks like.

Every time we decide to re-design the application buttons we could confuse the users, forcing them to learn a new metaphor.

admin <![CDATA[No constraints, no boundaries. You can step back]]> 2013-01-24T17:50:13Z 2013-02-12T17:48:34Z In the current version of WhoDoes people have to follow a specific pattern to start planning a project.

You have to create a new project, invite then staff people, create milestones then tasks and assign people to tasks.

This is the normal path you follow when you start a plan. Up to this point everything can be considered normal.

Using WhoDoes you also need to complete all the task’s attributes (i.e. start and due date, budget) in order to make them visible on people’s calendars.

If you don’t complete them, you don’t actually get the tasks included into your plan and visible to people.

We found this approach too limited. After all a project management tool must first of all help people to communicate deadlines, things to be done or simply facts.

People need to share TO-DOs in a project even before they know who will be in charge of them. Again, they need to communicate to each other before knowing when activity deadlines need to be accomplished.

So the first decision is. Relax requirements on mandatory attributes and objects and make milestones and tasks loosely coupled.

admin <![CDATA[WhoDoes Lesson one: remove constraints]]> 2013-01-24T17:48:24Z 2013-02-11T17:46:03Z We just finished launching WhoDoes and soon we will be starting to think of the next major steps in our product life cycle. New features? A bit of mashups? APIs?

Not exactly. We decided to take a different approach, re-thinking some core characteristics of WhoDoes to make it even easier to use.

We know we are the first clients of WhoDoes and we soon understood that we would make a better product for everyone by simplifying the way it works.

So we stopped thinking about the product’s evolution and we started thinking about how we can streamline what we have been creating.

We are a small company and this is an advantage. You can simply decide to change things that you think can be done better and soon, start to improve the future of your application.

You can decide to listen to yourself and your customers, and make things work faster.

No committees, no meetings, no focus groups, … no wasting of time. The best way to check how changes might effect your product is to try it on your user base and to wait and see what it produces… in the real world.

I think user responses are the best way to validate ideas.

admin <![CDATA[Javascript and physic engines]]> 2013-01-24T17:45:42Z 2013-02-11T17:40:42Z A few days ago while watching the amazing combination effect demo page I thought:

A physic Engine written in Javascript could be cool?

With such a tool you could create amazing effects by setting extra physics properties to divs (like forces, frictions, etc…) or other HTML objects. This physic engine could help you create effects like a photo slideshow where the pictures falls from the top and bounch on the bottom of the page.

Other abilities could lead into adding physic effects to your GUI, as example you could have a list of elements (eg divs) one over each other with the ability to delete on of them; when this happen the elements over the deleted one could bounce realistically before stop.

The pourpose of this post is to share this thoughts with you in order to understand if could be a good idea starting the development of such a tool or if there are better alternatives. (or if all these effects are simply unnecessary).

While surfing in the past day searching for already made examples i found only this PhisicBallMenu example dated back (no Prototype.js) and nothing more.

admin <![CDATA[CD-o-matic with Ruby]]> 2013-01-24T17:40:06Z 2013-02-10T17:37:08Z With just a bunch of ruby lines I created a small utility that fills a folder with songs picked randomly from a choosen repository until the maximum specified size is reached.

This tool is very useful for me ‘cause I can change my USB player music day-by-day without choosing each song from my repository (which is a boring and extremely long operation).

So, here you are the code:

require "ftools"

# Path were you want to store the randomly picked music

finalpath = "/Users/sandro/mp3xcd/"

# Path from which pick the music

repository = "/Volumes/ntfs/Musica/"

# Size Limit for the ‘finalpath’ folder (in bytes)

sizetomatch = 650000000

selected = []

cursize = 0

candidates = Dir.glob(repository+"**/*.mp3")

while cursize < sizetomatch do

nr = rand(candidates.length)

unless selected.include?(candidates[nr])

selected << candidates[nr]

puts "Adding: " + File.basename(candidates[nr])

cursize += File.size(candidates[nr])

puts "Space Left: " + (sizetomatch – cursize).to_s + " bytes"



selected.each do |f|

File.copy(f,finalpath + rand(selected.length).to_s + "-" + File.basename(f))

puts "Copying " + f + " to selected folder "


admin <![CDATA[BrainBuster Globalized!]]> 2013-01-24T17:36:53Z 2013-02-10T17:33:36Z During the last week I created a small patch that allows Brain Buster Logic Capthca plugin to cooperate with Globalize by asking only questions that match the specified language.

To archive this I’ve changed ‘brain_buster.rb’ as follow:

def self.find_random_or_previous(id = nil)

@loc = (Locale.language_code.to_s.blank? ? "en" : Locale.language_code.to_s)

if id.nil?

self.find(random_id(first_id, count(:conditions=>["lang = ?",@loc])),:conditions=>["lang = ?",@loc])


find(id,:conditions=>["lang = ?",@loc])




# return first valid id

def self.first_id

if find(:all,:conditions=>["lang = ?",@loc], :o rder => "id").length == 0

@loc = "en"


@first_id = find(:all,:conditions=>["lang = ?",@loc], :o rder => "id")


and then I created a migration which add a ‘lang’ column to the brain buster table:

class BusterAndLanguage < ActiveRecord::Migration

def self.up

add_column :brain_busters, :lang, :string, :default=>"en"


def self.down

remove_column :brain_busters, :lang



That’s it; now we need just to fill the table with questions and answers for the languages we want to add to our application.

admin <![CDATA[HowTo: track the effects of your email campaign]]> 2013-01-24T17:33:19Z 2013-02-09T17:25:34Z When it’s time to send an email to all of your subscribers we always need to maximize the information we can get back from our campaign. Here are a few tricks that can help us in this operation:

Step one: the receivers list

First of all we need to set-up a table containing the list of the users; to do this we can use an existing table in our application or set up a new one; we’re going to follow this way and create it among with a new rails application.

rails campaign

cd campaign

ruby script/generate scaffold_resource user name:string email:string verification_hash:string

.. set up your database.yml …

rake db:migrate

ruby script/server

As you may can notice I’ve created a table with just the fields we’re going to use in this how-to, but you can add as much user information as you want.

Before continue we need to hide the ‘verification_hash’ fields from our scaffold views; this is beacuse we’re going to create an ‘after_save’ filter that fills the verification_hash automatically; here’s the filter:

# inside app/models/user.rb

before_save :create_verification_hash


def create_verification_hash

unless self.verification_hash.nil?

self.verification_hash = Digest::SHA1.hexdigest("–" + rand(10) + "–" + name + "–")



# inside config/environment.rb

require ‘digest/sha1′

After you have created the users list you can start fill it with the receivers. You can do it by using the rails scaffold we have created in the code list above (http://localhost:3000/users) or you can use a SQL import command or wathever you like.

Then it’s time to set up ActionMailer, to do this you have to write a few configuration lines in your environment.rb; you could user either a smtp server or sendmail, for more information on how to complete the configuration please follow the wiki article on ActionMailer ; when you’re done you can run the following command:

ruby script/generate mailer email

And create the app’s mail handler.

Step two: track the contents

We’re going to create a table called ‘contents’ that will contains all the url of our emails; we don’t need a scaffold ‘cause we’re not going to fill this table by hand but we’ll create an helper that will ‘catch’ all the urls in an email template and adds them to our table.

Next we need to create a table that links contents and users; I’ve called that ‘mail_checks’ but maybe there are better names; in this table we’re going to store all the clicks the users make on the contents.

ruby script/generate model content

ruby script/generate model mail_check

Now we need to open ‘002_create_contents.rb’ and write:

class CreateContents < ActiveRecord::Migration

def self.up

create_table :contents do |t|

t.column :url, :string

t.column :verification_hash, :string

t.column :campaign_code, :string



def self.down

drop_table :contents



In ‘003_create_mail_checks.rb’ we have to write:

class CreateMailChecks < ActiveRecord::Migration

def self.up

create_table :mail_checks do |t|

t.column :contact_id, :integer

t.column :content, :string

t.column :created_on, :datetime



def self.down

drop_table :mail_checks



And then migrate: (remeber also to add ‘has_many’ and ‘belongs_to’ to the models according the filelds created)

rake db:migrate

We need to repeat the same ‘before_save’ filter inside ‘models/content.rb’ in order to let the istances of the Content model fill their verification_hash; when done we can continue to the next chapter.

Step three: the e-mail

What we’re looking for is a rake task that lets you specify the name of the e-mail you want to send, the subject and the sender, to do this first we need to create a structure that let us handle multiple e-mails without creating a method in our ActionMailer class for each of them:

# inside models/email.rb

class Email < ActionMailer::Base

helper :application

Dir.glob(File.join(RAILS_ROOT,"app","views","email","*.rhtml")).collect{|a| a.split("/").last.split(".").first}.each do |e|

define_method(e) do |sender,email,sbj,dbcontact|

recipients email

from sender

subject sbj

# Email body substitutions go here

body ( :dbcontact => dbcontact )




As you may noticed I’ve included the ‘application._helper.rb’ in this ActionMailer; by doing this I can now use all the helpers in that file inside my email views; in detail I can create a set of helpers to parse and store the urls contained in the .rhtml template:

# inside app/helpers/application_helper.rb

def url_for_mail(url)

if Content.find_by_url(url).nil?

savedurl = Content.create(:url=>url)


savedurl= Content.find_by_url(url)


url_for( :controller=>"campaign",


:content_verification_hash => savedurl.verification_hash,

:verification_hash => @dbcontact.verification_hash,


:o nly_path => false



We’re almost done: three things remain:

  • Modify the email template in order to use this helper while generating urls,
  • Create a rake task to send an email,
  • Create the redirect action.

Step four: final adjustements

Now we can create our first email message with this rules:

  • Use instead of the name of the receiver (this rule must be extended to all the attributes of our contacts)
  • Use ‘url()’ helper ( —> url(‘’) )

You can find the rake task here and it must be put inside the lib/tasks directory of our campaign application, you can invoke it with this command:

rake campaign:send SUBJECT="Monthly newsletter" MAILNAME="you_rhtml_email_name"

Last but not least we need to create a controller called campaign and an action called redirect:

# inside app/controllers/campaing_controller.rb

def redirect

@user = Contact.find_by_verification_hash(params[:verification_hash])

@content = Content.find_by_verification_hash(params[:content_verification_hash])

if @user.nil? or @content.nil?

render :text=>"Redirect not allowed"




:content => @content.url


redirect_to @content.url





# inside config/routes.rb

map.connect ‘vc/:verification_hash/:content_verification_hash’, :controller => ‘campaign’, :action=>’redirect’

Ok, now you’re reday to start your first 100% tracked e-mail campaign, each time a user clicks on a link inside your e-mail it will be stored inside the ‘mail_checks’ table; a few final considerations:

Using a SHA – Digest as ‘verification_hash’ is a secure but not-very-nice-looking way, a better solution could be use a more small self-generate digest.
You can add as many report as you want by querying the mail_checks table.

admin <![CDATA[RailsConf EU opens: bratwurst, beer and nice people]]> 2013-01-24T17:19:35Z 2013-02-09T17:16:39Z Yesterday evening we took part of Bratwurst on Rails, the first event related to the RailsConf Europe in Berlin. It has been really a great night: it was our first Bratwurst party.

We arrived, took a couple of beers and began looking around us. Soon we found great people to talk with. Some were known, some other not.

We met some Rails blog & code icons as Amy of Slash7 and Thomas Fuchs, the father of

We met Lee and Sergio from Chicago who write Ruby code for the financial market and started using Rails at version 0.3 – good luck guys.

We met Marco an Italian guy from Pisa, a Rails enthusiast, who said us that in his opinion we are the only real Web 2.0 initiative in Italy. Thanks Marco for your support.

It was also really amazing meeting so many people coming from the US, some who missed the Portland event and some who were at Portland too.

admin <![CDATA[Follow The Oracle]]> 2013-01-24T17:16:12Z 2013-02-08T17:11:53Z Finally a definitive solution for all problems related to Project Management. Answers for all the Project Managers doubts.

The times for inventing excuses to justify why you are late to your boss or your clients, are over.

The times for inventing creative methods to increase the team work productivity, are over.

The web site Follow the Oracle allows you to consult an Oracle in order to obtain all the answers to the typical questions of people involved in Project Management.

The Oracle answers in a peremptory way to the frequently asked questions, suggesting original excuses to justify the continuous projects delays, and proposing innovative methods to increase the team work productivity.

Don’t worry anymore about Project Management problems…now with the Oracle Driven Project Management, you’ve only to choose a question… and Follow the Oracle!

admin <![CDATA[What it does]]> 2013-01-24T17:08:20Z 2013-02-08T17:04:03Z Collaborating

(xy)write makes easy writing, sharing and collaborating on a document. It helps your team agree about what to do, wherever they are. It helps you to share a meeting report or a contract with a customer. And it makes sure that if someone changes the document, you’ll be notified via email by the system. You can invite people to collaborate with you in seconds simply having their email addresses.

Version tracking

(xy)write manages version tracking allowing you to retrieve a previous version if something goes wrong. Then you can complete it and save it with a new version number.


Writing a document often requires exchanging information with the other people. (xy)write allows you to share comments while you and your collaborators complete the document.

Export in PDF or RTF format

In any moment you can export a document in PDF or RTF format to elaborate it offline. That’s a very normal thing for a word processor, but Writeboard doesn’t have it. Yet another reason to code our own product.

An egalitarian word processor: re-use your old PC

I’m so upset when I find a good product on the Internet, but I can’t make it work with older OSs. (xy)write has been written to be usable with old OSs like Mac OS 9.2 and browsers like Netscape 7.1. We chose Netscape bacause it’s available on many old machines. We are very proud of this feature, so if you have an old PC with Netscape 7.1 or greater on it and somethings doesn’t work well with (xy)write, contact us to get it fixed immediately. You don’t need a new PC to use a smart word processor.