» Archive for October, 2007

Be careful when you want to register domain name from Netfirms

Tuesday, October 30th, 2007 by rubypdf

Some days ago, I got the price of domain name is only $4.99 from a blog, but when I visited the website today, it said $5.95, I thought $5.95 is also not bad, but when I review the whole page, I found this notice(very small font),

* Pricing is $5.95 for first year. Domain will renew at $9.95 per year thereafter. Limit five $5.95 domain names per customer.

So if you just want to use the domain only one year, it is a choice for you.

How to Backup MySQL database and email results using BASH and php

Saturday, October 27th, 2007 by rubypdf

Today, my customer asked me how to backup MySql database on dreamhost, I said you can use php script or some plugin for wordpress(he want to install wordpress on his website), then he asked how did I backup my database, I said I am so lazy that have not backup any database.
I have bought the hosting service from dreamhost over 1 year, but never backup my database, it seems it is not a good idea. so I decide to study how to backup my database.
The easiest way is searching google to get the answer for me. the keyword is “dreamhost mysql backup”, and I got many result, and I tried this one, it works.

reference links,

jXLS is a powerful but small and easy-to-use library for exporting Java beans to Excel using XLS template file

Thursday, October 25th, 2007 by rubypdf

Excel generation is required in many Java applications that have some kind of reporting functionality.
The most complete library to manipulate XLS files from Java is
Jakarta POI library.
The problems appear when it is required to create a lot of custom and complex Excel reports with rich formatting and enhanced functionality.

In this case you have to write a great bunch of Java code for creating workbook with all required formatting, formulas and other specific settings and correctly export data from a set of Java objects.
Such code is hard to debug and the task of its creating is usually errorprone and timeconsuming. The other problem is that there are many Excel components for which there is no manipulation API provided.

Fortunately
POI API allows to read Excel file trying to preserve it as is and then modify it as required.
It is obvious it would be much easier to create all correctly formatted report template in some Excel editing tool and specify places where real data should appear.

jXLS is a project that implements this approach and allows creation of extremely complex Excel reports just in several lines of code.
All you need is to create XLS template file with all required formatting, formulas, macros etc using
specific notation to indicate placement of data and then write a couple lines of code to invoke jXLS engine passing XLS template and the exported data as parameters.

Main Features

  • Using SQL queries directly in XLS templates
  • Simple property access notation
  • Full expression language support
  • Complex object graph export
  • Flexible collection export
  • Flow-Control Tags support
  • Dynamic grouping of data
  • Export of a single collection into multiple worksheets
  • Adjacent tables support!
  • Complex formulas support
  • Charts, Macros and many other Excel features in XLS template
  • Dynamic Outlines
  • Dynamic Columns Hiding
  • Dynamic Cell Style processing through custom Processors
  • JDBC ResultSet export
  • Merged Cells support
  • Multiple bean properties in a single cell
  • Reading XLS files

In your XLS template you can use any Excel features which are preserved by
Jakarta POI when reading and writing XLS files. Particularly it means you can use Charts and Macros in your XLS template and many other features

relative resource:
Using jXLS and jXLSUtiltiy.cfc to export Excel files