Newsgroups: comp.ai.neural-nets
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!cs.utexas.edu!convex!convex!arco!tularik.aai.arco.com!lasdti
From: Dan Inman <lasdti@aai.arco.com>
Subject: Re: C++ code for ANNs: Compilation problems
Message-ID: <Cw6rwx.MJ3@news.arco.com>
X-Xxmessage-Id: <AA9DE301C3017201@tularik.aai.arco.com>
X-Xxdate: Thu, 15 Sep 1994 03:39:45 GMT
Sender: usenet@news.arco.com
Nntp-Posting-Host: 136.226.114.1
Organization: ARCO Alaska Inc.
X-Newsreader: Nuntius Version 1.2
References: <NSANDHU.94Sep14110715@grizzly.water.ca.gov>
Date: Thu, 15 Sep 1994 19:38:56 GMT
Lines: 50

In article <NSANDHU.94Sep14110715@grizzly.water.ca.gov> Nicky Sandhu,
nsandhu@venice.water.ca.gov writes:
> Hi everyone,
> 	I am trying to compile Timothy Masters C++ Code for his
> book, "Practical Neural Network Recipies in C++". I am using the CC
> compiler in unix. 
> 	The compilation fails with the error message : 
> 	" conio.h header file not found ". 
> Is this header file unique to Dos?
> Is there any way to get around without using this header file?
> 	If anyone has compiled the above code in unix, any help would 
> be greatly appreciated. Thanks in advance.
> 
> Nicky Sandhu 

Hi Nicky,

Yes, conio.h is specific to DOS, and perhaps Borland in particular.
If you take a look at the code for most of Masters' training member
functions, etc., you'll find code like (e.g. in anneal.C):

     if (kbhit()){
       key = getch();
       while(kbhit())
          getch();
       if (key==27) {
          user_quit = 1;
          break;
          }
       }

Basically, what he's doing in that loop is providing the user a means to
stop the training run if it's taking too long, by sensing for
key-presses, and checking to see if the user hit ESC (of course, he
should test every key that getch() returns, because the user might not
think of hitting ESC first).

Under UNIX, you'll have to reimplement this code using low-level terminal
I/O or trapping a break signal like CTRL-C (though I don't know if that's
the best thing to do...). While I don't have the issue with me right 
now, the C++ Report's C++ Oracle column from some months back had an
example of how to do this with iostreams. I'll see if I can find the
article tonight, if you like (send me email at
dan@saturn.uaamath.alaska.edu or at lasdti@aai.arco.com if you want me to
find it for you. I don't know what your level of UNIX programming is...).

I think that should be about it for the differences, but if I can be of
more help, send me e-mail and let me know.

Dan Inman
