Skip to main content

Posts

Showing posts from October, 2007

Finish the new Tarpri.com

I decided to help some people by re-designing the Tarpri.com website because the joomla's ez-store component stopped working. Thanks to the ruby-powered, website generator Webgen and websites with open web designs, the process of creating the website went somewhat smooth. If you want to use Webgen to generate your website, you should download the example personal website to learn how to use Webgen. I had a small problem with generating php files; when following the example in the website for outputNameStyle which is the custom page name output format, I got an "invalid URI" message when running webgen. I solved it by using: outputNameStyle: [:name, [”.”, :lang], .php] in the meta info section of the .page file for the English version of the page. outputNameStyle: [:name, ., :lang, .php] in the meta info section of the .page file for the spanish version of the page.

Semi-Automated Mail Merge in OpenOffice

I released a new version of my MailMerger application ( http://rubyforge.org/projects/mailmergehelper/ ) . The application now uses java and ruby to automate the collection and processing of csv data to be merged. It uses a java class that can transform csv to ods (OpenOffice Calc document) and viceversa and html to ods. The Writer mail merge template must use a datasource that links to an ods spreadsheet. It works with OpenOffice 2.3. The program has helped me alot at work, where we use it to automatically take the html data produced by RenWeb's create-a-report and convert it to ods so that OO Writer can use it for mail merge. The program also allows for custom ruby scripts to process the data before is sent to Writer. I also found that the best way of doing labels in OpenOffice is to download the Microsoft Word templates from the Avery website and then convert them into odt.

Content files not available in Typing Master

I got an error when trying to open Typing Master's User Manager. The error said that the content files were not available. To fix the error, I search for any changes made to the shared Typing Master folder and noticed that the lessons folder was missing. I reinstalled Typing Master to add the folder again. Surprisingly, the re-installation did not delete any of my user data files, all of the student's information was there intact.

How to connect to CSV files using Ruby DBI ODBC and no DSN

I had a hard time finding a way of connecting to csv files using ruby's dbi through the odbc driver without using a DSN. The odbc turned not to work with Microsoft Text driver for odbc because the name of the driver has a semicolon in it. Thus, the ruby code fro the driver was splitting the name of driver, resulting in a keyword syntax error. The following is the (working) code that shows how to connect to csv files using dbi and odbc, note that I had to override require to add the fix to the odbc driver because dbi loads the driver using require : require "dbi" alias :old_require :require def require(library) old_require(library) if library.downcase.include?("odbc") define_odbc_fix() end end def define_odbc_fix DBI.class_eval <<-'THERE' module DBD module ODBC class Driver < DBI::BaseDriver #JPT: fixed to allow the ";" character in the connection string. # Obeys the rule of "If a