MySQL Migration Toolkit missing?

July 29th, 2010 Albert No comments

To facilitate migration of data between different databases to MySQL, MySQL has a useful tool that came with the MySQL GUI Tools Bundle. The bundled tool is called MySQL Migration Toolkit.

However, following the release of MySQL Workbench, which is meant to be an upgrade to the GUI Tools Bundle, the Migration Toolkit seems to have been dropped. It is nowhere to be found in the new Workbench. I do not understand the rationale of dropping support for such a wonderful tool, which allows for easy migration of data between databases.

Has MySQL gotten so popular that it does not require a tool that migrates data from other databases to itself?

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • eKudos
  • email
  • LinkedIn
  • Live
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Joomla database access methods

December 22nd, 2009 Albert No comments

The Joomla documentation lists the basic definition of what the methods are, the parameters and the return type. It does not give good examples of why they were there in the first place. For example, in the JDatabaseMySQL class, there are a few methods for retrieving data, eg. loadObject, loadResult, loadRow and their corresponding list methods. The documentation only says that the return type for loadResult is to return the first column, the loadRow will return the whole row, and loadObject will return it as an object.

I managed to find some useful examples hidden in the documentation project site, for eg. loadObject, loadObjectList, loadResult, loadResultArray, loadRow, loadRowList.

Of the various load methods, I find that the loadObject or loadObjectList is very versatile and useful. It is able to allow access to the fields as properties to the object. In the example in the documentation, it is  able to refer to the description field by this: $row->description. If the database field name is not descriptive, one can always use AS in the SELECT statement to name the property. For eg, if the database table category has a field name of cat_description, one can write the SQL as follow:

SELECT cat_description AS description from category

In this way, the description field can still be accessed via: $row->description

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • eKudos
  • email
  • LinkedIn
  • Live
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Unit Testing Joomla component development

December 14th, 2009 Albert No comments

I liked the idea of test-driven development, and I was ready to get my hands dirty to develop a Joomla component complete with unit test cases. After looking around the web, I discovered that there are 2 primary packages that are available, namely:

SimpleTest seems to be more established, with plugins to IDE like eclipse and it was previously used to write unit test cases for Joomla core. However, since June 2008, according to Joomla docs, unit testing has been moved to using PHPUnit instead.

The challenges on developing components with test cases using PHPUnit are:

  • There isn’t a proper plugin to IDE, the closest is through the use of an external tool in eclipse, as shown here
  • The lack of support to load the joomla environment for testing, thus requiring the need to modify the actual code in order to support testing.

Hopefully, in the near future, there will be a proper framework to support the test case development for Joomla developers.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • eKudos
  • email
  • LinkedIn
  • Live
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Nokia phones having “Unable to unlock phone” after uninstalling Mfe

November 15th, 2009 Albert No comments

For Mail for Exchange (Mfe) on Nokia phones, it is possible for the exchange administrator to set a mandatory passcode to unlock the phone after a specific amount of idle time. This is for security on the device in Enterprise environments.

The passcode is an annoying feature. I have since removed the Mfe profile from my device (N97), however, the passcode still persists. In the nokia forum posting, it lists 3 ways to overcome this.

I have tried step 1, which is to dial *#7780# to reset all the settings to factory default, and it did remove the passcode settings. Now, it is back to normal. Hope this helps you as well.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • eKudos
  • email
  • LinkedIn
  • Live
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

MSN error: 80048820 when starting up for the first time

October 25th, 2009 Albert No comments

After the installation of Vista, and MSN, MSN is started for the first time. And it showed a rude shock of the error as shown:

MSN Error 80048820

This is really puzzling. Upon clicking the troubleshooting link, it brings to this page, which says to update to the latest Messenger, which I am already.

Only upon clicking on the link at the side bar where it says, “What can I do to correct error 80048820″, and following the troubleshooting steps, that shows the following :

Settings for Internet Explorer

And indeed, after unchecking “Check for server certificate revocation”, and the SSL 2.0 and SSL 3.0 are selected, I can logon to Messenger again.

I am a little security paranoid, so I googled on this setting for “Check for server certificate revocation”, and found that it is introduced in Internet Explorer 7, and has been default to on, according to this link.

I do not understand why the necessity to workaround even though it is another Microsoft product. And it cause such grievances when installing MSN.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • eKudos
  • email
  • LinkedIn
  • Live
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Using dd to slice binary files

October 5th, 2009 Albert No comments

There are many ways to split the files in UNIX, sed, cut, dd are some of the examples. However, sed and cut are more suitable for text files. For binary files, dd is the one that’s most commonly used.  An example of how dd can be used to remove first 1000 bytes from a file is:

dd bs=1000c seek=1 if=inputfile of=outfile

bs is used to mark the block size, in this case, 1000c means 1000 bytes. seek=1 is to skip the first block, ie. 1000 bytes and the rest will be written to outfile. It is an useful way to undo concating multiple files.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • eKudos
  • email
  • LinkedIn
  • Live
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis
Categories: Others Tags: , , , , , ,

Mysql: to find records within a date range

October 4th, 2009 Albert No comments

It may be necessary to find records within a date range, eg. within the last 60 days, older than 60 days, or within a 30-days.

For example, if the table contains a field purchasedate, and to get the purchases within the last 30 days, the where clause should be:

WHERE DATE_SUB(NOW(), INTERVAL 30 DAY) < purchasedate

To get the purchases older than 30 days, the where clause should be:

WHERE DATE_SUB(NOW(), INTERVAL 30 DAY) > purchasedate

Hope that helps.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • eKudos
  • email
  • LinkedIn
  • Live
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis
Categories: Others Tags: , , , , , ,

Concat multiple files into 1 file

October 1st, 2009 Albert No comments

Using wget to download big files like ISO files is an efficient way to ensure that the file is being downloaded correctly. This is partly due to the capability of restarting the download from where it ends. However, it will tend to create multiple files like: file.iso, file.iso.1, file.iso.1.1, etc after each retry.

There are several windows tools that can help to concat these files into 1 file again. The easiest way to do it on UNIX happens to be using the cat command. Simply use the command like:

cat file.iso file.iso.1 file.iso.1.1 > newfile.iso

It is important to note that the order of the files to cat has to be in sequence, so that the final file will not get corrupted. The output is written to the newfile.iso, and the multiple download files are concat into 1 file again.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • eKudos
  • email
  • LinkedIn
  • Live
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis
Categories: Others Tags: , , , ,

Compatibility Plugin in Squirrelmail

September 16th, 2009 Albert No comments

Compatibility plugin in squirrelmail has been used by a number of plugins, to ensure compatibility between Squirrelmail versions.

Out of convenience, I have installed the rpm package from centos updates, which is version 1.4.8. Every time I run a yum update, and if there’s a squirrelmail update, some of the plugins that require compatibility will fail, eg. check_quota. And a typical failure is shown in the error log:

PHP Fatal error:  Call to undefined function sq_change_text_domain() in /usr/share/squirrelmail/plugins/check_quota/functions.php on line 761

After hitting some walls in google, and reading back the documentation of the modules, I chanced upon that the problem is because I am using the version 1.4.8, which is lower than 1.4.13, which will require patches to the squirrelmail installation. The details can be found in INSTALL file in the compatibility plugin directory, and the patches as well in the subdirectory.

After the patch, business is back to usual. So the next question is, should I continue to use yum to update squirrelmail, and incur this minor administrative overhead after the update, or install a fresh new version and update it manually?

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • eKudos
  • email
  • LinkedIn
  • Live
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Accessing Profile information outside Community Builder

August 19th, 2009 Albert No comments

I have a couple of instances that I needed to build components for Joomla as custom applications. In these applications, one common requirement is to show information specific to the user. This can be usually achieved by referencing the logged on user, and Joomla’s API does allow such access to the user id.
When the site grows, it might wants to store more information about the user, other than the user id, full name, and email address. It may require information like telephone number, company name, address to be stored. In such scenarios, extensions like Community Builder are used to extend the capabilities of managing user profiles.

However, in component development, I have not found properly documented ways to access profile information, eg. Company name outside of the Community Builder framework. The easiest way is certainly to access the database table directly and extract the data. However, this is good if the access is limited and performance is required.

If you would like to make good use of the nice APIs that have been written, this link provides a good step-by-step guide to retrieving the data. The field names that are available can be obtained from the database table, and for eg, company name is stored in the field ‘cb_companyname’.

Hope that helps to jump start your development.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • eKudos
  • email
  • LinkedIn
  • Live
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis