Classical Gas Revisited

Return To My Blog Page       Return To My Programming Page

 Regular visitors to my site are aware that the slide show in the upper left corner of my home page is inspired by the classical gas feature on the Glen Campbell TV show. If you take a look at the list of "My Blogs" by clicking on the link on my home page, you'll see a blog about the Classical Gas slide show, where you can read abut it's 10 frame/second slide show. I set my slide show at 10 frames/second so it could emulate the TV show, but it was too fast for the web. My browser's cache would be packed with jpeg files within seconds, and the slide show would consist mostly of flashes on the screen. Slowing it down to 1 frame per second worked, but I thought I should try speeding it up since I was comparing it to the Glen Campbell slideshow. I had it back up to 10 frames/second, but kept having to slow it down. Right now it's running at 2 frames/second.

This slideshow has two parts. A web crawler that searches for images and writes their url's to a text file when it finds them. The second part is a web page; the part that runs in a web browser. The web page uses Ajax to detect when the contents of the text file changes, reads the text in the file (a url of an image file) and dynamically changes the image displaying on the web page with the image that it just read. I wondered if I could speed up the process if I used an applet instead of Ajax. I could definitely speed things up if I put the web browser in the applet, but I wanted to know if it was possible to speed up the setup I was already using; i.e., the crawler running on my PC, and the web page finding the images that were crawled.

The Java Applet reads a text file I named FileStatus.txt If the applet reads the word "Wrote", it reads from the text file; then it reads the url string from a file named unleashed.txt and writes the string "Read" the FileStatus.txt file. The web crawler doesn't write to the file unleashed.txt until it sees the word "Read" inside FileStatus.txt Guess what, it's no faster then the Ajax web page. ...but, if I wanted to I could speed it up by including the web crawler inside the applet; there wouldn't be any opening and closing files, reading and determining what to do based on what has been read, etc.

Still, this was an interesting program to write.  Writing to a file from an applet requires that you disable security in your Java policy, or you sign the applet, or you can do what I did; call an asp script from the applet - the asp file script writes to the FileStatus.txt file. Please click on the links on this page to take a look at the source code for the Java applet, Perl and asp scripts; they demonstrate some interesting web programming techniques. One more thing; the slideshow on this page is the Ajax slideshow. For me to show you the Java applet web page, I would have to create an individual instance of the slideshow for each hit on this page; a denial of service attack just waiting to happen.

http://community-info.org/web_imagesUnleashed.java    http://community-info.org/scripts/unleashed.crawler.pl    http://community-info.org/FileStatus.asp

Return To My Blog Page       Return To My Programming Page