Archive for the ‘Programming’ Category
Thursday, July 22nd, 2010
For my future reference, I know that I will need this later on.
function create_request_string(theForm)
{
var reqStr = "";
for(i=0; i < theForm.elements.length; i++)
{
isFormObject = false;
switch (theForm.elements[i].tagName)
{
case "INPUT":
switch (theForm.elements[i].type)
{
case "text":
case "hidden":
reqStr += theForm.elements[i].name + "=" + encodeURIComponent(theForm.elements[i].value);
isFormObject = true;
break;
case "checkbox":
if (theForm.elements[i].checked)
{
reqStr += theForm.elements[i].name + "=" + theForm.elements[i].value;
}else{
reqStr += theForm.elements[i].name + "=";
}
isFormObject = true;
break;
case "radio":
if (theForm.elements[i].checked)
{
reqStr += theForm.elements[i].name + "=" + theForm.elements[i].value;
isFormObject = true;
}
}
break;
case "TEXTAREA":
reqStr += theForm.elements[i].name + "=" + encodeURIComponent(theForm.elements[i].value);
isFormObject = true;
break;
case "SELECT":
var sel = theForm.elements[i];
reqStr += sel.name + "=" + sel.options[sel.selectedIndex].value;
isFormObject = true;
break;
}
if ((isFormObject) && ((i+1)!= theForm.elements.length))
{
reqStr += "&";
}
}
return reqStr;
}
Posted in Programming, SQL/ETL | No Comments »
Saturday, June 5th, 2010
Previously, I’m having a problem to run my apps on blackberry device. It’s giving me attempts-to-access-a-security-api-error. After getting my BlackBerry JDE Signature key, now I can run it without a problem.
In Eclipse, it will show something like below. We can see the required RIM Runtime API(RRT) has been signed

MyLampu is a simple application where it starts the video camera, and the flash light comes on immediately.
It’s something like a torchlight.

It’s cool right ? you can write your own Java code and communicate with your blackberry device
p/s: anyone into blackberry programming ?
p/s: I’m having a very big problem in my life…but I won’t blog it here.. Perhaps time will be my best medicine.Good luck to me.
Posted in BlackBerry, Programming | No Comments »
Monday, May 31st, 2010
If you are using subversion source control, you should know that there are hidden folders named .svn inside your project. If you need to deploy the apps to the server, you should consider to remove all the .svn folder first.
Thanks to Jon Galloway. I found out the easiest way to do that.
Step 1. Copy below code, put it into the file and name it to whatever.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
@="Delete SVN Folders"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
@="cmd.exe /c \"TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%f\" \""
Step 2. Right click the file and merge.

(more…)
Posted in :Else:, Programming, Tips & Tricks | No Comments »
Tuesday, February 16th, 2010
After following some of the BlackBerry developer tutorials here and here, I finally manage to run my first BlackBerry application. It’s cool.
Here is my BlackBerry screenshot taken by CaptureIt

Why develop for BlackBerry ??

Posted in Programming | 2 Comments »
Monday, February 8th, 2010
For whatever reason, sometimes you will need to change your SVN URL. Perhaps you need to place the server to a new building and change the ip address. After the changes, you cannot commit to that server using your eclipse.
To solve the problem, you can relocate your SVN server and change to the new URL. Look at the image below and you will know that it’s very easy
Open up SVN Repositories perspective in eclipse.

(more…)
Posted in Programming, Tips & Tricks | No Comments »