Rails + SQL Server 2000 on Windows XP

Obviously they are not a perfect match, but somehow I need to get this done. I did this on Windows XP with SQL Server 2000 (PE) Service Pack 4.

  1. Install Ruby 1.9.2-p0
  2. Install DevKit
  3. Install rails gem install --version 2.3.9 rails
  4. Install ruby-odbc gem install ruby-odbc --platform=ruby
  5. Install activerecord-sqlserver-adapter gem install --version 2.3.10 activerecord-sqlserver-adapter
  6. Create an ODBC data source
  7. In config\database.yml,

adapter: sqlserver mode: odbc dsn: your_dsn_name host: localhost username: sa password: your_password database: your_database encoding: utf8

Bonus

If you wish to add some custom gem configuration , you should create .gemrc file in your home directory, mine is C:\Documents and Settings\username.

Dave Newman: Leaving .net →

We are, as software developers, in various states of alone-ness.

A company I worked at once had been operating for years under the assumption that it was OK for software to take months to integrate and deploy; they had never heard of continuous integration. They thought it was normal to rewrite…

(Source: whatupdave)

Measuring complexity of Ruby 1.9 code with metric_abc →

metric_abc is a tool that can help you find bad code in your Ruby 1.9 projects. It is much simplier cousin of Flog, but does the job in absence of Flog in Ruby 1.9 world.

Ruby-based regular expression editor →

Rubular is a Ruby-based regular expression editor. It’s a handy way to test regular expressions as you write them.

Code Readability: Quick, Millions or Billions? →

Ruby allows underscores to be inserted into numbers between any two digits. The underscores are purely cosmetic and do not affect the value of the number. This feature allows a developer to use underscores as an accountant might use commas.

3193490646      # standard representation of a number in ruby
3_193_490_646   # same value, much more readable

One less excuse for order of magnitude errors when using ruby.

The surprising truth about what motivates us. 3 Factors lead to better performance and personal satisfaction.

Understanding and Applying Polymorphism in PHP →

In object oriented programming, polymorphism is a powerful and fundamental tool. It can be used to create a more organic flow in your application. This tutorial will describe the general concept of polymorphism, and how it can easily be deployed in PHP.

Live your life in such a way that when your feet hit the floor in the morning, Satan shudders and say…”Oh, shit..he’s awake!!

Git: How to checkout a tracked remote branch

git checkout --track -b <local branch> <remote>/<tracked branch>

How to disable CakePHP to update the ‘modified’ field

Set modified to false in your data array

$data['Item']['id'] = 2;
$data['Item']['name'] = "Foo";
$data['Item']['modified'] = false;
$this->Item->save($data);

(Source: cakeqs.org)