March 9th, 2010 / No Comments » / by Joshua
As a windows user, sometimes you have to face and handle this kind of problems.
The error: “PHP Startup: Unable to load dynamic library php_openssl.dll. The operating system cannot run %1“, when you are trying to start the apache server in the error.log file.
Basically what this error is trying to mention that there is an issue with your php_openssl.dll and a possible mismatch with other depending libraries. To resolve this, follow the below steps:
1. Rename ’ssleay32.dll’ and ‘libeay32.dll’ in c:\windows\system32 to ’ssleay32.dll.old’ and ‘libeay32.dll.old’ respectively.
2. Copy ’ssleay32.dll’ and ‘libeay32.dll’ from your PHP folder to the system32.
3. Restart the apache webserver.
Even I resolve it finally , I can learn nothing from it. This such a damn rule(”copy the dll file from PHP folder to system32″) was made by Microsoft? I don’t know. You couldn’t find the solution even in php document. The solution was passed from one developer to another. But no matter how I can stay away this kind of damn things for a while.
Posted in: Tutorial
Tags: apache, php, system32
March 8th, 2010 / No Comments » / by Joshua
Powered by Twitter Tools.
Posted in: life
Tags: twitter
March 8th, 2010 / No Comments » / by Joshua
Powered by Twitter Tools.
Posted in: life
Tags: twitter
February 26th, 2010 / No Comments » / by Joshua
JSONP (script insertion)
How does it work?
Lets assume, that we have a textarea iResponse and we want to set its value to something that we will receive from the server. And that we have some server in a different domain. With script insertion we can send a HTTP-GET request to the server like this:
function insertScript( url){
var script = document.createElement("script");
script.setAttribute("src",url);
script.setAttribute("type","text/javascript");
document.body.appendChild(script);
}
url in the request is a proper HTTP-GET request with the parameters. Hence server can receive input to work with. The trick with JSONP is how the output is passed back to the client. The newly downloaded “script” will be evaluated on load. Hence, if the script contains:
call_me( value );
A method call_me() will be called with the value as a parameter. Hence we should have another bit of script in our client to have a callback:
function call_me( vParam ){
document.getElementsByName("iResponse")[0].value = vParam;
}
Finally, JSONP-based services are (if they are not tailored to a single client when the callback is predefined) should take the callback name as a parameter:
url = "http://dummy.server.org/Create_a_Script.php?callback=call_me&......
Posted in: Javascript, development
Tags: cross-domain, jsonp
February 22nd, 2010 / No Comments » / by Joshua
Powered by Twitter Tools.
Posted in: life
Tags: twitter
February 15th, 2010 / No Comments » / by Joshua
You can find it here.
Install
1. Unzip the plugin package and put it into Garden/plugins;
2. Enable it in admin panel;
Configure:
1. Add the following code into file Garden\applications\vanilla\views\discussion\index.php
//Arround line 12 ~14
[CODE]
FireEvent(’AfterDiscussionHeaderRender’); ?>
[/CODE]
Then the code likes:
[PIECE]
FireEvent(’AfterDiscussionHeaderRender’); ?>
<h2>
if (Gdn::Config('Vanilla.Categories.Use') === TRUE) {
echo Anchor($this->Discussion->Category, ‘categories/’.$this->Discussion->CategoryID.’/’.Format::Url($this->Discussion->Category));
echo ‘•‘;
}
echo Format::Text($this->Discussion->Name);
?></h2>
[/PIECE]
2.
Config pagination for admin page:
Add following line into config.php
$Configuration['Vanilla']['Report']['PerPage'] = 10;
Posted in: development
Tags: forum, plugin, vanilla
February 8th, 2010 / No Comments » / by Joshua
Powered by Twitter Tools.
Posted in: life
Tags: twitter
February 1st, 2010 / No Comments » / by Joshua
Today when I try to update a table in sql command, I didn’t want to use the mysql function uuid to generate a string with middle line in it. So I try to use mysql custom function to generate a 32-bit length string without middle line.
DELIMITER ;
DROP FUNCTION IF EXISTS uid;
DELIMITER $$
CREATE FUNCTION uid()
RETURNS VARCHAR(32)
BEGIN
DECLARE c VARCHAR(36) DEFAULT '';
SET c = uuid();
return CONCAT(substring(c,1,8) , substring(c,10,4) , substring(c,15,4) , substring(c,20,4), substring(c,25,12));
END$$
DELIMITER ;
select uid();
I am writing this because mysql is powerful enough to handle all the issues in web software development.
Posted in: Tutorial, mysql
Tags: mysql, uuid
February 1st, 2010 / No Comments » / by Joshua
Powered by Twitter Tools.
Posted in: life
Tags: twitter
January 25th, 2010 / No Comments » / by Joshua
Powered by Twitter Tools.
Posted in: life
Tags: twitter