"Greek form: Κέρβερος, Cerberus was the son of Echidna, a hybrid half-woman, half-serpent and Typhon, a fire-breathing giant whom even the Olympian gods feared. Its brother is Orthrus, always depicted as a two-headed hellhound. The common depiction of Cerberus in Greek mythology and art is as having three heads, a mane of live serpents (similar to Medusa's hair) and a snake's tail. In most works the three-heads each respectively see and represent the past, the present, and the future, while other sources suggest the heads represent birth, youth, and old age. Each of Cerberus' heads is said to have an appetite only for live meat and thus allow the spirits of the dead to freely enter the underworld, but allow none to leave. Cerberus was always employed as Hades' loyal watchdog, and guarded the gates that granted access and exit to the underworld." Wikipedia

Thursday, June 3, 2010

Get Value, Index, Text on HTML Select Tag [Javascript]


    function getSelectedIndex(id,id2){
     var indx = document.getElementById(id).selectedIndex;
     var op = document.getElementById(id2);
     op.value ="Index is: " + indx;
    function getSelectedValue(id,id2){
     var val = document.getElementById(id).value;
     var op = document.getElementById(id2);
     op.value = "Value is: " + val;
    function getSelectedTxt(id,id2){
     var indx = document.getElementById(id).selectedIndex;
     var txt = document.getElementById(id).options[indx].text;
     var op = document.getElementById(id2);
     op.value = "Text is: " + txt;

String value 1
Text 1
String value 2
Text 2
String value 3
Text 3
String value 4
Text 4
String value 5
Text 5

    Input Select Here:


Wednesday, June 2, 2010

trim(), ltrim(), rtrim() [Javascript Implementation]

 rtrim, ltrimtrim are string manipulation functions
 which strip or remove whitespaces from the beginning, ending,
 or both beginning and ending of a string. 


   function trim(id){
    var txt = document.getElementById(id);
    var str = txt.value.replace(/^\s+/, '').replace(/\s+$/, '');
    return str;

   function ltrim(id){
    var txt = document.getElementById(id);
    var str = txt.value.replace(/^\s+/, '');
    return str;

   function rtrim(id){
    var txt = document.getElementById(id);
    var str = txt.value.replace(/\s+$/, '');
    return str;

See sample output below:
Input Text Here:


Sharing your Dial-up Connection

·         In order to share your dial-up connection using your (wired/wireless) router, you will first need to configure your computer for ICS. On your computer, you need to share your dial-up connection by turning on the ICS.
o    You can turn on ICS by running the network wizard and choosing to share your Internet connection. You can also try sharing it by going to Network Connections, right-click on the dial-up connection icon, select Properties, and then Advanced tab (or Sharing in WIN 7). Put a check on “Allow other network users to connect through this computer’s Internet connection”.
·         Once ICS is turned on, your computer will be a DHCP server, that is, it will hand out IP addresses to client computers on the network that have their DHCP client turned on. For client computers:
o     By default DHCP client is on, you can check it by going to Network Connections.
o     Right-click on the LAN (Local Area Network) connection icon, select Properties.
o    Click “Internet Protocol Version 4 (TCP/IPv4)”, do not uncheck, and then click properties.
o     On General tab, select “Obtain IP address automatically” and “Obtain DNS server address automatically”, click “OK”, then, “close”.  
·         Your ICS computer's LAN network adapter should now have a static IP address. Kindly TAKE NOTE of your IP address because we’ll be using it for configuring the router, and DO NOT CHANGE YOUR IP ADDRESS, changing it will break your ICS. I am not sure of the IP address, but I think it will look like (for XP and VISTA) or (for WIN7). Please check it and take note of your IP address.

·         Configure your router. I will only give one of the many possible configurations. This config allows your computers to have file sharing on your network and will able to play LAN games.
o    Log in to your router's web interface.
o    [Optional Step] Back up your current router’s configuration incase you want to revert the changes that you will do on your settings.
o    [For wireless routers] Configure your wireless settings. Set your SSID, password, encryption type, etc.
o    Go to the “Basic Setup" of your router.
o    Disable DHCP.
o    Set it to Static IP.
o    Remember the IP address that you noted a while ago?
§  For example, my IP address that I noted is (for WIN7). Let the first 3 segment remain the same (192.168.137) for your router’s IP address.
§  Set your router’s LAN IP address to 192.168.137.x (if you have an IP of where x is any number higher than 1 and less than 254.
o     Set your router’s gateway and DNS server to your IP address you noted (in our example, it will be
o    Save your new settings.
o    Plug a network cable from the Internet host computer into one of the switch ports in the back of the router, NOT IN THE WAN PORT, or you may connect your Internet host computer VIA wireless.
o    Plug a network cable from the Dial-Up Modem into one of the switch ports in the back of the router, NOT IN THE WAN PORT.
o    Dial your connection.
o    Clients may now connect to the router VIA wired/wireless. They should receive addresses of 192.168.137.x (based on our example).

·         Internet Connection Sharing. Basically, ICS will "bridge" your WAN (which is your dial-up connection) with the LAN.
·         Dynamic Host Configuration Protocol.
·         DHCP client sends a broadcast request for configuration information.
·         The DHCP server receives the request and responds with configuration information from its configuration database.
·         In the absence of DHCP, all hosts on a network must be manually configured individually - a time-consuming and often error-prone undertaking.