Speaking counter version 2.x



Download:
Just print this page

Description:
This is a general-purpose page counter that speaks.

How to install:
You need to add some html tags to your homepage.
If you want a different outlook then you also need to edit these tags.

Disclaimer:
The use of this applet is at your own risk.
Claims are not accepted.
Comweb.nl has the right to stop this (free) service if needed.

Copyright:
The applet is free to use on non-commercial private homepages.
Commercial user should pay a small fee of US $25.--
File distribution is only allowed by written permission from sales@comweb.nl.

The applet tags:
Inserting these tags in your html page is all you need to do!
<APPLET CODEBASE="http://alpha.comweb.nl/" CODE="SPCount2.class" WIDTH="350" HEIGHT="50">
<PARAM NAME="bgcolor" VALUE="#000000">
<PARAM NAME="border_size" VALUE="12">
<PARAM NAME="border_inside_color" VALUE="#000000">
<PARAM NAME="border_outside_color" VALUE="#FFFFFF">
<PARAM NAME="font" VALUE="Helvetica,bold,25">
<PARAM NAME="text_color" VALUE="#FF0000">
<PARAM NAME="shadow" VALUE="gray,2,2">
</APPLET>

Description of the applet tags:
<APPLET CODEBASE="http://alpha.comweb.nl/" CODE="SPCount2.class" WIDTH="350" HEIGHT="50">
This is the applet starting tag.
The only things you perhaps need to change are the width and height values.

<PARAM NAME="bgcolor" VALUE="#000000">
Used to change the background color of the applet.
The applet mainly supports hexadecimal RGB color notation.
These always start with a # sign!
Other html tags often use hexadecimal RGB color notations.
For example the bgcolor attribute of the <body> tag.
I'll explain more on hexadecimal color notations at a later chapter.

<PARAM NAME="border_size" VALUE="12">
Used to set the border size in pixels.

<PARAM NAME="border_inside_color" VALUE="#000000">
<PARAM NAME="border_outside_color" VALUE="#FFFFFF">
Used to set the colors of the border.
Again this is a hexadecimal RGB color notation.
Hexadecimal color notations always start with a # sign.
I'll explain more on hexadecimal RGB notation at a later chapter.

<PARAM NAME="font" VALUE="Helvetica,bold,25">
The font used by the counter.
Java applets do only support a limited number of fonts.
It depends a little on the Java Virtual Machine installed on the browser.
Most browsers support TimesRoman, Helvetica and Courier.
This tag represents three values font name, font style and font size.
Font styles can be plain, bold, italic, italic&bold.

<PARAM NAME="text_color" VALUE="#FF0000">
Color of the text colors are explained later.

<PARAM NAME="shadow" VALUE="gray,2,2">
You can give the digits a shadow.
If you don't want a shadow set the x and y to 0
These are actually three values color,x,y
Although the applet supports some color names its recommended to use
The hexadecimal RGB color notation.

</APPLET>
The applet closing tag.
Don't forget this one.

Color notations:
This applet mainly uses the hexadecimal RGB color notation.
That's a mouth full of text.
Why a hexadecimal color notation?
It's quite simple there are millions of colors possible.
If I had to program each color and its representing name into the applet.
then the applet would get some Megabytes in size.
So instead of that the hexadecimal color notation is used.

The hexadecimal color notation consists out of four parts.
A trailing # sign followed by 6 hexadecimal digits.
The first two digits represent the amount Red color
The middle two digits represent the amount of Green color.
The last two digits represent the amount of Blue color.
RGB is an abrogative for Red Green and Blue.

But why use hexadecimal numbers and not decimal numbers?
Computers internally don't work with decimal numbers.

What is the difference between hexadecimal numbers and decimal numbers?
Humans count from 0 to 9.
Hexadecimal count goes some further.
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
For example A represents 10, F represents 15.

Lets examine this case.
I have a decimal number 9 and I add 1
9+1 = 10 ok
Now lets do it the Hexadecimal way
9+1 = A, remember A represented 10
Now some more complex
F+1 = 10, yes correct. (=16 decimal)

Lets examine the decimal number 356
356 = 3x102 + 5x101 + 6x100
The number 3 represents the 3 times hundred.
The number 2 represents 5 times 10
The 6 represents 6 times 1
Ok

Now lets examine hexadecimal 10.
That's 1x161 + 0x160 = 16+0 = 16 decimal.
Get the hang of it.

Some color examples
#FFFFFF equals to white
#FF0000 equals to red
#AA0000 equals to some darker red
#00FF00 equals to green
#0000FF equals to blue
#006666 is a mixture of green and blue
#000000 is black

The applet supports also the following color names.
black, blue, cyan, darkgray, gray, green, lightgray, magenta, orange, pink, red, white, yellow.

The technical working of the applet:
For the people that are interested in how this applet works.
You don't need to read this!
To let it work you only need to insert the applet tags into your html page and upload it.

The browser downloads an applet when it encounters the <applet..> tags.
The codebase attribute tells the browser where to get the applet program.
In this case it points to the alpha.comweb.nl server.
It downloads this file from the comweb.nl server and executes it.
This execution is done on the visitors computer in a save envierment.
The applet can only connect back to the comweb.nl server.
It doesn't have access to your hard disk files.
While executing the applet will load all necessary sound files from the comweb.nl server.
Then it calls a script on this server.
Something like: I'm on this page, please return me the count for this page and increase it by one.
If it's the first time the server will create a new counting file on the server.
The page name is part of the filename.

The applet is written in the Java language.
If you want to know how that looks here is a snippet of code.
private int getCount(String CGI_Call) throws MalformedURLException, IOException
{
   URL url=new URL(CGI_Call);
   URLConnection uc=url.openConnection();
   uc.setAllowUserInteraction(false);
   uc.setDoInput(true);
   uc.setDoOutput(true);
   uc.setUseCaches(false); // For Netscape
   DataInputStream in=new DataInputStream(uc.getInputStream());
   try
   {
       uc.connect();
       String firstLine=in.readLine();
       if (firstLine==null) 
       {  
          System.out.println("The CGI script returned null."); 
          throw new NullPointerException("The CGI script returned null.");}
          return Integer.parseInt(firstLine);
       } finally
       {
          in.close();
       }
    }
}
Reporting a bug:
If you encounter some bugs please tell me about it.
If possible use the bug form at:
http://alpha.comweb.nl/others/debugForm.html

Rob,
rvdb@comweb.nl
All rights reserved

Comweb
Chamber of Commerce 09107249, Arnhem
Tax number: NL 163775874B01 (for Europe only)
Street: Aldenhof 67-24
Postal code: 6537DC
City: Nijmegen
Country: Netherlands

Bank: PostBank
Bank swift code: INGBNL2A
account: 8359163