Meditations on programming, startups, and technology
Currently Browsing: Quick Tips

Getting Stuff Done With the Pomodoro Technique

The problem with many productivity techniques is that they introduce undue bureaucracy into one’s workflow. I do not need to be coerced into getting my tasks done, and appreciate simple aids that don’t get in the way of actually accomplishing the goals I’ve set (in other words, tools that grant me the ability to get and stay more organized, on track, and focused). This is why I use a simple technique for...

Things I’ve learned from hiring interns for IBM

A few months ago I blogged about the fact that IBM was looking for two interns to fill a longterm (paid) internship. The good news is that after an extensive selection process and a hearty dose of governmental bureaucracy (which is not unusual when relocating countries), two students have finally been able to join our DB2 team at the lab. In case you are curious about who the students are, they’re Marius Butuc...

Who is accessing your Gmail account?

The Gmail team recently introduced a new feature (in the footer) that enables account holders to verify the latest login activities on their account. I routinely check mine and the results are usually boring, reminding me I check my email way too often (and I do so mostly via browser, through my Canadian IP). An unwelcome surprise If you don’t check yours regularly, you should (my version of Google Apps...

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...

Add code highlighting to your Google Waves

Google Wave is still rough around the edges, but it has a lot of potential in terms of becoming a great collaboration tool. As a developer, your first question will probably be: “How do I add code highlighting to my waves?”. The answer is straightforward, however not very easy to find if you google it. I hope this post will help fellow developers who are experimenting with Google Wave. The following...

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...

Serving Django Static Files through Apache

Django’s development server is capable of serving static (media) files thanks to the view django.views.static.serve. Popular web servers like Apache, Lighttpd or NGINX are much faster though, and as such should be used in production mode. Our goal is to bypass Django and let Apache (or other valid alternatives) directly serve static files like images, videos, CSS, JavaScript files, and so on, for us. Generally...

Memoization in Ruby and Python

Wikipedia defines memoization as “an optimization technique used primarily to speed up computer programs by having function calls avoid repeating the calculation of results for previously-processed inputs.”. This typically means caching the returning value of a function in a dictionary of sorts using the parameters passed to the function as a key. This is done in order to reuse that returning value...

Resolving the gray window when running db2setup

You drank the Kool-Aid and downloaded the awesomeness which is DB2 Express-C. Good job! Next you proceed to install it on Linux with sudo ./db2setup and boom, instead of a launchpad all you see is a gray window. Now what? This problem is a known Java bug (resolved in Java 6) that shows up on Linux distros where Compiz effects are enabled. For example, this problem manifests itself in recent Ubuntu releases,...

Integrating TextMate and Pygments

Like many, I don’t use TextMate just for coding. All of my posts are first drafted in my trusty editor before being published. One of the problems that I had, and that others probably face too, is the less than smooth process of publishing properly highlighted code in posts and HTML pages. A few solutions exist, including embedding gist snippets, using “Create HTML from Document” in TextMate, or...

This Week in Ruby (May 29, 2008)

This is the 9th episode of This Week in Ruby, please consider subscribing to my feed so as to not miss any weekly installments. Ruby Two days ago JRuby 1.1.2 was released. Amongst several bug fixes and improvements, this release is characterized by a focus on performances. Startup time, threading, method calling and YAML symbol parsing have all been drastically improved. Huw Collingbourne of SapphireSteel, has...

Using Python to detect the most frequent words in a file

Working with Python is nice. Just like Ruby, it usually doesn’t get in the way of my thought process and it comes “with batteries included”. Let’s consider the small task of printing a list of the N most frequent words within a given file: from string import punctuation from operator import itemgetter N = 10 words = {} words_gen = (word.strip(punctuation).lower() for line in...

Installing Django with PostgreSQL on Ubuntu

This how-to is essentially the same as my previous one, only this time I’ve provided step-by-step instructions for installing Django with PostgreSQL on Ubuntu 7.10. First and foremost, we are going to install Django from its svn repository, as opposed to obtaining the 0.96 release archive. The reason for this is that the trunk version implements a few new features. The development code is also rather stable...

How to install Django with MySQL on Mac OS X

Installing Django on Mac OS X Leopard is supposed to be very straightforward, but if you are new to it, you may encounter a few puzzling questions and, in the case of MySQL, even a couple of headaches. I’m writing about this for the benefit of those of you who may attempt and struggle with this feat. MacPorts is not required for this how-to. First and foremost, we are going to install Django from its svn...

Installing DB2 9.5 on Ubuntu 7.10

The official IBM site now has DB2 Express-C 9.5 available for download. Like its previous versions it’s entirely free, so why don’t you give it a try? When running db2setup, after extracting the archive you downloaded, you may be disappointed to see that on Ubuntu 7.10 the setup program gives you the following error right out of the box: ERROR: The required library file libstdc++.so.5 is not found on...

Redirecting Atom feeds from Typo and WordPress to FeedBurner

With the recent switch from Typo to WordPress I had to address the issue of handling my existing and new feeds. On top of that I decided that it was the right moment to switch to FeedBurner, so I had to handle the redirect for both Typo and WordPress at the same time. If you prefer Atom 1.0 over RSS 2.0 (you should), this brief post will tell you how to migrate to FeedBurner and Atom. Where is your Atom feed? When...

Ruby and Rails books, Textmate and FastRi

Ruby and Rails books keep popping up on the (virtual and real) shelves, which means that it may be slightly puzzling for newcomers to decide which books to spend their hard earned cash on. In the spirit of providing guidance in this process, I’ve prepared the Recommended Books for Ruby and Rails page. The recommendations are organized by skill level and should provide the reader with a nice logical sequence of...

Top 10 Ruby on Rails performance tips

Please note that this article is now obsolete. The performance of Ruby on Rails is influenced by many factors, particularly the configuration of your deployment server(s). However the application code can make a big difference and determine whether your site is slow or highly responsive. This short article is about some of the tips and best coding practices to improve performances in Rails only, and won’t...

Typo errors on postponed articles

This is a tip that I’m writing in the hopes of helping Typo users who will google for the following error messages uninitialized constant ActionController::TestRequest or undefined method `publish!’ for nil:NilClass. While publishing an article on db2onrails.com, I’ve selected a future publishing date for the post (just to round it off to the half an hour mark). I’ve performed this operation...

A step by step guide on how to install Django with PostgreSQL on Windows

This is a step by step tip about how to install Django with PostgreSQL on Windows. The links below point directly to the downloads, so the whole procedure should be extremely fast and easy. Install Python 2.5 Install PostgreSQL 8.1.4 Install the eGenix MX Base package Extract win-psycopg25.zip and copy libpq.dll and psycopg.pyd to c:\python25\DLLs (assuming c:\python25 is where you installed Python). You can test...

« Previous Entries

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