Monday, August 10, 2009

Globe Tattoo & DIY antenna

I'm looking for a way on how to improve the reception of my Globe Tattoo modem. And luckily I came across this simple, yet effective, solutions (USB adaptors & DIY antenna = "Poor Man's WiFi" ). 

Actually I tried using an aluminum casserole cover and I saw that my modem gained from ~89db to ~72db. Which I think not bad for my testing purpose :)

I'm planning to improve my antenna based on the samples and information on the website I mentioned above and I'll post an update as soon as possible.

Tuesday, June 30, 2009

How to include SATURDAY in Excel NETWORKDAYS function

I've been using Excel NETWORKDAYS function to compute for the number of days between two dates. But this function excludes SATURDAY's and SUNDAY's. Since I wanted the SATURDAY's to be counted as well, I've came up with the following formula to do the job:

*Assuming you have the START DATE in cell "B4" and the END DATE in cell "C4".

=CEILING((C4-B4+1)-(((C4-B4+1)-NETWORKDAYS(B4,C4))/2),1)

Try it and please do let me know how it served or helped you.

Saturday, April 4, 2009

Trouble using <button> element in IE (internet Explorer)

I've been having trouble using the <button> in IE7. The problem is IE always uses the "TEXT" between the <button name="action" value="thevalue" >TEXT</button> as the return value from a form POST, instead of "thevalue".

As I observed this only happens in IE6/7 but not on Firefox and Chrome. I've tried to Google for a work around but I usually get solutions using JavaScript... which I also prefer not to use.

Instead, I used the following to get around the issue:

<button name="action[thevalue]" >TEXT</button>

when submitted the result array will be like this:

Array ( [action] => Array ( [thevalue] => TEXT ))

having the array structure above, all I need to do is to get the "thevalue" key of the variable array "action". Here's how I did it in PHP:

<?php
$parameters = $_REQUEST;
$action = implode(array_keys($parameters['action']));
echo "Value of action: ".$action;
?>

the result will be:
Value of action: thevalue

--

That's all to it... well I hope I have given you another option on how to go around the subject.
Feel free to use the code above, and if you find it useful, I would greatly appriace if you atleast provide a feedback via comment.

Monday, March 16, 2009

Connect PHP to PDMWorks2008 via COM

I've been trying to search on how can I programmatically connect PHP via COM to PDMWorks. But it seems that there are not many resources available yet. Actually I only found one from (http://blog.lphuberdeau.com) and this gave me hope to continue :)

So I also decided to post my snippet today to also give hope to others that there is someone who is also trying to accomplish such task. If you have any constructive idea how to improve this code, well please kindly post it here.

Code:

define('EdmVaultCLSID','{AE784C6C-0155-11D3-B24B-0000F879F93B}'); // CLSID of EdmVault in registry

$major = 0;
$minor = 0;
$vusername = 'username';
$vpassword = 'password';
$vname = 'vaulname'; // i'm having trouble connecting to a vault with more than 8 character

/*
The following snippet log-in to vault, show some info, and get the list of folders in the root-folder
*/
try{
// instantiate an object of EdmVault
echo 'Instantiating COM object...
';
$vobj = new COM(EdmVaultCLSID) or die("Can't instantiate COM object!"); // instantiate the object
echo 'COM object instantiated!
';

// get and display some info
$vobj->GetVersion($major, $minor);
echo " Version $major.$minor
";
echo " Language: ".$vobj->Language.'
';

// login to vault
echo 'Logging in to vault...
';
$vobj->Login($vusername, $vpassword, $vname);
echo "Logged in?".$vobj->IsLoggedIn.'
';

// get name of root folder the list the subfolders in the root
$vrootfolder = $vobj->RootFolderPath;
echo "Root folder: $vrootfolder
";
echo "Sub folders:
";
$vfolder = $vobj->GetFolderFromPath($vrootfolder);

if(!$vfolder){
echo "No folders found!";
}

$vpos = $vfolder->GetFirstSubFolderPosition;

while(!$vpos->isnull){ // loop until there are folders in the root
$vsubfolder = $vfolder->GetNextSubFolder($vpos);
echo '>>>'.$vsubfolder->Name.'
';
}

}catch (Exception $e) {

echo 'Caught exception: ', $e->getMessage(), "\n";

}

Friday, October 17, 2008

First spot

Mabuhay!

Hello, I'm Spot and this is my first blog. I hope that I can make this blog fun and interesting for my family and my friends.