Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: JavaScript, HTML
Expertise: Intermediate
May 25, 2004



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Dynamic, Location-based Home Page Selection

When at home, I like to have my browser's home page to be different than at work. When I open up my browser on my laptop at home, it goes to news.google.com, when I open up the browser at work it goes to an internal engineering Web page. Save the following HTML on your local machine (or laptop) and point your browser to this file as the home page. When the browser is started, it runs the Javascript in this file and gets redirected automatically to the home page based on where you are i.e. home/work. This script looks at the IP address that the laptop (wireless) gets. At work I always get a 128.x.x.x type of address so the browser gets redirected based on that.

I had to upgrade the java plugin to Version 1.4.2_03 (build 1.4.2_03-b02) to make sure the getAddress() always got the latest DHCP address.

<META http-equiv="expires" content="0">
ip = java.net.InetAddress.getLocalHost().getAddress();

/* Upgrade from byte to int and maskoff the sign bit */
subnet = ip[0] & 0xff;

if (subnet == 128)


Siddharth Vajirkar
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date