Search This Blog

Sunday, October 11, 2009

PHP: Warning: split() [function.split]: REG_EMPTY in xxx

I try to php split to split out the concatenated data. Below are the sample that i use

$comp = "V1001|VI003";

$comp_arr = split("|",$comp);

i hit error:

PHP: Warning: split() [function.split]: REG_EMPTY in xxx

after search around and found that the issue is caused by symbol "|".
"|" is an operator in PHP. If want to use the this symbol as a delimiter, we must excape it with a back slash, "\|"

now it become

$comp = "V1001|VI003";

$comp_arr = split("\|",$comp);

and it works.

Hope this help

Wednesday, October 7, 2009

using jquery in Joomla

I'm developing a joomla component for joomla and involve jquery. It will hit error and need to take special care because joomla ship with javascript framework "MooTools" which will have conflict with jquery.

Here is the code that i pun into my view.html.php

$document =& JFactory::getDocument();
$document->addScript(JURI::base(true).'/components/com_xin/js/jquery-1.3.1.min.js');
$document->addScriptDeclaration ( 'jQuery.noConflict();');
$document->addScript(JURI::base(true).'/components/com_xin/js/validation.js');

in the validation.js

I change all the $ to jQuery.

For example i change
$(document) to jQuery(document)
$('#login') to jQuery('#login')
and all others.

Test again and it works. Hope this help.

Friday, October 2, 2009

LoadLibrary ("xxxx.dll") failed - The specified module could not be found

I've created a dll using VC++ and try to register the dll in the machine xp pro using regsvr32. I copy the dll from my development machine to the deployment and hit error message.

LoadLibrary ("xxxx.dll") failed - The specified module could not be found.

What's go wrong?

I already make sure all my dll dependency copied to the machine. Finally i found out that i should compile the dll in debug mode only. I should compile it in release mode.

I'm able to register to the xp machine after i compile in release mode. Hope this help.

odbc: data source name not found

Situation:

The application written in ASP with dll and etc and use ODBC for database connection. Everything working fine but one day there was a auto windows update can cause this ASP application running with error message "data source name not found". Plenty of time taken for debugging and not solved. Finally by trial and error, the problem solved. Strange, the problem is caused by the permission setting on the dll which call the ODBC. We suspect the problem cause by the windows update and change the permission setting.

Hope this help.