me,myself,english and programming..

Archive for the ‘Programming’ Category

Change system date using command line in windows

Wednesday, May 23rd, 2012

This is very useful when you need to change your system date before open up some of your application that already expired.

@Echo Off
REM ** Must be run as System Admin Priviledge

REM Store systems current time into BEFOREDATE var as mm-dd-yy
SET BEFOREDATE=%date:~4,2%-%date:~7,2%-%date:~10,4%

REM Set the below date to date you wish to roll your system date back to
DATE 04-11-11

SET now=%date%
echo Date change to - %now%

REM First param of START command needs empty double quotes
REM Second param of Start command should be absolute path to application
REM IE "C:\Program Files\directory\filename.exe"

START "" "ThisIsYourProgramName"

REM Cause a delay to allow application to load

PING -n 10 127.0.0.1 > NUL 2>&1

REM Set system date back to current date
DATE %BEFOREDATE%

SET now=%date%
echo Date Now - %now%

 

testDate

Till then..adioss

Blackberry + Solution for Resource is not open error in Ecilpse

Wednesday, February 9th, 2011

When attempting to debug my second project, Eclipse complains that my first project is closed.

2011-02-05 191425

Solution for this error is just open back your first project. Right click and untick “Active for Blackberry” option.

2011-02-05 191604

That’s all.

Happy Coding.

p/s : Time heals almost everything. Give time time…

ATK Framework – Introduction

Wednesday, December 22nd, 2010

What is ATK?

ATK is a special purpose framework, targeted at business applications. It allows you to build an application with very small amounts of code.

intro

 

 

 

 

 

 

 

 

Imagine if you can write code like this.

  class kelas extends atkNode
  {
    function kelas()
    {
      $this->atkNode($this->node);
      $this->add(new atkAttribute("kelas_id", AF_AUTOKEY));
      $this->add(new atkAttribute("nama_kelas",AF_SEARCHABLE|AF_OBLIGATORY));
      $this->setTable("tblkelas");
    }
  }

(more…)

DOS – Check if drive already exist and map network drive

Monday, October 18th, 2010
IF EXIST Z: (
echo The drive is already mapped.
GOTO SKIPPED
) ELSE (
net use Z: \\10.100.100.1\MyData$ /user:MyUser "My Password"
)

:SKIPPED
REM ** YOUR CODE GOES HERE

or.

IF EXIST Z: (
net use Z: /delete
)
net use Z: \\10.100.100.1\MyData$ /user:MyUser "My Password"

Till Then….

Javascript to generate Query String

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;
}