Tag Archives: Ruby

Fixing lousy introspection support in Python DB APIs (partially)

For my internship at Think Wize, I’ve been working on a custom Django management command that compares the current model definitions (models.py) and the current database schema, and tries to spot the differences. I’ve called it checkdb. Optionally it can also attempt to fix them, with checkdb –fix.
syncdb is not agile
Django’s syncdb management command, used [...]

Scoped mixins

A while ago I read one of Peter Harkins’s posts about open classes in Ruby, and how insanely awesome and useful they are. As you can probably tell, I wholeheartedly agree. Open classes are just one of those things that make me choose Ruby over pretty much anything else, whenever I get the chance to [...]

Installing Phusion Passenger on Ubuntu 8.04

There seems to be a bug in passenger-2.0.6 that makes the Apache module installation fail. I was just installing Ruby Enterprise Edition 1.8.6-20081215 and Phusion Passenger (AKA mod_rack or mod_rails), and it bailed out on me saying:
root@evidence:~# /opt/ruby-enterprise-1.8.6-20081215/bin/passenger-install-apache2-module
[...]
Compiling and installing Apache 2 module…
cd /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/gems/1.8/gems/passenger-2.0.6
/opt/ruby-enterprise-1.8.6-20081215/bin/ruby -S rake clean apache2
/opt/ruby-enterprise-1.8.6-20081215/bin/ruby: No such file or directory — rake [...]

define_method and argument semantics

define_method is an odd creature. Paul Gross’s post about its unusual behaviour inspired me to do some research. I even went and browsed through Ruby’s source to attempt to understand it, but that turned out to be unnecessary: I reimplemented it in pure1 Ruby. In this post, I’m going to try and explain why [...]

Merb is getting merged into Rails 3! Hell yes!

Rails is an MVC web development framework for Ruby. Rails is awesome and magical! Rails helps speed up development, and it’s just a lot of fun to use because it takes care of all the stuff that is annoying about developing web applications. Most of it, anyways.
Merb is an MVC web development framework for Ruby. [...]

Prime Factorisation

Project Euler rocks. Someone showed me what it was all about a few days ago. Basically it’s a collection of questions that can be answered with an integer. The idea is to write efficient algorithms to calculate this answer in the programming language of your choice. My choice should be obvious by now
Anyway, [...]

Deep Thought

puts !?*?!?#:%%%+%?%#{”%c”%(?/+?@)}?%?”+%#!#*(?)-?()#”
Look at this baby. Try and feed it to Ruby and be amazed. My syntax highlighter can’t even handle it
Mikoangelo from #ruby-lang crafted it in a good five minutes, and it took me about five times longer to decipher it again I’ll break it down now, because, well, I have [...]

Musings on Combinatorics and Set Theory

… just kidding
These are a few methods I wrote for the Rudoku project, mainly to work with arrays of arrays representing sets (most of them assume that the arrays contain only unique elements).
I’m going to dump them here for future reference. Told you this was a pastebin
If anyone can suggest any [...]