A whopping people have visited this page since tea-time yesterday. Click Reload to see the number magically change.
<HTML>
<HEAD>
<TITLE>Random Hit Count</TITLE>
<SCRIPT>
function setHits() {
RandNum = new randomNumberGenerator();
val = RandNum.next() + ""
val = val.substring (2, 12)
PicSize = "HEIGHT=16 WIDTH=8 ALIGN='absmiddle'>";
Digit = new Array();
Head = "#define count_width 8\n#define count_height 16\nstatic char count_bits[] = {"
Digit[0]=Head+"0xff,0xff,0xff,0xc3,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0xc3,0xff,0xff,0xff};"
Digit[1]=Head+"0xff,0xff,0xff,0xcf,0xc7,0xcf,0xcf,0xcf,0xcf,0xcf,0xcf,0xcf,0xc7,0xff,0xff,0xff};"
Digit[2]=Head+"0xff,0xff,0xff,0xc3,0x99,0x9f,0x9f,0xcf,0xe7,0xf3,0xf9,0xf9,0x81,0xff,0xff,0xff};"
Digit[3]=Head+"0xff,0xff,0xff,0xc3,0x99,0x9f,0x9f,0xc7,0x9f,0x9f,0x9f,0x99,0xc3,0xff,0xff,0xff};"
Digit[4]=Head+"0xff,0xff,0xff,0xcf,0xcf,0xc7,0xc7,0xcb,0xcb,0xcd,0x81,0xcf,0x87,0xff,0xff,0xff};"
Digit[5]=Head+"0xff,0xff,0xff,0x81,0xf9,0xf9,0xf9,0xc1,0x9f,0x9f,0x9f,0x99,0xc3,0xff,0xff,0xff};"
Digit[6]=Head+"0xff,0xff,0xff,0xc7,0xf3,0xf9,0xf9,0xc1,0x99,0x99,0x99,0x99,0xc3,0xff,0xff,0xff};"
Digit[7]=Head+"0xff,0xff,0xff,0x81,0x99,0x9f,0x9f,0xcf,0xcf,0xe7,0xe7,0xf3,0xf3,0xff,0xff,0xff};"
Digit[8]=Head+"0xff,0xff,0xff,0xc3,0x99,0x99,0x99,0xc3,0x99,0x99,0x99,0x99,0xc3,0xff,0xff,0xff};"
Digit[9]=Head+"0xff,0xff,0xff,0xc3,0x99,0x99,0x99,0x99,0x83,0x9f,0x9f,0xcf,0xe3,0xff,0xff,0xff};"
for (Count = 0; Count < val.length; Count++) {
dig= val.substring (Count, Count+1)
setDigit (dig, PicSize)
}
}
function setDigit (Dig, PicSize) {
// this function to overcome a bug
if (Dig=="0") { document.write ("<IMG SRC='JavaScript:Digit[0]'" + PicSize) } else
if (Dig=="1") { document.write ("<IMG SRC='JavaScript:Digit[1]'" + PicSize) } else
if (Dig=="2") { document.write ("<IMG SRC='JavaScript:Digit[2]'" + PicSize) } else
if (Dig=="3") { document.write ("<IMG SRC='JavaScript:Digit[3]'" + PicSize) } else
if (Dig=="4") { document.write ("<IMG SRC='JavaScript:Digit[4]'" + PicSize) } else
if (Dig=="5") { document.write ("<IMG SRC='JavaScript:Digit[5]'" + PicSize) } else
if (Dig=="6") { document.write ("<IMG SRC='JavaScript:Digit[6]'" + PicSize) } else
if (Dig=="7") { document.write ("<IMG SRC='JavaScript:Digit[7]'" + PicSize) } else
if (Dig=="8") { document.write ("<IMG SRC='JavaScript:Digit[8]'" + PicSize) } else
if (Dig=="9") { document.write ("<IMG SRC='JavaScript:Digit[9]'" + PicSize) }
}
function nextRandomNumber () {
var Hi = this.seed / this.Q;
var Lo = this.seed % this.Q;
var Test = this.A * Lo - this.R * Hi;
if (Test > 0)
this.seed = Test
else
this.seed = Test + this.M;
return (this.seed * this.oneOverM);
}
function randomNumberGenerator() {
var D = new Date();
this.seed = 2345678901 + (D.getSeconds() * 0xFFFFFF) + (D.getMinutes() * 0xFFFF);
this.A = 48271;
this.M = 2147483647;
this.Q = this.M / this.A;
this.R = this.M % this.A;
this.oneOverM = 1.0 / this.M;
this.next = nextRandomNumber;
}
</SCRIPT>
</HEAD>
<BODY>
A whopping
<SCRIPT>setHits();</SCRIPT>
people have visited this page since tea-time yesterday. Click Reload to see the number magically change.
</BODY>
</HTML>
See also:
| file: /Techref/language/java/script/xbmsample.htm, 6KB, , updated: 2004/2/20 16:23, local time: 2012/5/23 13:37,
38.107.179.233:LOG IN |
| ©2012 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://www.ecomorder.com/techref/language/java/script/xbmsample.htm"> HTML / JavaScript Dynamic Inline XBM Image Generation</A> |
| Did you find what you needed? |
|
PIC 16 series Microcontroller Instruction Set Reference. And his Hobby Electronics web site at http://hobby_elec.piclist.com. |
Robotics nuts!Check out http://users.frii.com/dlc/robotics/projects/botproj.htm from Dennis Clark. This guy ROCKS! He has made (and sells but also releases code, docs, etc...) for a number of cool little robotic modules including whiskers, IR proximity detect and remote control, Sonar proximity detect, PWM, Servo, compass. Most of these use the little PIC 12C508 controller which costs basically nothing and is soooo tiny.The 4 servos, 2400 baud serial servo controller is a wonder of magic and he sells the programmed chip for $8. Wow! |
.