Saturday, July 30, 2005

Measure the size of monitors

LCD's and CRT's sizes are measured differently, do you know the difference?

Not sure of the difference between "flat panel" and "flat screen"?

click on the above link.

UNIX Flavors

Unix is not a single operating system. It has many flavors (aka. variants, types, or implementations). Although based on a core set of Unix commands, different flavors have their own unique commands and features, and designed to work with different types of hardware. No one knows exactly how many Unix flavors are there, but it is safe to say that if including all those that are obscure and obsolete, the number of Unix flavors is at least in the hundreds. You can often tell that an operating system is in the Unix family if it has a name that is a combination of the letters U, I, and X.

The following is some of the well-known Unix flavors, with links to their official home pages.

AIX by IBM
BSD/OS (BSDi) by Wind River
CLIX by Intergraph Corp.
Debian GNU/Linux by Software in the Public Interest, Inc.
Tru64 Unix (formerly Digital Unix) by Compaq Computer Corp.
DYNIX/ptx by IBM (formerly by Sequent Computer Systems)
Esix Unix Esix Systems
FreeBSD by FreeBSD Group
GNU Herd by GNU Organization
HAL SPARC64/OS by HAL Computer Systems, Inc.
HP-UX by Hewlett-Packard Company
Irix by Silicon Graphics, Inc.
Linux by several groups several
LynxOS by Lynx Real-Time Systems, Inc.
MacOS X Server by Apple Computer, Inc.
NetBSD by NetBSD Group
NonStop-UX by Compaq Computer Corporation
OpenBSD by OpenBSD Group
OpenLinux by Caldera Systems, Inc.
Openstep by Apple Computer, Inc.
Red Hat Linux by Red Hat Software, Inc.
Reliant Unix by Siemens AG
SCO Unix by The Santa Cruz Operation Inc.
Solaris by Sun Microsystems
SuSE by S.u.S.E., Inc.
UNICOS by Silicon Graphics, Inc.
UTS by UTS Global, LLC

Friday, July 15, 2005

Sub-menus do not load on one of the pages of your website

One possible problem, that I faced was that the value assigned for the name attribute of the anchor tag, was similar to the one of the varible used in the menu script. This caused some kind of Java script error that did not display the submenus only on that particular page.

For example

If u have used something like
<a name="thisyear">


and suppose your javascript code also has a variable defined 'thisyear' then there is a high probability that there would be a javascript error raised.

Thursday, July 14, 2005

CONNECTING MYSQL DATABASE THROUGH ASP

We can use DSN-less method to connect to MYSQL Database by using connection string through ASP script. But to use the connection string, MYSQL ODBC drivers need to be installed at the host machine. The required drivers have been installed on grad.uta.edu so, we can access the mySql database without any problem. Once that is done, the following section describes how we can use conventional connection string method to access MYSQL database via Active X Data Objects (ADO).


Using a connection string (DSN-Less) (http://www.devarticles.com/art/1/50/4 )

An alternative to using a system DSN to connect to a MySQL database is the connection string. Connection strings allow us to connect to a database using an ADO connection object and its open method in the same way that we use a system DSN, however, instead of making the connection object retrieve our connection details from a DSN, we explicitly supply them, like this:

adoConn.Open "Driver={mySQL}; Server=localhost; Port=3306; Option=0; Socket=; Stmt=; Database=address; Uid=admin; Pwd=password;"

The connection string to connect to a MySQL database is specified in exactly the same way as that for an SQL Server or Access database. Each parameter is a name/value pair separated by a semi-colon. The details of each of these parameters are shown below:

For more details, please open the link ((http://www.devarticles.com/art/1/50/4 )
Following is the link for downloading the MySQL ODBC driver.
http://www.mysql.com/downloads/api-myodbc.html

Following are the instructions for downloading:

1. Start by firing up your web browser and heading over to http://www.mysql.com/downloads/api-myodbc.html .Take a look under the "Versions" tab on the right hand side of the page and click on MyODBC. At the time of writing, the current version on MyODBC was 2.50.39.

2. Under the "MyODBC for Windows" section, click on the link that matches your operating system. In this article I'm focusing on Windows NT/2000, so click the NT/2000/XP link. This will take you to the mirrors page. Click on the link for the mirror that's closest to you and save the download to a folder on your hard drive (The download is a 1.45MB .zip file, so visit WinZip.com to download WinZip if you haven’t got it already).

3. Once complete, extract the zip file to a temporary directory and run the included setup.exe file. This will install the MyODBC driver. When the installation is completed, simply click on the close button to bypass the data sources con

Q & A about web languages

http://www.alt-php-faq.org/ ------------------------ PHP Q and A

http://www.abiglime.com/webmaster/articles/asp/011298p7.htm ---- ASP Q & Ans

How to create a printable version of a web page?

A printable page can be created using javascript/scripting languages like PHP or CSS. The following link explains the creation of a printable page using CSS.
http://webdesign.about.com/cs/css/a/aa042103a.htm

How to disable the enter key in a form?

The following link gives the javascript code that can be used to disable the enter key in a form. http://www.dynamicdrive.com/dynamicindex16/disableenter.htm

Note about comments in HTML

Many people who attempt to put comments into their HTML code -- text intended for the reference of the developer but not to be displayed by the browser -- get the syntax wrong, which can cause some browsers to mistakenly display part of the comment, or even worse, consider big chunks of the rest of the document to be a comment and ignore them. This widespread confusion about comment syntax is understandable given that HTML comment syntax is a rather inscrutable outgrowth of SGML (Standard Generalized Markup Language), a language devised for the formatting of government documents which formed the basis of HTML. Maybe some of the same people who devised the 1040 tax forms also created the syntax rules for SGML, and hence HTML.

Cont...

The PHP page does not get displayed on IE if there is any HTML comment . But when view source for the page is done all the code present there

Solution : There may be a open comment tag on one of the include files of your page that may not have been closed…… that causes a blank page to be uploaded in IE but works in netscape and morzilla

Displaying HTML code on your without browser having to interpret to it

Enclose the code inside <pre> and </pre> and the less than sign (<) and greater than sign (>) of any tags inside pre should be given as
&lt; for < and
&lt; for >

For example if you want to display anchor tag <A> you would give as
&lt; A &lt;

Auto Refresh your page

Add the following meta tag in the head section of the HTML page


<meta content="180" equiv="refresh">
Value of content attribute is in seconds

Comparing two strings

To compare Strings for equality, don't use ==. The == operator checks to see if two objects are exactly the same object

Wednesday, July 13, 2005

Onclick event

onClick sets a script to run when the user clicks on
the link.For example, this link creates an alert box which
says Heading Home! when the link is clicked:



<A HREF="mypage.oc.html" onClick="alert('Heading Home!')"
>My Page</A>

One of the more useful uses of onClick is creating a popup window
which the links targets. This example uses our popup window script
<A

HREF="mypage.popup.html"

onClick="return openWindow(this,'mypage')"

>My Page</A>

If onClick returns
a value of false then the click is cancelled and the browser doesn't
go anywhere. For example, you could check if a user really wanted
to go to a URL like this:

<A >
HREF="deleted.oc.html"
onCLick="return confirm('Are you SURE you want
to delete this record?')"
>Delete It!</A>
 
source : http://www.idocs.com/tags/

On click event

onClick sets a script to run when the user clicks on the link. For example, this link creates an alert box which says Heading Home! when the link is clicked:

a href="mypage.oc.html" onclick="alert('Heading Home!')">My Page

One of the more useful uses of onClick is creating a popup window which the links targets. This example uses our popup window script

a href="mypage.popup.html" onclick="return openWindow(this,'mypage')">My Page

If onClick returns a value of false then the click is cancelled and the browser doesn't go anywhere. For example, you could check if a user really wanted to go to a URL like this:

a href="deleted.oc.html" onclick="return confirm('Are you SURE you want to delete this record?')">Delete It!

Tuesday, July 12, 2005

CAPTCHA

CAPTCHA – completely automated public turing test to tell computers and humans apart

--- the security that prevents auto submission of the pages
--- its the curly hazy text that is seen on many sites for verification purposes

Monday, July 11, 2005

Display the results returned from an EXPLAIN query in PostgreSQL

Information from the EXPLAIN query is retrieved by using the pg_last_notice function.

The last notice is the last notice for the connection, not the result set, so the data overwritten with each query.
/*
// $connect = pg_connect();
$query = "explain select * from {table}";
$resultID = pg_exec($connect,$query);
$result_text = pg_last_notice($connect);
print_r(nl2br($result_text));
?>

*/

Variable interpolation

$name=”Tom petty”;
echo “my name is $name”;
?>

output:

my name is Tom petty ------------------------ variable interpolation


$name=”Tom petty”;
echo ‘my name is $name’;
?>

output:

my name is $name ------------------------ variable interpolation

How do I get a user's IP address ?

The users ip address is stored in the environment variable $REMOTE_ADDR, if you want to resolve the domain name for that ip (if any) use:



$domain = GetHostByName($REMOTE_ADDR);

Command to Check whether server is down or not

Telnet : for checking if the server is down or not.

Ping will not work since it may be blocked from the router.

Database : Cartesian product

Definiton : Retrieves all the tuples from the combination of table

Equivalent of Cartesian product in SQL - Cross Join

Thursday, July 07, 2005

Ways to optimize Database queries

1. Indexing
2. using Explain

There are many other ways, Please add them in your comments.

How to get character é displayed on ur webpage

Well use É on your PHP or HTML page . Did you spent hours trying to find out how to get that character. - VJ

Modify ur code to put footer always in the bottom irrespective of size of ur page

If ur footer is moving up and down according to contents of your page....... Its about time to change ur code. The link here descibes more about doing it http://www.pmob.co.uk/temp/3colfixedtest_explained.htm

Is your webpage cluttered with too many tables ?

Try using CSV and DIV tags to put headers and fotters on your page. http://www.pmob.co.uk/temp/3colfixedtest_explained.htm

Are you duplicating code in every page of ur website?

If your answer is yes then its about time to fine tune your code behind the pages.... Follow this interesting link I found http://www.ryanbrill.com/archives/including-content-with-php/