RubyLearning Blog

All about Ruby and Ruby on Rails

PeepCode

Which 21 topics would YOU suggest for an Advanced Ruby Course and why?

August 26th, 2008 · Ruby, Training

There have been some heavy discussions at RubyLearning about what all should be covered in an Advanced Ruby Course. Many topics have been suggested along with a ‘for’ and ‘against’ each topic, but nothing concrete has come out. I’d like the topics to be more relevant to the ‘Real World Ruby‘ which any programmer with a basic knowledge of Ruby could master and use. At our Free Core Ruby Programming Course we cover the following topics.

You suggest: To arrive at this list of 21 topics, I need YOUR help. I’d like you to suggest the topic(s) and remember to mention why the topic(s) you suggest are important.

The ‘Rules’ - Any feedback, suggestions, dreams or ideas that you have are welcome. While I can’t promise to respond to each comment or put every suggestion into place I make a commitment to you to read anything you have to say.

All that I ask in return is that you be honest, courteous and constructive with your feedback.

RubyLearning is a project that I pour a lot of time and effort into - as a result sometimes criticism can be a little difficult to hear - however I think it’s vital to take it all on board if this is to continue to be a valuable resource for would-be Ruby developers wanting to improve their Ruby skills.

So it’s over to you. Feel free to either leave your feedback here as comments or to share them privately with me via my email at mail [at] satishtalim [dot] com

YOU can make a difference!

Update: I do have my own list of 21 topics but I have not posted it here, so that I don’t influence your thinking.

Technorati Tags: , ,

Posted by Satish Talim

→ 26 CommentsTags: ··

TMail: Sending email

August 21st, 2008 · Code Snippets, Ruby

The students of the FORPC101 batch wanted to know how they could send an email in Ruby. Today, out of the various options available, we will have a quick look at TMail - a library used for composing and manipulating email messages for Ruby. TMail is designed to be an Request For Comments (RFC) compatible library. The goal of TMail is to allow you to create emails programatically without having to know about the RFCs or how they work, or what their standards are.

Installation

On a Windows box, we can install the TMail gem as follows:

c:\>gem install tmail
Sending an email

You first put at the top of your class:

require 'tmail'

Accessing a TMail object is done via the TMail::Mail class. As email can be fairly complex creatures, you will find a large amount of accessor and setter methods in this class!

You then create an empty mail object by calling TMail::Mail.new. This creates a completely blank email message. To be a valid email message, you’ll need to modify the headers by simply accessing them using the accessor methods. Some of the public instance methods we use are: from, to, subject, date and body (for full details, please refer to the TMail documentation). For example, the documentation for the instance method subject is:
subject( default = nil )
Returns the subject of the mail instance. If the subject field does not exist, returns nil by default or you can pass in as the parameter for what you want the default value to be. Example:

mail = TMail::Mail.new
mail.subject #=> nil
mail.subject("") #=> ""
mail.subject = "Hello"
mail.subject #=> "Hello"

Once the email message is created, you can call the to_s method to convert it back into a string. Then it can be sent with the Net::SMTP library. The Net::SMTP library provides functionality to send internet mail via SMTP, the Simple Mail Transfer Protocol. The Net::SMTP.start method creates a new Net::SMTP object, opens a TCP connection and connects to the server. ‘localhost’ is the IP address of your SMTP server and the port used is 25. Since we have called with a block, the newly-opened Net::SMTP object is yielded to the block, and automatically closed when the block finishes.

Before you run the program (full code below), you need to start the SMTP server. On Windows, I prefer to download and use the Free SMTP Server for testing. Connect your PC to the Internet, then start the Free SMTP Server program. The program will try to detect your provider’s DNS server. If a DNS server is available and the standard SMTP port #25 is free, the program will become ready to process your mail. If it is not possible to detect provider’s DNS server, the program will prompt you to enter any DNS server you know, after that if the server exists the program will become ready to process mail. If the port #25 is busy by another local SMTP server/service, the program will show you an error message. You can specify any DNS server or SMTP port by using the button Options, which is situated on the Toolbar. You should use the word “localhost” as the SMTP server host in your mail program.

Here’s the complete program code:

require 'rubygems'
require 'tmail'
require 'net/smtp'

tomail = 'satishtalim@gmail.com'
frommail = 'superman@world.com'
mail = TMail::Mail.new
mail.to = tomail
mail.from = frommail
mail.subject = 'Test message'
mail.date = Time.now
mail.body = 'Thanks to Locaweb for making this possible.'

Net::SMTP.start( 'localhost', 25 ) do|smtpclient|
  smtpclient.send_message(
    mail.to_s,
    frommail,
    tomail
  )
end

It is to be noted that TMail is a commonly used library by the ActionMailer component of Ruby on Rails, the Nitro web framework, the Ruby-Talk mail gateway and many others.

Technorati Tags: , ,

Posted by Satish Talim

→ 1 CommentTags: ··

Thanks to RubyLearning Sponsor PeepCode

August 6th, 2008 · Ruby, Sponsors

It’s time to thank RubyLearning’s excellent sponsors!

PeepCode publishes cutting-edge screencasts and PDF books that get straight to the point. Thousands of people have learned quickly and visually about topics that matter. Check out recent content on writing Facebook Apps, Using Git, Keeping your Apps Secure, Using Email as an API and many other topics.

Technorati Tags: , ,

Posted by Satish Talim

→ No CommentsTags: ··

Announcing the 7th Free Ruby Programming Batch

August 4th, 2008 · News, Ruby, Training

Here’s your chance to learn Ruby programming for free, at the comfort of your home and along with an online teacher.

This course is ideal for those of you who want to complement your skill-set with Ruby, but haven’t quite found the time to do so. There would be online lessons, exercises, quizzes and assignments all the way. You are free to ask all your Ruby related doubts, queries and questions and rest assured that they would be answered.

The course is open to all and will cover Core Ruby. The syllabus is already available online, so you can get started early by planning what you’re going to cover. The course proper begins on Saturday, 6th Sept. 2008 and to take part, all you have to do is register at the class and enroll in the course. Detailed instructions are available there.

Already over 5000 participants have learned Ruby in the previous 6 batches.

The course is based on the Ruby eBook and the rubylearning.com site. If you have a slow internet connection or have no or limited access to the internet, I would suggest that you purchase the Ruby eBook. The Ruby eBook contains all the Core and Advanced Ruby topics covered on the RubyLearning.com site. The eBook is over 280 pages and is in pdf format. The cost of this eBook is only a nominal US$ 9.95 and is being collected to help me maintain the site and the eBook, and also provide quality content to you. Purchase of this eBook is however, not mandatory.

This batch is exclusively sponsored by Locaweb.

Technorati Tags: , , ,

Posted by Satish Talim

→ 1 CommentTags: ···

Thanks to RubyLearning Sponsor Locaweb

August 4th, 2008 · Ruby, Sponsors

It’s time to thank RubyLearning’s excellent sponsors!

Locaweb is the number 1 hosting company in Brazil, with around 400 employees and 133 thousand clients, hosting more than 220 thousand domains. I am including any news or developments the sponsor has had during July 2008.

Locaweb just opened up the registration website for the greatest Ruby on Rails event in Latin America: Rails Summit Latin America. It is only in Brazilian Portuguese right now, but in the next few days they’ll release the international version so every other member of the Latin America community can register. Keep an eye on Fabio Akita’s blog.

Rails already has 2 great events, the US and EU RailsConfs. This event is going to be a milestone for the whole community, completing the roster of big world wide Rails events. David Heinemeir Hansson himself will speak through online video - because he will be in Europe at the time - but several other international speakers will be there, live, including Chad Fowler, Charles Nutter, Chris Wanstrath, Luis Lavena, Obie Fernandez, and others completing the 14 outstanding names.

There will also be 7 great Brazilian Rails Entrepreneurs like Manoel Lemos, Vinicius Teles, Fabio Kung and several others to share their experience, tips and techniques with the audience.

They expect to have around 650 attendees. The event will take place on October 15th and 16th being 2 full days, with 2 parallel sessions in the afternoon, including a “Birds of a Feather” session at the end of the first day, allowing anyone from the community to present whatever they want and socialize.

If this event succeeds, this is going to become an annual event for the whole Latin America community. This event if for you, Railers, beginners or seniors, Ruby or non-Ruby programmers, Register Now and let’s celebrate together!

Technorati Tags: , , ,

Posted by Satish Talim

→ 3 CommentsTags: ···

Thanks to RubyLearning Sponsor BuildingWebApps

August 3rd, 2008 · Ruby, Sponsors

It’s time to thank RubyLearning’s excellent sponsors!

BuildingWebApps is a resource site for Ruby on Rails developers that includes more than two dozen original articles, including Rails setup guides for Windows and Mac, as well as more than 1,000 links to the best resources from all around the web. It is also the home of the very popular Free Online Course on Ruby on Rails. The instructors Michael Slater and Christopher Haupt are well-known speakers and highly experienced in their field of work. More than 5,000 people have gone through the course, which consists (so far) of 8 audio podcasts followed by 12 screencasts. More screencasts are coming soon, covering Git, deployment, and performance tuning.

Technorati Tags: , ,

Posted by Satish Talim

→ No CommentsTags: ·

Thanks to RubyLearning Sponsor FiveRuns

August 2nd, 2008 · News, Ruby, Sponsors

It’s time to thank RubyLearning’s excellent sponsors!

FiveRuns is a provider of Rails application (and server) monitoring services. I am including any news or developments the sponsor has had during July 2008. Two things worth mentioning here are:

  • They recently introduced DataFabric - a gem they wrote to help with ActiveRecord. One of the lingering issues they have had to deal with over the last year in the Manage service was ActiveRecord’s reluctance to talk to more than one database. DataFabric extends ActiveRecord’s standard connection handling to provide two features - application-level sharding and master/slave replication. For all the details read the article - Introducing DataFabric.
  • Want to travel to Berlin for free? Then you have one week left to take part on their “Run Your Way to RailsConf Europe” Contest. They are giving away two tickets to RailsConf Europe (September 2 -4, 2008) - airfare, hotel, and conference passes. You only need to try out their TuneUp product which they launched at RailsConf in Portland. So what are you waiting for?

Technorati Tags: , ,

Posted by Satish Talim

→ No CommentsTags: ··

Best of RubyLearning Posts for Ruby Beginners

July 31st, 2008 · JRuby, Ruby

Here’s a digest of RubyLearning’s best posts for Ruby beginners. These include (with the latest posts first):

Advise:

  • David Flanagan talks to RubyLearning
    David Flanagan is the author of the book “The Ruby Programming Language”. David says that his book was written to be a definitive book on the language, and is intended for those who want to learn and master the language. He also offers insights on Ruby 1.9.
  • Charles Nutter talks to RubyLearning Participants
    Charles Nutter currently works full-time as a core developer on JRuby at Sun Microsystems. He talks on how JRuby brings the Ruby and Java world closer.
  • “AkitaOnRails” Advises A Young Ruby Beginner
    Fabio Akita is a Brazilian Rails enthusiast, also known online as “AkitaOnRails”. Here Fabio advises a 16 year young participant of the FORPC101 course. Advise that is valid for any Ruby beginner.
  • Advise For Ruby Beginners
    Ruby Gurus: Agnieszka Figiel from Poland, David Black from USA, Fabio Akita from Brazil, Jamie van Dyke from UK, Jamis Buck from USA, Jens-Christian Fischer from Switzerland, Juanjo Bazan from Spain, Julian Tarkhanov from Russia / Netherlands, Manik Juneja from India, Matt Palmer from Australia, Mislav Marohnic from Croatia, Ola Bini from Sweden, Pedro Custodio from Portugal, Peter Cooper from UK, Remco van’t Veer from Netherlands and Sau Sheong Chang from Singapore give their perspective on the various questions facing the would-be Ruby developers, in a three-part series.
  • David Black Interview: Talking to RubyLearning.com
    David Black author of Ruby for Rails and soon to be published book The Well-Grounded Rubyist offers pearls of advise.

Code:

Technorati Tags: , ,

Posted by Satish Talim

→ 2 CommentsTags: ··

Using ActiveRecord and JDBC with JRuby - Part 2

July 30th, 2008 · JRuby, Ruby

Part 2

Continuing from where we left off in Part 1 of the article - Using ActiveRecord and JDBC with JRuby, let us now create a database called students and a table called rubyists (this holds say, the names and cities of all those who have downloaded my JRuby eBook). To do this, open a command window and type:

mysql -u root

You should now get a mysql prompt. Next at the mysql prompt, type as follows:

mysql>create database students;

It will respond with:

Query OK, 1 row affected (0.00 sec)

Next, on the mysql prompt, type:

mysql>grant all on students.* to 'root'@'localhost';

Next let us create our table called rubyists by typing the following on the mysql prompt:

mysql>use students;
drop table if exists rubyists;
create table rubyists (
   id int not null auto_increment,
   name varchar(100) not null,
   city text not null,
   primary key (id)
);

We are through with the database creation. Now type:

mysql>exit

Generally speaking, managing changes to a database schema has been one of the most odious tasks for a team of developers. Most have relied on storing DDL in revision control, ever vigilant to ensure that our database creation scripts are updated and consistent with each rollout. That solution can be very clumsy in an Extreme Programming project. And because Rails encourages iterative development, it would be very easy to imagine the constant schema changes turning into nightmares. Fortunately, Migrations allows a developer to manage rollout, and rollback, of database schema changes in a controlled and consistent manner, and one that happens to feel very natural to a Rails programmer. However, Migrations is beyond the scope of this article. You can refer to these URLs for further information –
http://api.rubyonrails.org/classes/ActiveRecord/Migration.html
http://weblog.jamisbuck.org/2005/9/27/getting-started-with-activerecord-migrations
http://glu.ttono.us/articles/2005/10/27/the-joy-of-migrations

ActiveRecord assumes that every table it handles has as its primary key an integer column called id internally, ActiveRecord uses the value in this column to keep track of the data it has loaded from the database and to link between data in different tables.
Now let us start writing the program jruby01.rb

# jruby01.rb
require 'rubygems'
require 'active_record'

ActiveRecord::Base.establish_connection(
:adapter=> "jdbcmysql",
:host => "localhost",
:database=> "students",
:username => "root",
:password => ""
)

class Rubyist < ActiveRecord::Base
end

So far, in the above code we are:

  • Using the ActiveRecord library, available as the active_record gem
  • Using the ActiveRecord adapter namely jdbcmysql
  • Establishing a connection to the database students Please note if you have set a password say xyz for your database then make :password => “xyz”
  • Creating a class called Rubyist When you create a subclass of ActiveRecord::Base, you’re creating something that wraps a database table. By default, ActiveRecord assumes that the name of the table is the plural form of the name of the class.

Next we create entries in the table without writing any SQL. If you refer the ActiveRecord documentation, we can use the create method of ActiveRecord::Base (this method creates an object, and instantly saves it as a record) to do the same:

Rubyist.create(:name => 'Luc Juggery', :city => "Nashville, Tenessee")
Rubyist.create(:name => 'Sunil Kelkar', :city => "Pune, India")
Rubyist.create(:name => 'Adam Smith', :city => "San Fransisco, USA")

You can now query the table using find of ActiveRecord::Base

participant = Rubyist.find(:first) # returns the first object fetched by SELECT * FROM rubyists
puts %{#{participant.name} stays in #{participant.city}}

You will observe ActiveRecord examines the database tables themselves to find out which columns are available. This is how we were able to use accessor methods for participant.name without explicitly defining them: we defined them in the database, and ActiveRecord picked them up.
If you want to delete an item from the database, you can use the destroy (Deletes the record in the database) method of ActiveRecord::Base as shown:

Rubyist.find(:first).destroy

The complete program is:

# jruby01.rb
require 'rubygems'
require 'active_record'

ActiveRecord::Base.establish_connection(
:adapter=> "jdbcmysql",
:host => "localhost",
:database=> "students",
:username => "root",
:password => ""
)

class Rubyist < ActiveRecord::Base
end

Rubyist.create(:name => 'Mitali Talim', :city => "Nashville, Tenessee")
Rubyist.create(:name => 'Sunil Kelkar', :city => "Pune, India")
Rubyist.create(:name => 'Adam Smith', :city => "San Fransisco, USA")

participant = Rubyist.find(:first)
puts %{#{participant.name} stays in #{participant.city}}

Rubyist.find(:first).destroy

Run the program from the command prompt:

C:\jrubyprograms>jruby jruby01.rb

The output is:

Mitali Talim stays in Nashville, Tenessee

References

  1. Charles Nutter Charles is an amazing guy! He eats, drinks and dreams JRuby - always available to help you out. No wonder JRuby is going places.
  2. ActiveRecord::Base

Technorati Tags: , , , ,

Posted by Satish Talim

→ 1 CommentTags: ····

David Flanagan talks to RubyLearning

July 29th, 2008 · Interview, Ruby

O’Reilly Media, Inc. is a strong supporter of RubyLearning.org and recently announced a 50% discount, for the participants of the FORPC101 course, on their book “The Ruby Programming Language” by David Flanagan, Yukihiro Matsumoto. Satish Talim of RubyLearning recently caught up with David Flanagan who was kind enough to spare time answering questions posed by RubyLearning.

Satish Talim>> David, a warm welcome to you. For the benefit of the readers, could you tell us something about your self?

David Flanagan>> Hmm. Although I spend most of my time these days writing about programming, my training and my original career was as a programmer. I studied at MIT, and after graduation continued to work there, writing client-side applications for the X Window System (which was new at the time) and the Motif GUI toolkit. This was in C. HTTP hadn’t been invented yet, so we all had to make do with FTP. The internet wasn’t particularly new, but there were still more .edu sites than .com sites.

I broke into the writing business in the early 1990’s when O’Reilly hired me to write a book as part of their series on the X Window System.

Satish Talim>> David, you are one of O’Reilly’s most prolific authors, specializing in Java and JavaScript. How did you discover Ruby?

David Flanagan>> I first heard about Ruby the same way most people did: because of all the excitement about Rails. I didn’t pay much attention at the time, however, and didn’t really investigate the language.

Because of my success at documenting Java and JavaScript, my editor at O’Reilly thought I’d be a good person to write a book about Ruby.

Satish Talim>> How is your book different than Pickaxe?

David Flanagan>> My book is really focused on the core language and documents it in detail. The Pickaxe covers the language in less detail, but also covers the libraries and tools that surround the language.

My book has an extended tutorial that introduces the core classes and their API, but does not have a reference section like the Pickaxe.

You can learn Ruby from the Pickaxe, but I don’t think you can master it with that book alone. My book was written to be a definitive book on the language, and is intended for those who want to learn and master the language.

Satish Talim>> What role does Ruby play in your day to day work?

David Flanagan>> Surprisingly little, actually. Right now I’m writing some documentation for freebase.com, and that has involved some Python programming, but not Ruby. Ruby has become my scripting language of choice when I need to write a utility program of some sort. (Usually to process my documentation text files in some way.)

Satish Talim>> What did you learn from writing “The Ruby Programming Language”?

David Flanagan>> After being exposed to Ruby’s blocks, I came to really appreciate the power of tightly integrating closures with language syntax. The debate about adding closures to Java got underway while I was working on my Ruby book, and it is my experience with Ruby that makes me a proponent of the BGGA proposal.

Satish Talim>> For a Ruby newbie what’s the most important thing he/she should focus on, in Ruby 1.9?

David Flanagan>> Unicode support is the largest change, and will be the most important for anyone who works with anything other than ASCII. For the rest, the performance improvements in 1.9 will probably be the most important thing about 1.9.

I feel that most of the other new features of Ruby 1.9 are just conveniences. For example, I really like the new hash syntax that allows me to write {a:1} instead of {:a => 1}.

The fact that iterator methods return Enumerators when invoked with no block is somewhat confusing but very powerful and introduces a new way of thinking about iterations. Here is an example: a program that prints itself, with line numbers:

File.open(__FILE__) do |f|
  f.each_line.with_index { |line, number|
    print "#{number+1}: #{line}"
  }
end

Satish Talim>> Any words of advice for a Ruby newbie?

David Flanagan>> Ruby is a different language than any that you already know, and it can take some time to get the feel of it. Like any language, it has some quirks that you may not care for. But once you get past those, the language really grows on you.

Learn Ruby for Ruby’s sake, and try to master the language. Don’t just learn enough Ruby to be able to write Rails programs. If you do that you’re in danger of doing cut-and-paste programming without really understanding what you’re doing.

Satish Talim>> What’s next for you?

David Flanagan>> I’m monitoring the development of Javascript 2 (aka ECMAScript 4) and will document it when it is ready. That looks like a very exciting new language.

Satish Talim>> Thanks David for sharing your views with the RubyLearning participants.

Note: This interview is one of my ways of saying thank you to O’Reilly and not directly influenced or specified by the sponsors.

Technorati Tags: , , , ,

Posted by Satish Talim

→ 1 CommentTags: ····

Using ActiveRecord and JDBC with JRuby

July 28th, 2008 · JRuby, Ruby

Preamble

The participants of the FORPC101 series of courses have been requesting me for a small article related to JRuby; so here it is.

In this article, we shall see how easy it is to connect to a database (MySQL) using ActiveRecord and a JDBC driver using JRuby.

Assumptions

I am assuming that you have Java 1.6, JRuby 1.1.3, MySQL installed and working.

Note

I am using a Windows XP box but these examples will work on a Mac or Linux box too.

JRuby

For Ruby Developers, JRuby offers a deployment platform that is well understood, particular in corporations. For a Java community, JRuby is important because it offers a chance to experience a powerful language and framework while still taking advantage of Java’s excellent libraries and the ability to work in both Ruby and Java - Martin Fowler

MySQL

MySQL is a one of the most popular open source databases around and is used by many prominent organizations from Yahoo to NASA.

ORM and ActiveRecord

ORM, stands for object-relational mapping. ORM libraries map database tables to classes. If a database has a table called orders, our program will have a class named Order. Rows in this table correspond to objects of the class - a particular order is represented as an object of class Order. Within that object, attributes are used to get and set the individual columns. Our Order object has methods to get and set the amount, the sales tax, and so on.

So an ORM layer maps tables to classes, rows to objects, and columns to attributes of those objects. Class methods are used to perform table-level operations, and instance methods perform operations on the individual rows. Active Record is an ORM.
ActiveRecord relieves us of the hassles of dealing with the underlying database, leaving us free to work on business logic. ActiveRecord relies on convention over configuration. Wherever possible, ActiveRecord guesses the correct configuration by reflecting against the data schema. When you do need a specific override, you specify the override directly in your class.

Also, ActiveRecord assumes that:

  • database table names, like variable names, have lowercase letters and underscores between the words
  • table names are always plural
  • files are named in lowercase with underscores

ActiveRecord implements some of its funkiest magic with method_missing because ActiveRecord::Base overrides the Kernel’s method_missing method.

RubyGems

JRuby comes with a fairly loaded standard library from scratch but that does not mean there aren’t other things you’ll need. Almost all of them are installable as Gems. RubyGems is the premier package management tool for Ruby. It works fine with JRuby and JRuby ships with it. You use it through the gem command. Now, we need to run the JRuby version of the gem command and to ensure that, we use the –S flag to the interpreter.
We shall install ActiveRecord as a freestanding gem in JRuby:

C:\>jruby -S gem install activerecord

Adapter

In ActiveRecord there is this concept of an adapter. Each adapter is specific for one database, so there’s a MySQL adapter, an Oracle adapter, and so on. At the moment, there are few adapters that ship with ActiveRecord.
The activerecord-jdbc-adapter adapter is needed as it allows use of virtually any JDBC-compliant database with your JRuby application. This adapter supports:

  • MySQL - Complete support
  • PostgreSQL - Complete support
  • Oracle - Complete support
  • Microsoft SQL Server - Complete support except for change_column_default
  • DB2 - Complete, except for the migrations:
    • change_column
    • change_column_default
    • remove_column
    • rename_column
    • add_index
    • remove_index
    • rename_table
  • FireBird - Complete, except for change_column_default and rename_column
  • Derby - Complete, except for:
    • change_column
    • change_column_default
    • remove_column
    • rename_column
  • HSQLDB - Complete
  • H2 - Complete
  • SQLite3 - work in progress

We will install the activerecord-jdbcxxx-adapter, where xxx would be the database name, for example activerecord-jdbcmysql-adapter for MySQL. We are going to use the adapter for a specific database (MySQL). You can install it directly and a driver gem will be installed as well.
Other databases will require testing and likely a custom configuration module.
Ensure that your MySQL service is running.

Open a command window and type:

C:\>jruby -S gem install activerecord-jdbcmysql-adapter

From your JRuby code, you need to specify only the name of the adapter you want to use; ActiveRecord will provide the Ruby bridge code.

The article is continued in Part 2.

References

  1. Practical JRuby on Rails
  2. activerecord-jdbcXXX-adapter

Technorati Tags: , , ,

Posted by Satish Talim

→ 1 CommentTags: ··

Fabio Akita on Locaweb

July 24th, 2008 · Interview, Ruby

Locaweb is a strong supporter of RubyLearning.org and Satish Talim of RubyLearning recently caught up with Fabio Akita of Locaweb, who was kind enough to spare time answering questions posed by RubyLearning. Fabio Akita

Fabio Akita is a Brazilian Rails enthusiast, also known online as “AkitaOnRails”. He regularly write posts on his own blog and had published the very first book tailored for the Brazilian audience called “Repensando a Web com Rails”.

Satish Talim>> Fabio, a warm welcome to you. For the benefit of the readers, can you give some background on yourself and your role in the hosting industry?

Fabio Akita>> Well, I think most people know me better from my AkitaOnRails.com blog where I write tutorials, interviews and all sorts of Ruby, Rails and the “Art of Programming” in general. I wrote the first Ruby on Rails book in Brazil and
leaded some community driven book translations into Portuguese as well. When I realized the potential of Ruby I wanted to use it right away, but there was no market available for me to work on here. I had the great opportunity to spend a year working offshore for the Utah based consulting firm Surgeworks LLC last year and now I am Linux Product Manager at Locaweb. My goal is to carry on the mission I set to myself more than 2 years ago: in order for me to live in the Ruby world, in my home country, I would have to help push the community forward and create a true local market for Ruby related development. That’s also my mission at Locaweb.

Satish Talim>> Can you please give us a brief history of your company, Locaweb?

Fabio Akita>> Locaweb just celebrated its 10th anniversary this year, one decade of excellence in internet hosting services. It started with visionaries Gilberto Mautner and Claudio Gorá in the same garage-style, small budget story that would make you think about San Francisco, Silicon Valley, but it happened in Brazil. By their lead, they survived the first Internet Bubble Crash and leaded Locaweb to become the number 1 hosting company in the country by a gigantic margin, with around 400 employees and 133 thousand clients, hosting more than 220 thousand domains.

Satish Talim>> What are Locaweb’s target markets and what kind of products do you have now?

Fabio Akita>> I would say that we target both the developer community and corporations. Our services include Windows and Linux, shared and dedicated, hosting, allowing for a number of web development technologies such as PHP, ASP.NET, Java and now Ruby on Rails, with more to come. We also pioneered VoIP solutions and offer Exchange based solutions for companies, online storage, gaming servers, among other services.

Satish Talim>> What are Locaweb’s biggest strengths?

Fabio Akita>> There is no such thing as a “perfect thing” and as anybody else we have our share of problems. But what makes Locaweb unique in its area is their crew. All 400 employees, including 100 engineers, and all the leaders, investing resources into refining what we have, researching partnerships, new products and solutions.

We employ Agile processes and more importantly, Agile philosophy, which is rare in this business. The strength of any great company relies on the hands of their people. The company’s philosophy motivates self-improvement which reflects in the way people act and deliver. You can rest assured that whatever is wrong will be fixed and whatever the future holds, we will deliver. And I can say that confidently: we have some of the finest in the industry.

Satish Talim>> Why should somebody choose Locaweb instead of another host?

Fabio Akita>> As “enterprisey” as it may sound, because we can support you and offer you the best solution for your project. As I explained before, we are working hard to deliver great products for the future while enhancing what we already have. We are talking about the long run: this is a company with 10 years of successful history and we are envisioning the next 10 years, this is not a volatile startup, this is a rock solid company. We are always pursuing the best solutions for our customers. And we are listening our customers.

Satish Talim>> Is Locaweb committed to Ruby on Rails and its community? How?

Fabio Akita>> Very committed. Again, we have some of the finest in the industry working here, starting from our CEO, Gilberto, who himself is not only a business man but also a true apprentice of the art of technology. There is no recipe written down in stone on how to do technology, it’s about both engineering and art. It came from the CEO the initiative to pursue Ruby on Rails. He not only envisioned it as a nice looking business: he is also learning the platform itself and the Ruby-way. So he “understands” Ruby on Rails from a stand-point that no other business man around can.

He hired me with the clear mission to deliver the best services around Ruby on Rails to our customers. We want developers to enjoy being our customers, we want this market to finally flourish. This is not a simple matter of installing a module into our web servers and call it a day. It also means understanding and supporting the development communities. The “Rails Summit Latin America 2008” that will take place on October 15-16th is just one of these steps.

Satish Talim>> What was the idea behind Locaweb exclusively sponsoring RubyLearning.org’s Free Online Ruby Programming Course?

Fabio Akita>> Again, when I proposed this idea to our CEO he was immediately able to grasp its value. RubyLearning is a well recognized institution for the international Ruby community. And it is very important that it remains open to the world wide community. There are several Brazilians that learned Ruby through this course and we want many more to join and discover the joy of the Ruby way.

It is totally compatible with our mission: of not only delivering simple services, but also nurturing bold community-driven endeavors such as RubyLearning. I hope it keeps going on, evolving, and graduating more and more Ruby developers that are eager to expand this community.

Satish Talim>> Thanks Fabio for sharing your views with the RubyLearning participants.

Note: This interview is one of my ways of saying thank you to Fabio Akita and Locaweb and not directly influenced or specified by the sponsors.

Technorati Tags: , , ,

Posted by Satish Talim

→ 3 CommentsTags: ···

Guy Naor CTO Morph Labs

July 23rd, 2008 · Interview, Ruby

Morph Labs have been supporting RubyLearning.org for some time now. Satish Talim of RubyLearning recently caught up with Guy Naor (CTO Morph Labs), who was kind enough to spare time answering questions posed by RubyLearning. Guy Naor

Guy Naor is a veteran of the computing and technology world since 1981. Guy’s technology experience spans evolution and revolution eras, where he was involved with multiple companies and projects, working in a wide variety of computing platforms from mainframes to hand held devices as well as dozens of languages and operating systems. In his most recent role, Guy served as CTO of Famundo, a Web 2.0 start-up. Prior to that, he led the development of Goldmine software for four (4) years and had served as an advisor and a consulting architect on a variety of Web 2.0 products. Guy has unparalleled experience in Ruby on Rails (Web 2.0 technology) and is an active member of the open source community, where his libraries and education materials are used worldwide.

Satish Talim>> Guy, a warm welcome to you. For the benefit of the readers, could you tell us something about your self?

Guy Naor>> I am a long time veteran of the computing world. I started as a teenager back in the early 80’s with the earliest personal computers. Since then I programmed and managed development on a huge number of operating systems, languages and frameworks. After many years writing applications on Windows in C++, I decided to switch to web development. Those were the early days of Ruby on Rails, but after a comparison with the rest of the options, and although it was new and lightly documented, I decided to start my web development career using Rails. I am very passionate about technology and it’s real life application. In my spare time I do marathon running, scuba diving and traveling with my family.

Satish Talim>> You are one of the co-founders of Famundo, which is revolutionizing the way families manage their busy lives! Can you tell us more about Famundo?

Guy Naor>> Famundo is a Rails application that came out of my and my partners needs. Having three kids and a busy work life, finding ways to make it easy to manage the hectic family life was a big thing for me. Having roots in CRM systems (I managed the development of GoldMine for four years), I realized a family is not that different from a workgroup in a business. There are different rights, data separation, scheduling, documents, contacts, etc… So we set out to make those always online and available. Famundo is growing constantly, and new versions improving the product are coming out all the time.

Satish Talim>> You are also the CTO at Morph Labs, which is a provider of Platform as a Service for web applications. Can you give us more details?

Guy Naor>> With the experience gained from Famundo and other projects I consulted on, and with a long time of mentoring developers on Rails, I realized that although we have a lot of great developers and ideas, deployment and system management is still hard and complex. It also requires a completely different set of skills from that of developers. When Amazon came out with EC2, it was clear that Grids/Clouds are the future for deployment of web applications. Together with Rails structured deployment and migration tools, we set out to create something that will make deployment as easy as Rails made development. The result of that is the Morph PaaS offering. It made deploying a Rails application a 5 minutes process. And we provide the users with a fully managed, monitored and redundant system. Using a specially designed architecture, we were able to make the offer so cost effective, it’s cheaper to host with us on EC2, than trying to go directly with EC2. It’s a lot simpler, and doesn’t require any special skill. Following the introduction of the Rails platform, we partnered with Webtide and created a similar solution for Java web apps. With a fast moving development team (our own code is all Rails and Ruby based) we are planning on many additions and new features and capabilities.

Satish Talim>> You provide mentoring to enterprises on switching to and developing with Rails. According to you, what have been the major obstacles in the Enterprise adoption of Ruby / Rails?

Guy Naor>> The main obstacle is lack of experience and skills. Enterprises need a lot more time to evaluate and learn how to deploy new technologies. We are seeing great momentum in the last few month, and a lot of Enterprises trying Rails. First on a smaller scale, but as the economic advantages of Rails become clear, it increases penetration. We see a big future for cloud computing in the enterprise. Both public available clouds like Amazon’s EC2 and internal clouds, configured with systems similar to the Morph PaaS platform to facilitate both Intranet and Extranet application deployments and management.

Satish Talim>> Guy you are an active member of the open source community and have contributed code and a plugin to the Ruby on Rails community. What advise would you give Ruby / Rails developers to follow this path?

Guy Naor>> The Rails community is very open and accepting. I had great experience with the community, and have seen many project start from a small contribution and turn into large and popular plugins and gems in a very short time. The secret is to learn Ruby and Rails well (many people forget that Ruby is at the root of it all, and skip learning it deep enough), and have courage to release your code. We are still at the early stages of Rails, and there is still a lot of place for new additions and ideas. And the community really loves to try new things. Much more than any other OS community I was involved in. I also suggest really learning the actual Rails code. I contributed some patches that were accepted into both Rails and Capistrano. But more than I helped the community, working on those patches helped me understand and learn Rails. Reading and understanding the Rails code is something every Rails developer should do from time to time.

Satish Talim>> How do you keep your skills sharp and keep up-to-date with the latest developments?

Guy Naor>> I continue to both code, mentor and code review the code we write at Morph. No matter how much management I have to do, I will always code. This is something I love to do, and help me have intimate knowledge of everything we do. It also helps my team, as they get mentoring and help with knowledge that come from real world experience, not only from theory. In addition to all that, I also read blogs and books related to all the technologies we use, and to new ideas and technologies.

Satish Talim>> According to you, what’s the future of Ruby / Rails?

Guy Naor>> I see a great future for Ruby and Rails. Enterprise adoption will grow at high speed - we already see a big demand for Rails developers. In two years I expect Rails to be accepted as standard language for enterprise development. I do not see it pushing Java out, but more of thriving side-by-side. I am a big believer in tools diversity and in choosing the right tool for the job. It’s the reason I always learned new languages and tools. I also see a lot of frameworks similar to Rails appearing and taking hold (Grails, PHP frameworks, Python frameworks, and new Ruby frameworks - Merb for example). I see all those developments as a sign of Rails maturing and getting into the “big boys” league.

Satish Talim>> Thanks Guy for sharing your views with the RubyLearning participants.

Technorati Tags: , , ,

Posted by Satish Talim

→ No CommentsTags: ····

Locaweb: Exclusive Sponsors of FORPC101 Courses

July 22nd, 2008 · News, Ruby, Training

I am happy to announce that Locaweb are now the exclusive sponsors of all the Free Online Ruby Programming Courses (FORPC101) at RubyLearning.

All this has been possible due to the tireless efforts of Rails Guru - Fabio Akita.

Locaweb, the pioneer and leader in professional hosting services in Latin America, started-up in 1998 in the “garage” style, with two people and a server. Locaweb The company now hosts over 220,000 domains for more than 133,000 clients, numbering over 400 employees besides partnerships with more than 14,000 web site developers. Locaweb serves from casual users to large corporations through its three business units: INTERNET, which offers web hosting services, blogs and podcasts, domain registrations, online virtual storage, hosting reselling, outsourced e-mail solutions, e-commerce, audio and video streaming infrastructure, online gaming and development discussion forums; DATA CENTER, which offers virtual and dedicated servers for a broad range of corporate applications, co-location and a high-security vault room, already serving over 1,200 customers in its own facility built in 2006, with capacity to host up to 4,000 servers; and COMMUNICATION, which offers VOIP-based telephony solutions including Virtual PBX and Voice Portal, started in 2006 and currently operating more than 1,500 PBX extensions.

Locaweb is very very committed to Ruby, Ruby on Rails and its community and recently hosted the Rails Summit Latin America 2008.

Fabio Akita is employed as Linux Product Manager with Locaweb, since July this year.

Technorati Tags: , , ,

Posted by Satish Talim

→ 3 CommentsTags: ····

Charles Nutter talks to RubyLearning Participants

July 21st, 2008 · Interview, JRuby, Ruby

Charles Nutter

On the eve of the new JRuby Course announced by RubyLearning, Satish Talim of RubyLearning caught up with Charles Nutter, who was kind enough to spare time answering questions posed by the RubyLearning participants.

Charles Nutter has been a Java developer since 1996. He currently works full-time as a core developer on JRuby at Sun Microsystems. He led the open-source LiteStep project in the late 90s and started working on Ruby in the fall of 2004. Since then he has been a member of the JRuby team, helping to make it a true alternative Ruby platform. Charles blogs on Ruby and Java at headius.blogspot.com.

Satish Talim>> Many of the RubyLearning course participants have a Java background and are learning Ruby. Why, according to you, must these participants also learn JRuby?

Charles Nutter>> Java is still a great language for building high performance libraries, system code, frameworks and sometimes applications. But more and more it’s not enough to just know Java. We have JRuby, Groovy, Jython, and other languages all showing new ways of looking at the classic problems facing application developers. And learning JRuby is a perfect way to keep up with where development on the Java platform is going.

Satish Talim>> How should they go about acquiring knowledge and skills in JRuby?

Charles Nutter>> You learn best by doing…pick up pretty much any Ruby or Rails book, or go to any Ruby or Rails training session, and see if you can get through it with JRuby. And while you’re doing it, start thinking about where you can take advantage of JRuby’s additional features, like the ability to call Java libraries.

Satish Talim>> What’s the focus of JRuby?

Charles Nutter>> JRuby has two focuses. First and foremost, we want to be the best Ruby implementation we can, providing the best performance, threading, and memory utilization. Second, we want to be the best JVM language we can, providing access to all the libraries you are used to as a Java developer and fitting seamlessly into your Java world.

Satish Talim>> What are JRuby’s long-term goals?

Charles Nutter>> Long term, I see more and more Ruby developers choosing JRuby as their implementation of choice, and I see Ruby becoming a standard and common language for JVM platform developers to use. We’re also planning to keep up with Ruby 1.9’s new features (still in development) and always keep improving JRuby’s performance and Java integration capabilities.

Satish Talim>> What benefits do you think JRuby will bring to the Ruby and Java communities?

Charles Nutter>> For Rubyists, we have a high performance Ruby implementation with native threading and access to everything on the Java platform. For Java developers, we have Ruby, a beautiful and powerful language that’s a lot of fun to write. I think both sides get a lot out of the deal, and we’re trying to make JRuby a perfect combination of the best of both worlds.

Satish Talim>> Does JRuby mark the end of the road for MRI (the standard Ruby implementation)?

Charles Nutter>> Certainly not…and we always recommend that if MRI is good enough for their needs, there’s no reason to update. But if they need better performance, native threading, libraries only available on the JVM, or other such bonuses that JRuby offers, they certainly should consider JRuby. And we’re working hard to help folks make that transition when they’re ready.

Satish Talim>> Anything else you would like to share with the RubyLearning participants?

Charles Nutter>> I’m very excited to hear about more and more developers taking an interest in alternative languages on the JVM. I think it shows what we’re doing with JRuby and what others are doing with Groovy and Jython and Scala is the right way to go. With help from folks like the RubyLearning participants, I think we’re making a better world for developers everywhere.

Satish Talim>> Thanks Charles for sharing your views with the RubyLearning participants.

Technorati Tags: , , , ,

Posted by Satish Talim

→ 1 CommentTags: ·····