Entries Tagged as 'Ruby'

Wednesday, March 16th, 2011

Project Euler: Problem1/Variation2 – Add all the natural numbers below one thousand that are multiples of 3 or 5

My previous post contained my first variation for solving Problem 1 of Project Euler. A basic loop was intentionally used to illustrate a brute force method of determining the answer. The solution is easy to understand and the code is very simple. For Variation 2, I decided to simply refactor Variation 1 so that it [...]

Wednesday, March 16th, 2011

Project Euler: Problem1/Variation1 – Add all the natural numbers below one thousand that are multiples of 3 or 5

Problem 1 on Project Euler was posted on October 5th, 2001 (just days before my birthday). I’m solving the problem nearly 10 years later! And since it’s one of the early ones, it’s quite simple. The problem description is as follows: If we list all the natural numbers below 10 that are multiples of 3 [...]

Monday, September 27th, 2010

Refactoring a Ruby on Rails Navigation Helper

I was going through some code in an older Rails application’s code base of mine in order to migrate it from 2.1.x to 2.3.9 and finally to 3.0.0. My primary task at hand was to migrate the code to Rails 3.0.0, so I avoided getting too sidetracked into modifying code that didn’t need it specifically [...]

Tuesday, April 28th, 2009

Script It: Convert A List Apart articles to PDFs

Several times a week, I find that I need to automate a task to save me considerable amounts of time. The following is an example of this need. I wanted to share the thinking behind the task and the code with you. Improvements and suggestions are welcome. Submit them as comments to this article. This [...]