Archive for December, 2006

fix CSSToFOPNew.java in css2xslfo

if (configFile != null)
{
  /*
  fop.getUserAgent().setUserConfig
  (
    new DefaultConfigurationBuilder().buildFromFile(configFile)
  );
  fop.getUserAgent().initUserConfig();
  */

  fop.getUserAgent().getFactory().setUserConfig(configFile);
}

opening a file in ruby

File.open("testfile", "r") do |aFile|
# ... process the file
end

remove duplicates from mysql tables

#temporary table to hold the duplicate free data
create temporary table good_temp
(
  id int(11) unsigned not null auto_increment primary key,
  name varchar(255)
) TYPE=HEAP;

# assigning fresh auto_incremented ids without holes
insert into good_temp(name) select distinct(name) from bad order by id;

# delete old records containing duplicates
delete from good;

# insert duplicate free records from temporary table
insert into good(name) select * from good_temp;

java -classpath in combination with java -jar

Since I always forget about that damn detail, it’s time to write it down! Whenever you need to give -classpath parameters at start time, be sure not to use the -jar option at the same time! Go for the main class in the jar instead!