I just googled around on how to do migration from MySQL to postgresql. I ended up with unavailable script of phyton. However, I found Use mysql-postgresql-wizard of component EnterpriseDB which can be used to . You can download the source from here:
http://downloads.enterprisedb.com/src/mysql_pg_wizard_src.zip
You need to download Apache Ant to build the source. I use Apache Ant 1.7.0. Use the following command on how to build the jar file:
ant dist
Executing the above command will produce a jar file which is MigrationWizard.jar. To get the wizard of migrating the mysql to postgres, you need to execute the jar file using the following command in the
java -jar MigrationWizard.jar
The following wizard should be poped up once you execute the above command.
Tuesday, September 15, 2009
Migrate MySQL to postgres
Tuesday, August 18, 2009
Event Handler on jQuery
Just tried to implement event handler in jQuery. The first impression that I have is simple, easy and straight forward. Yeps, what do you need to do is just binding event name with certain function and then of course, you need to trigger the event.
Below is an example on how to bind the certain object in javascript using jQuery:
$(document).bind('kampred.facebox', function(){
alert("si kampred");
});
The above will bind event named kampred.facebox to object document. In order to call this event and let the handler execute the function. What you need to do is to trigger it. Below is the example on how to do it.
$(document).trigger('kampred.facebox');
Calling the above line, will trigger the event kampred.facebox. Of course, it will prompt you an alert box. Its simple, isnt it.
Monday, July 27, 2009
facebook's box alike
After quite long doing research on how to display a popup like what is in facebook, I found a way to do so. It is a jquery plugin which name is facebox (you can google this). Basically, the basic functionalities of this plugin is poping up a window which contains an information from certain dom. Start from this understanding, it can be improved to insert an information from another page (using xhr). Of course, when i say using xhr, it can only fetching data from the same domain as xhr cannot be used to fetch data from different domain.
Well, in this blog, i would like to share the way it works in a bit high level for the operation of fetching data from another page. Basically, this plugin only fetch the data from another page and insert it in a dom. Of course, it will be hidden. After fetching the data, there will be a decorator manipulation which is the popup window itself and grab the information from the dom and put it in the popup window. Well, that's all. Its simple, isnt it? Of course, for my need, I tweak it a bit.
Below is the picture of my try where the information is grabbed from Twitter.
Sunday, July 26, 2009
Transaction, maintainability and performance
Transaction management strategies on high performance application. This is an interesting topic, I guess, since many of enterprise applications have such problem.
Most of the enterprise applications are having a problem of performance because they maintain ACID in every of their transaction. Thus, the transaction will be atomic. Imagine that we have a few transactions, 100 transactions maybe, that we need to maintain the atomic-ity of these transactions for only one action of user (clicking certain button). And definitely, the user of some applications are not only 1, so it will cost more slowness. The more users who access your application at the same time, the more slow of your application will be.
Sometime, we sacrifice performance for application's design. we usually choose to have a good design of the application rather than a high performance of application. For example, the use of ORM, let's say hibernate. Using this kind of ORM, definitely, will slow down your application. But, it will make your application more portable if you want to use another database and also, it will make the code of your application much more maintainable.
This kind of trade off cannot be avoided. It will always exist in every of software development. However, it needs to be assessed and evaluated so that those factors can benefit end user.
One thing that may come on your mind is the use of stored procedure to leverage the performance. Why does stored procedure can be used to leverage the performance instead of having plain sql? Because stored procedure is a precompiled sql statement and also less data being transferred between application and database server. Unfortunately, not many ORM fully support store procedure. The only ORM that I know which supports store procedure is Hibernate. For detail about store procedure can be seen on the link below:
http://docs.jboss.org/hibernate/stable/core/reference/en/html/querysql.html#sp_query
