Meditations on programming, startups, and technology
Currently Browsing: Ruby

Speeding up queries by a factor of 100 or more with DB2 Text Search

During a recent Rails project at IBM we had to deal with a large table consisting of customers. The table is made up of legacy enterprise data, and contains close to a million records. Among many other fields, the table Customers includes a column name defined as VARCHAR. name is used to store company names. One of the requirements for the project was to implement a Google Suggest-like feature. That is, when...

10 Ruby One Liners to Impress Your Friends

Someone came up with a list of 10 one-liner examples that are meant to showcase Scala’s expressiveness. A CoffeeScript version quickly emerged, so I thought I’d publish a Ruby one. I find Ruby’s syntax to be a bit cleaner than Scala’s, but the substance (at least as far as these examples are concerned) is relatively similar. Multiply each item in a list by 2 (1..10).map { |n| n * 2 } Sum a list of...

Installing Ruby on Rails and DB2 on Ubuntu 11.04

In this tutorial I’ll show you how to create a complete Ruby on Rails setup for DB2 on Ubuntu. Following my step-by-step instructions, you’ll be able to install the following components: Ruby 1.8.7 Rubygems Ruby on Rails DB2 Express-C 9.7.4 The official Ruby driver and Rails adapter for DB2 Installing Ruby We are going to install Ruby 1.8.7 using the Debian packages that are available in the default...

Interview with Michael Hartl, author of the Rails 3 Tutorial

The following is an interview with Michael Hartl, author of the popular Rails 3 Tutorial. I want to thank Michael for his time and answers. Be sure to read until the end; as per Monday’s post, I’m doing a Twitter giveaway for this interview, too. 1. How did you go from Theoretical Physics to Ruby Programming? I have a background in computational physics, and I learned Perl and then Python to avoid the...

Eloquent Ruby Review

In 2007 Russ Olsen published Design Patterns in Ruby (US | UK | CA). Right around that time there were several other Ruby books hitting the shelves (as Rails was really reaching the peak of its popularity), however Olsen’s book managed to distinguish itself as a highly valuable resource for readers who wanted to better understand how to apply design patterns to Ruby programming (in an organic rather than dogmatic...

The recommended Ruby and Rails book pages have been updated

During the holiday lull I managed to finally update the Ruby and Rails book pages. The Ruby page includes a few new titles and sees a few existing ones get the axe, as I took the major emphasis on Ruby 1.9 into consideration when updating this list of books. The Rails page is a complete rewrite as I’ve removed any trace of Rails 2 books. I outlined a useful path of Rails books to follow based on the few...

StreamSend is looking for a senior (Rails) web developer

This is just a quick heads up for my US readers. Given the tough economy we’re all battling, I thought you might be interested in learning about a great employment opportunity. My friends at StreamSend are looking for a senior web developer (preferably one with Rails experience, however they don’t discriminate as long as you can learn quickly and have enough web development expertise to satisfy their...

The Great Ruby Shootout (July 2010)

The Great Ruby Shootout measures the performance of several Ruby implementations by testing them against a series of synthetic benchmarks. Recently I ran Mac and Windows shootouts as well, which tested a handful of implementations. However this article reports on the results of extensive benchmark testing of eight different Ruby implementations on Linux. The setup For this shootout I included a subset of the Ruby...

Thoughts on Clojure

Lisp has had a tremendous impact on the world of programming. Even though Common Lisp and Scheme — the two main Lisp dialects — may not be considered mainstream today, several popular languages have been influenced by one or both of them. It isn’t stretching things too much to say that both Ruby and Python can be seen as slower, easier (for beginners), object-oriented, infix Lisp dialects. Some may...

The Great Ruby Shootout (Windows Edition)

This post contains the results of a Ruby shootout on Windows that I recently conducted. You can find the Mac edition, published last month, here. I was planning to have this one ready much sooner, but a couple of serious events in personal life prevented that from happening. Be sure to grab my feed or join the newsletter to avoid missing the upcoming Linux shootout. The setup For this shootout I included a subset of...

Padrino: a Ruby framework built upon Sinatra

From the Padrino’s site: Padrino is a ruby framework built upon the excellent Sinatra Microframework. Sinatra is a DSL for creating simple web applications in Ruby with speed and minimal effort. This framework makes it as fun and easy as possible to code increasingly advanced web applications by expanding upon Sinatra while maintaining the spirit that made it great. The Ruby community has plenty of web...

Benchmarking MacRuby 0.6

Recently MacRuby 0.6 was released. The development team put a lot of emphasis on improving compatibility with Ruby 1.9, and the viability of MacRuby as a tool for developing Mac OS X applications. Focus on these aspects took precedence over performance, but I was still curious to see how well it performed when compared to Ruby 1.8.7 and Ruby 1.9, respectively. This article showcases the results of a small Ruby...

Setup Ruby Enterprise Edition, nginx and Passenger (aka mod_rails) on Ubuntu

The following is a very short guide on setting up Ruby Enterprise Edition (REE), nginx and Passenger, for serving Ruby on Rails applications on Ubuntu. It also includes a few quick and easy optimization tips. We start with setting up REE (x64), using the .deb file provided by Phusion: wget http://rubyforge.org/frs/download.php/66163/ruby-enterprise_1.8.7-2009.10_amd64.deb sudo dpkg -i...

Getting MacRuby’s compiler to work

There is major news in Rubyland today. MacRuby’s team just released their fist beta of version 0.5 (an experimental, still incomplete version of Ruby), which brings JIT, removal of the dreaded GIL (Global Interpreter Lock), native threads, GCD (Grand Central Dispatch) for multicore computing, and a whole new set of features found in the release announcement to the table. The most important new feature is the...

Improve the speed and security of your SQL queries

An easy way to improve the performance and security of SQL queries is to replace literals with parameters. By replacing literal values with parameters, advanced relational databases will be able to compile your queries and have their execution plans cached. This saves time and precious resources when the same query (minus the actual values) is executed over and over. Consider the following series of...

Installing the Ruby driver for DB2 on Mac OS X Snow Leopard

Now that Mac OS X 10.6 is out, it’s time to leave the world of 32 bit computing behind. The pre-installed Ruby interpreter will run in 64 bit mode by default, so you may need to pay attention when installing some C-based gems. The ibm_db Ruby gem for DB2 can easily be installed or updated to the latest available version by following these simple steps: $ sudo -s $ export...

Recommended Ruby and Rails books (August 2009)

I finally got around to updating the Ruby and Rails book pages. The existing list was getting a bit obsolete and I didn’t like the idea of recommending old books to newcomers. I also had some interesting new entries. Without further ado: Recommended Ruby Books Recommended Rails Books A few people may disagree with the choices, but I think most experienced Ruby and Rails programmers, who’ve read those...

How much faster is Ruby on Linux?

In a previous article I compared the performance of Ruby on Windows, built through Microsoft Visual C++ and GCC. The numbers for the MinGW version were very impressive. So the question now becomes, how does its performance compare to that of Ruby on Linux? To quote one person (Alex) who commented on the aforementioned post: With the new mingw32 substantial speed improvements, think it makes sense now to also test...

On Scala’s future

Kenneth McDonald posted the following question about Scala’s future in the Scala mailing list: I thought it would be interesting to find out people’s predictions for how much of the Java market Scala will eventually penetrate. It’s nice to see Scala doing reasonably well so far, so now’s your chance to make a prediction on the future of Scala: a) Scala will remain a niche language, competing...

A faster Ruby on Windows is possible (benchmarks for 4 implementations inside)

In yesterday’s post I compared IronRuby 0.9, Ruby 1.8.6 (from the One-Click Installer) and Ruby 1.9.1 (downloaded from the official site) against one another. IronRuby did great, but the discussion in the comment section quickly veered towards what version of the One-Click Ruby Installer should have been used. I justified my choice of using the “old” One-Click Installer, by the fact that I...

« Previous Entries

Copyright © 2005-2011 Antonio Cangiano. All rights reserved.