Monday, April 21st, 2008

Converting Paradox tables to MySQL sql in Linux

Problem
You want to convert some legacy tables created in Paradox (.db, .px) to another format so you can use it in MySQL.
Solution
Download the px tools from here.
Follow the instructions, in the INSTALL file after you untar the file.
You should have to do the usual three step linux installation:
configure
make
sudo make install
Afterwards to make sure that the [...]

No Comments » - Posted in linux by kosmas

Wednesday, October 17th, 2007

File column plugin with ActiveScaffold upload branch

When using the file_column plugin in the active_scaffold upload branch, the documentation in the file_column doesn’t make it clear what we have to change to make it work.
In the example below the model is number and the file_column is intro.
1. In models/number.rb add:
file_column :intro
2. in controllers/numbers_controller.rb, make sure we have:
config.create.multipart = true
config.update.multipart = true
3. in [...]

No Comments » - Posted in ruby on rails by admin

Wednesday, October 17th, 2007

Get a random record in Ruby on Rails - MySQL

To get a random record from MySQL in Ruby on Rails use:
User.find(:all, :order => ‘rand()’)

No Comments » - Posted in ruby on rails by admin