On page 129, line 9, the code should read:
(*weights_3)[i][j] = randomFP(-0.9, 0.9)
This code sets up initial random neural network weights.
I like the AFC class libraries. I was, however, disappointed when the final Java SDK 2.0 (and 2.01) AFC class libraires would no longer run under Linux and OS/2 (my other two development platforms besides Windows NT). Here are instructions for modifying the AFC libraries to make them portable.
If you are having problems getting the Java RMI examples to work under Windows 95, either of the following two options will probably make things work:
Actually, just adding your machine name to \Windows\hosts should do the trick. Here is my \Windows\hosts file:
127.0.0.1 localhost 127.0.0.1 colossus
Note that "colossus" is my machine name.
Thanks to James Buchanan for pointing out that starting on page 466, that XOpenDisplay is often missspelled as "XopenDisplay.
1. page 5: "jcv / jview" should be "jvc / jview"
Update: 5/3/2000 for Microsoft SDK for Java 4.0: If the CLASSPATH is set correctly, the examples should still work fine. Here are some notes that are SDK for Java 4.0 specific:
Hello, and thanks for buying my Java for Windows book. Microsoft has made several changes to their Java SDK since I wrote this book. However, by following the setup directions in the book (with a few changes detailed here), the examples worked OK for me. I just installed Microsoft's SDK or Java version 4 and here are the installation steps that worked for me: 1. copy my examples (assuming D: is your CD-ROM): xcopy d:\mjava c:\mjava /s Answer "d" for creating a directory. 2. Install the SDK for Java using the default location: "c:\Program Files\Microsoft SDK for Java 4.0" Immediately re-boot windows. Note: the 3 tier example requires RMI; RMI support is available separately from Microsoft's web site (see the SDK for Java 4.0 documentation for this). 3. cd to "c:\Program Files\Microsoft SDK for Java 4.0\bin" and run: clspack -auto 4. Test the installation by clicking on the example in "c:\Program Files\Microsoft SDK for Java 4.0\samples\afc11\JTreeVue\jtreevue.htm" Click on "Run program" Note that you can also run the afc102 version samples. 5. Compiling my example programs: Assuming that you are compiling from a command window, you must first set the CLASSPATH to find my compiled Java files: set CLASSPATH=c:\mjava\classes;c:\jdk1.2.2\jre\lib\rt.jar Note that I include the path to my Sun Java runtime libraries (the rt.jar file) to insure that standard things like java.io.*, etc. are availble. Also, Microsoft now turns off their Java extentions by default, so edit the command files in the JDIRECT example directory to add "/x- /nomessage" to all "jvc" compiler commands. If you do not do this, then Microsoft Java language extentions like "@dll" will not compile. 6. Try the tests in the book: Making sure that CLASSPATH is set (step 4.), cd to c:\mjava\demo and type: c.bat r.bat Everything should run OK. Best regards, MarkWatson 5/3/2000
If you are running UNIX, please get the file linux_fix.tar and copy it to your home directory. Then follow these instructions (assuming that your CD-ROM drive is mounted as /cdrom):
1. cd ~ 2. tar xvf /cdrom/beansb~1.tar 3. cd BeansBook 4. mv ../linux_fix.tar . 5. tar xvf linux_fix.tar 6. linux.sh
This will create the directory BeansBook in your home directory and install the Linux patches to the CD-ROM that is included with my JavaBeans book (these patches have been tested with Linux, but they should work with other flavors of UNIX).
Page 311: the last bullet reads "remote.setup", but should be "remote.process".
Page 296: last line before Listing 1. This is not correct. The SalesHandler constructor does return, but the instance of SalesHandlerImpl stays active to handle remote calls.
Here is a ZIP file containing the source code for this book. Also, there are two versions of the plotting library (one for Macintosh Common Lisp, and one for the free educational version of Franz Lisp (see www.franz.com) for Windows).
I believe that this book is now out of print, but most of the examples should be usable if you carefully read the code. Also, most of the sample files have a test function that you can run. The first thing to do is to get the plotlib running on your system because most of the examples in the book use graphics.
New (10/18/1999): some of the books source code in a ZIP file converted to compile with JDK1.2 and JDK1.3. (Note that I wrote the examples using the first publicly available JDK.) This ZIP file does not include the genetic algorithm game or the Jess code.
If you download this file, you can use the c.bat file to compile everything. Then, when you run the programs (from the directory containing the "mwa" directory!!), make sure that you specify the full package names; for example:
java mwa.ai.genetic.testGenetic
New (9/1/98) version of AIFrame class and Conceptual Dependency Natural Language Processing example
I wrote the AIFrame class over three years ago, and the code shows its age! Any, this ZIP file contains new definitions of the classes AIFrame, Parser, testNLP, testAIframe, etc. Unzip in any directory, and type:
javac *.java java testAIframe java testNLP
Neural network example One reader asked about the constant 0.5 that is used twice in the method Neural.Train() at the the end of the Neural.java listing. The factor of 0.5 is a learning rate. In my neural network applications, I usually use an adjustable learning rate; I used a nominal constant value in the example to keep the example program simple. You might want to experiment with initially using a larger value than 0.5, reducing it during the training process (e.g., start with 1.0 and reduce it by 0.01 every cycle through the training data set. Stop reducing the learning rate when it value is 0.2). Chapter 12: GenNeural.java 1. The file testGenNeural.java (method doRunButton) has a bug: comment out (or delete the line "gen = null;"). 2. Thanks to reader Paul Smith for pointing out a bug in NNfile.java that only occurs when running the testGenNeural applet. I discarded most of the code in the old version of NNfile.java, basically re-writing everything to make the code simpler to understand. Please get this new version of the file NNfile.java and copy this new file to the directory \JavaAI\src\mwa\ai\neural and rebuild everything in the directory using the c.bat command file.
Chapter 4. Figure 4.2. The labels on the Sigmoid and the derivative of the Sigmoid curves are reversed. I am sorry for any confusion that this may have caused.
I wrote the example programs using the Visual C++ 2.0 compiler. I assumed that the contents of the book-disk would be copied to c:\books\netagent\src. You will find a link below to a ZIP file (V4_2.ZIP) containing a directory VCPLUS4_2 which is set up to build with Visual C++ 4.2. Please follow these steps: 1. make a directory \NetAgent on c: c: mkdir NetAgent 2. Copy the contents of the book disk into c:\NetAgent. You should get: c:\NetAgent\HTML\ c:\NetAgent\FileDir\ c:\NetAgent\Library\ etc. 3. change directory to c:\NetAgent and do: mkdir VCPLUS_4_2 Change directory to c:\NetAgent\VCPLUS_4_2 and unzip the following zip file there:
The following link is for a new version of the main test program NEWS_1.CPP: New main test program
This file should be copied to c:\NetAgent\news_1. Web pages used to be more information rich! Now, most of the retrieved pages contain advertisements, but the newspaper generation option of the test program should "weed out" the advertisements since it selects files by key word search.
A good alternative to using Internet search engines is to maintain a list of favorite site URL addresses, and recursively search the links to these sites.
In the file NETMAN.CPP, in the member function:
HFILE NetManager::Request_HTML_document_from_server(SOCKET nSocket,
char * server_query)
{
.
.
.
nCharSent = send(nSocket,
query_request_data,
100, // 8/10/96
0);
Directions for building under Windows 95 with the Microsoft Visual C++ 4.2 compiler
1. mkdir c:\aivr 2. copy CDROM:\src --> c:\aivr\src 3. download the following ZIP file to c:\aivr\src\aivr_95.zip
ZIP file for Visual C++ 4.2 project
4. in c:\aivr\src, do: "pkunzip -d aivr_95.zip" You should now have a new directory c:\aivr\src\Win95 (with a subdirectory c:\aivr\src\Win95\test). 5. Start Visual C++ Version 4.1 or 4.2 and open the project file in c:\aivr\src\win95\test 6. Everything should build OK.