Archives for April 2008

AIR MySQL Data Import Tool

As they say necessity is the mother of all invention. In this case I need a simple tool to prep comma delimited files before importing them into a MySQL database. I had tried using the tools provided in PhpMyAdmin for importing csv and tab delimited text files without any luck. Each file required some tweaks for string delimiting, column names, etc. After a few hours of frustration I decided to create a tool to convert csv and tab delimited text files into import or update SQL statements, which can easily be used in any RDBMS. Download it here.

The import tool is super easy to use. First you select the csv or txt file you wish to import, set a few options for the import type, string delimiting and how to handle the column headers. Next you can view the columns contained in the file, you can edit the names to be used for the SQL statements and also exclude any columns from the import. Once the setup is complete you can run a quick preview to see how the data will look. If everything looks good you can generate a file that you can use in MySQL or any other RDBMS to import or update data. At any point after selecting the file to import you can also generate the sql file if you wish to skip the steps in between by clicking the 'finish' button.

Step 1 - Setup options

Step 2 - Column Setup

 

Step 3 - Import Preview

 

This is just the first pass at this tool, I'm sure there are a few bugs I have not run across yet, so please feel to try it out and report back on any bugs or issues you run across, or any features you  would like to see added.

Degrafa Pie Chart

A friend of mine asked if it was possible to create a pie chart component using Degrafa instead of using the Flex pie chart component. Before this I had only looked at a few Degrafa samples but had never actually tried to create anything using their classes. I hummed and hawed and wondered how I would come up with something useful that looked good and functioned properly.

After a few hours of tinkering around and getting the basics of Degrafa down I came up with a rough first pass at a pie chart. A few more hours of how to build in the right functionality for handling different sized data sets and interpolating the data when the data sets changed and I came up with my first version (follow this link to see the source code) of a functional pie chart. For a first pass I'm pretty happy with how it turned out. There is still obviously a lot to add in, like labels and event handling, but the basics are there. Overall the learning process was not to painful.

The Degrafa docs are little lacking in places, especially when it comes to creating objects that can fire events (ie click, mouse over). Thankfully they have a ton of good samples and by picking apart some of the source code I was able to figure out some things the documentation did not really cover.

 

Click here to get to the source code.

Now that I have the basic of a decent chart component in place I will hopefully find some time to build in some additional features and also create some additional charting components like a bar and line graph. Stay tuned for more details.