Skip to content

Instantly share code, notes, and snippets.

View mdellabitta's full-sized avatar

Michael Della Bitta mdellabitta

View GitHub Profile
@mdellabitta
mdellabitta / gist:1444003
Created December 7, 2011 18:32
how do do spring jdbc transactions with jdbctemplate/transactiontemplate
public class ExodusWriter {
private JdbcTemplate jdbcTemplate;
private TransactionTemplate transactionTemplate;
public ExodusWriter(DataSource dataSource) {
DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(dataSource);
jdbcTemplate = new JdbcTemplate(transactionManager.getDataSource());
transactionTemplate = new TransactionTemplate(transactionManager);
}
@mdellabitta
mdellabitta / gist:1331881
Created November 1, 2011 20:57
Using Kakadu to make JPEG2000s out of a folder of images
#!/usr/bin/env ruby
kdu_compress = ???
Dir.open(in_path).each do |in_file|
j_file = ???
success &= system(kdu_compress, "-quiet", "-i", in_file, "-o", j_file, "-jp2_space", "sRGB", "Creversible=yes", "-rate", "-,1,0.84,0.7,0.6,0.5,0.4,0.35,0.3,0.25,0.21,0.18,0.15,0.125,0.1,0.088,0.075,0.0625,0.05,0.04419,0.03716,0.03125,0.025,0.0221,0.01858,0.015625", "Clevels=6", "Stiles={1024,1024}", "Cmodes={BYPASS}", "Corder=RLCP")
end