Open Source Linux Solutions » breaking Open Source Linux Solutions: Linux Programs, Reviews Programs, Ruby on Rails, Tutorials for Web 2.0 Tue, 12 Feb 2013 17:50:22 +0000 en-US hourly 1 WhatAList is coming! Tue, 29 Jan 2013 14:12:50 +0000 admin Finally, we did it… we are delivering yet another list-rate-and-share-it web application: Ruby on Rails framework and Ajax interactive facilities.

If web 2.0 is something about a better user experience, great design, usability and user generated content, than rethinking a simple activity, like creating a list, ordering items, and sharing them with your fellows, it’s the best yardstick of testing your team ability to deliver web 2.0 applications, be agile, and generate great content.

Creating a list application means making better what is already simple, you have to reinterpret in a new way or just to give a different viewpoint to something which is near to everyday life, you are creating “web for ordinary people”.

We know we have some remarkable rivals such as Amazon Unspun. But we don’t feel strictly competitors with Unspun since we share a common base of intentions: leveraging communities, giving simple solutions, at the same time useful and funny.

Though it’s not a mystery that we are asking our users to compare our “style” with that of Unspun and of other list-and-rate services in order to give us a feedback on which let them feel the better user experience.

So what are you going to see in WhataList? First of all, take a look at the teaser and enjoy the design.

]]> 0
Web 2.0 Map Mon, 28 Jan 2013 14:05:06 +0000 admin While searching for a complete picture of Web 2.0 galaxy I found some nice collages of application logos: the one from Ludwig Gatke is amazing.

Then if you are looking for a more schematic map of Web 2.0 you can find some over-connected graphs and little more: from the original meme map by Tim O’Reilly, to the very crowded tag-cloud image from Markus Angermeier.

Tim O’Reilly picture is a brainstorming mind map: an image-centered diagram that represents semantic or other connections between portions of information related to Web 2.0, simple but useful.

On the other hand Angelrmeier work is fascinating but a bit cramped; it looks like a mix between a tag cloud and a concept map, you enjoy the easy of use and immediateness of tag clouds mixed with the downward-branching structure typical of a concept map.

I found Angelrmeier’s work very expressive, but too complicated and static, therefore I set my mind to improve the tag-cloud representation of Web 2.0, starting from that image, but working on a different graphic format.

I was aiming at a more dynamic image, easy to edit, and more linked with external information sources, basically much more readable. I selected the .svg format Scalable Vector Graphics and created it using Inkscape

]]> 0
Tutorial: a simple act_as plugin for ruby on rails Sun, 27 Jan 2013 13:40:10 +0000 admin Acts_as_commentable, acts_as_flaggable, acts_as… it seems that this kind of plug-ins is popping out from everywhere, so in this tutorial I’ll try to explain how to get your personal act_as plugin.

Chapter 1: Theory of an act_as

The key-word for a plug-in of this kind is ‘mixing’; mixing means using Modules nested inside Classes. In details this is how an acts_as plugin works:

  • inject into your Activerecord::Base class the module containing the function named ‘act_as_* ’
  • put your ‘act_as_* ’ into your target model
  • in the ‘act_as_* ’ function include the module that contains the instance functions and extend the module with the class functions

Ok, it seems easy, let’s try it out.

Chapter 2: Practice time

In few steps, we’re going to create a very easy act_as plugin: act_as_random. Our aim is to provide a random method that returns a random row from the choosen model. First, let’s create a rails application:

rails myactas

Now we’re ready to create our plugin:

ruby script/generate plugin act_as_random

We’re just 2 steps far from the end, the next one is open /vendor/plugins/act_as_random/lib/act_as_random.rb and put this code inside:

module MyMod

module Acts

module Roled

# included is called from the ActiveRecord::Base

# when you inject this module

def self.included(base)

# Add acts_as_roled availability by extending the module

# that owns the function.

base.extend AddActsAsMethod


# this module stores the main function and the two modules for

# the instance and class functions

module AddActsAsMethod

def acts_as_random(options = {})

# Here you can put additional association for the

# target class.

# belongs_to :role

# add class and istance methods

class_eval <<-END

include MyMod::Acts::Roled::InstanceMethods




# Istance methods

module InstanceMethods

# doing this our target class

# acquire all the methods inside ClassMethods module

# as class methods.

def self.included(aClass)

aClass.extend ClassMethods


module ClassMethods

# Class methods

# Our random function.

def random








The last step involving our plugin is injecting our module inside ActiveRecord::Base, to achieve this just put this code inside our init.rb (in the plugins/myactas directory):

require ‘acts_as_random’

ActiveRecord::Base.send(:include, MyMod::Acts::Roled)

Done! Now we’re ready to use our new shiny plugin!

Chapter 3: Riding our plugin

Create a test model inside our app:

ruby script/generate model country

then fill our test model with some data using this sql file: countries.sql (i know, no migration and no yaml but it is just because is a test model :P ).

Now open app/models/country.rb and write:

# this is just because our table primary key name

# is not ‘id’

self.primary_key = "Code"


In order to test this thing works, let’s open the console:

ruby script/console

>> puts "Today destination: " + Country.random.Name + " !!"

"Today destination: Netherlands !!"

=> nil

]]> 0
We took the red pill Sat, 26 Jan 2013 13:25:55 +0000 admin Going through innovation is always the toughest path. When I think about Ruby On Rails “way of doing things” I always think about innovation.

The old way of coding MVC applications seems to me so damn complicated: no need to learn lots of of frameworks, integrate them together, without being completely sure to have a clear understanding of how things work, actually.

Taking the bandwagon of Rails “way of doing things” is like choosing between the “blue pill and the red pill”: we took the red one, being absolutely sure it’s going to be a winner in the web future.

How can I say that? Almost one year ago we got urgent a problem to be solved in our firm.

We had to streamline the process of Order Management for every engagement sold. We are a small company and buying a new module in our “ERP” (a big word to say “Accounting” for firms like ours) could seem the simplest way to address this organizational problem, but “eat your own dog food” prevailed.

After having thought for few minutes it was clear to me that this necessity could be the perfect test bed for Ruby On Rails. Normally we used to go through those kind of small apps using PHP or Java. I estimated we needed at least 4 weeks elapsed to complete our Web application, including a small analysis, coding and test.

Thinking about the requirements we got, the application seemed quite simple. So, why did we have to spend 4 weeks for a simple task like that? That was enough. I chose to challenge my team using Ruby On Rails to implement what we needed, adopting an agile methodology I sketched out in that period.

The teams feedback to my proposal was enthusiastic! I discovered that two of ours developers had already read something about Ruby, playing with it in the past months. An “8 day delivery challenge”- as we called it – began.

I was really amazed about how fast we could do stuff choosing the right approach: a simple methodology and an easy to learn framework. For the first time we could concentrate on the functionality instead of technicalities.

Simplicity instead of complexity. At day number 9 we were delivering a presentation of this new application we built to the firm. Then we collected some feedback and suggestions, and 7 days later we released the project.

After 15 days we got the first release working in production. It has been a success! We spent 50% time less. Our firm could see things happening quickly. The team could change assignment being completely satisfied.

Something special took place that day – something that improved our delivery skills a lot. Something magical happened.

]]> 0
ics.el Thu, 24 Jan 2013 12:35:02 +0000 admin ics.el is a mode for (X)Emacs that is designed to handle the text portion of an ICS session.

  • Version: Development version
  • License: GNU General Public License
  • Author(s): Mark Oakden
  • Formats: As Plaintext, compressed and gzipped
  • Size: 50k (Plaintext), 23k (compressed), 16k (gzipped)
  • Homepage: ics.el website
  • ics.el is as the name would suggest a Lisp program, to be used with either Emacs or Xemacs.

More precisely it is a major mode which allows you to communicate with Internet Chess Servers. It does not provide a graphical user interface itself as it only handles the text portion of an ICS session. Like the other programs reviewed it is released under the GNU General Public License.

To set up the program you first need to configure your .emacs file so that it is loads in the ics.el code. If you are used to editing configuration files this shouldn’t be too much of a problem. The author has supplied a HOWTO document which explains how to configure your .emacs file but I found it easier to change the actual ics.el file itself rather than making my .emacs file even larger. Fortunately the ics.el file is well documentated.

To make full use of this program you need to be running Xemacs, rather than emacs. Xemacs is a version of emacs that contains numerous improvements such as extensive graphical support and improved support for multiple fonts and colors.

Once you have configured .emacs and ics.el the program is invoked by typing Esc-x ics. A introduction page appears in xemacs where you choose which server you wish to log into. An Xboard appears and you are prompted to confirm your username and enter your password.

If you liked the hundreds of different options available with Xboard, you may love the configuration possibilities with ics.el. As ics.el uses Xboard to handle the chess based part, we will examine ics.el’s text handling features.

The two main benefits that ics.el gives are improved font support with color customization and ‘buttons’.

These are not typical graphical buttons but Lisp buttons. Basically this button feature lets you perform certain actions by clicking on specific text. For example to accept a request for a game you move your mouse over the word play.

The color changes and by clicking on the ‘button’ you accept the seek and the game begins. It works the same way if you wish to see a player’s notes or launching a URL.

]]> 0