When IIS is complaining about a missing DLL file either a zlib.dll or oci.dll, chances are soemthing is wrong with the msi file, disable some of the extensions and try to install again, as long as php-cgi.exe runs properly, the program should work.
after ensuring that php works, follow the insturctions to edit the php.ini file to point to the correct fastcgi settings.
http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-7/
I installed PHP on C:\PHP and not within program files directory mainly because of the space.
lastly, take note of the appliaction pool, the manage pipeline mode should be integrated and the "enable 32 bit applications" setting should be set to true.
Friday, September 17, 2010
Wednesday, September 8, 2010
Performance xpath->query vs dom->getElementsByTagName
xpath works much faster, with speed of over 3 times faster compared to that of doing normal traversal using DOM.
// dom method
$xpath = new DOMXPath($dom);
$nodes = $dom->getElementsByTagName('td');
foreach($nodes as $node) {
if($node->nodeName == 'td'){
$inodes = $node->childNodes;
if ($node->getAttribute('class') == 'usedcar_InfoName usedcar_InfoName_padding') {
echo $node->nodeValue . "
";
}
if ($node->getAttribute('class') == 'usedcar_InfoContent usedcar_InfoContent_padding') {
echo @mb_convert_encoding(htmlspecialchars($node->nodeValue), 'utf-8') . "
";
}
foreach($inodes as $inode){
if($inode->nodeName == 'a' && $inode->getAttribute('class') == 'breadcrumb_link') {
echo $inode->nodeValue . "
";
}
if($inode->nodeName == 'td' && $inode->getAttribute('class') == 'usedcar_InfoName usedcar_InfoName_padding') {
echo $inode->nodeValue . "
";
}
}
}
}
// xpath method
$xpath = new DOMXPath($dom);
$title = $xpath->query("/html/title");
$elements = $xpath->query("//*[@class='usedcar_InfoName usedcar_InfoName_padding']"); // header
$elements2 = $xpath->query("//*[@class='usedcar_InfoContent usedcar_InfoContent_padding']"); // content
// dump all the header tag into an array
$headers = array();
if (!is_null($elements)) {
foreach ($elements as $element) {
$nodes = $element->childNodes;
foreach ($nodes as $node) {
array_push($headers, $node->nodeValue);
}
}
}
// dump all content tag into an array
$contents = array();
if (!is_null($elements2)) {
foreach ($elements2 as $element) {
$nodes = $element->childNodes;
$count =0;
foreach ($nodes as $node) {
if ($count == 0)
array_push($contents, $node->nodeValue);
$count++;
}
}
}
for($count=0; $count < sizeof($headers); $count++)
echo $headers[$count] . ": " . $contents[$count] . "
";
// dom method
$xpath = new DOMXPath($dom);
$nodes = $dom->getElementsByTagName('td');
foreach($nodes as $node) {
if($node->nodeName == 'td'){
$inodes = $node->childNodes;
if ($node->getAttribute('class') == 'usedcar_InfoName usedcar_InfoName_padding') {
echo $node->nodeValue . "
";
}
if ($node->getAttribute('class') == 'usedcar_InfoContent usedcar_InfoContent_padding') {
echo @mb_convert_encoding(htmlspecialchars($node->nodeValue), 'utf-8') . "
";
}
foreach($inodes as $inode){
if($inode->nodeName == 'a' && $inode->getAttribute('class') == 'breadcrumb_link') {
echo $inode->nodeValue . "
";
}
if($inode->nodeName == 'td' && $inode->getAttribute('class') == 'usedcar_InfoName usedcar_InfoName_padding') {
echo $inode->nodeValue . "
";
}
}
}
}
// xpath method
$xpath = new DOMXPath($dom);
$title = $xpath->query("/html/title");
$elements = $xpath->query("//*[@class='usedcar_InfoName usedcar_InfoName_padding']"); // header
$elements2 = $xpath->query("//*[@class='usedcar_InfoContent usedcar_InfoContent_padding']"); // content
// dump all the header tag into an array
$headers = array();
if (!is_null($elements)) {
foreach ($elements as $element) {
$nodes = $element->childNodes;
foreach ($nodes as $node) {
array_push($headers, $node->nodeValue);
}
}
}
// dump all content tag into an array
$contents = array();
if (!is_null($elements2)) {
foreach ($elements2 as $element) {
$nodes = $element->childNodes;
$count =0;
foreach ($nodes as $node) {
if ($count == 0)
array_push($contents, $node->nodeValue);
$count++;
}
}
}
for($count=0; $count < sizeof($headers); $count++)
echo $headers[$count] . ": " . $contents[$count] . "
";
Monday, August 23, 2010
Saturday, August 21, 2010
asp.net session extension
<script type="text/javascript">
$(document).ready(function () {
setHeartbeat();
});
function setHeartbeat() {
setTimeout("heartbeat()", 300000); // every 5 min
}
function heartbeat() {
$.get(
"/SessionExtender.ashx",
null,
function (data) {
setHeartbeat();
},
"json"
);
}
</script>
$(document).ready(function () {
setHeartbeat();
});
function setHeartbeat() {
setTimeout("heartbeat()", 300000); // every 5 min
}
function heartbeat() {
$.get(
"/SessionExtender.ashx",
null,
function (data) {
setHeartbeat();
},
"json"
);
}
</script>
Wednesday, August 11, 2010
Confucius
quote from Confucius' book Genuine Living says, "Developing in accordance with one's own nature is called "the way of self-realization." Proper pursuit of the way of self-realization is called "maturation"." In this quote, I believe Confucius proposes education for a but subject matter and form for that education would vary according to one's own nature. C.T.M.A.T.M. 78 At Confucius' own school, he would not teach "duflards", and would "only teach those who were bursting with eagerness for enlightenment." However he would not turn someone away because they had no money.
http://www.qddx.gov.cn/n435777/n435782/n435826/n436845/n436862/5307.html
http://www.qddx.gov.cn/n435777/n435782/n435826/n436845/n436862/5307.html
Monday, August 9, 2010
Pressing enter in textbox asp.net
<INPUT type="text" style="VISIBILITY: hidden;POSITION: absolute">
Start debugging again. You cannot see the second textbox, and everything looks like before. Try again to write something in first textbox. If you press enter now, form will submit, and your code for button's click event will now be executed. This is extremely different behavior, and you did nothing except you placed one invisible textbox on web form. :)
Start debugging again. You cannot see the second textbox, and everything looks like before. Try again to write something in first textbox. If you press enter now, form will submit, and your code for button's click event will now be executed. This is extremely different behavior, and you did nothing except you placed one invisible textbox on web form. :)
Sunday, August 1, 2010
Compiling mobile apps
Blackberry
1. Clean project
2. Project -> Blackberry -> Package All
3. *the program should automatically launch code signer
4. Inside Blackberry Manager, locate the ALX file and have it uploaded
iPhone
1. Download the latest version
2. Double click and launch the xcode project file
3. debug first and run on simulator (this is important)
4. if it works, connect the iphone
5. Select release (it will show base sdk is missing)
6. Select device
7. BUILD!
1. Clean project
2. Project -> Blackberry -> Package All
3. *the program should automatically launch code signer
4. Inside Blackberry Manager, locate the ALX file and have it uploaded
iPhone
1. Download the latest version
2. Double click and launch the xcode project file
3. debug first and run on simulator (this is important)
4. if it works, connect the iphone
5. Select release (it will show base sdk is missing)
6. Select device
7. BUILD!
Subscribe to:
Posts (Atom)