The Network Query Language       
by David Pallman

Listing One
get "http://www.cnn.com"
match '<li><a href="{link}">{headline}</a>'
while
{
    output headline, link
    nextmatch
}


Listing Two
(a)
openmail
firstunread
while
{
    ...do something with mail message...
    nextmessage
}
closemail

(b)
opennews "news.server.com", "alt.news.topic"
firstarticle
while
{
    ...do something with newsgroup article...
    nextarticle
}
closenews

(c)
openterm "linuxserver2"
waitterm "login:"
sendterm "jsmith\r"
waitterm "password:"
sendterm "johnny\r"
waitterm "$ "
clearterm
sendterm "ls -l\r"
waittermquiet 2
getterm
closeterm
 ...do something with captured session data...

Listing Three
///////////////////////////////////////////////////////////////////////////
// Script name: geology
// Description: Demonstrates use of a neural network in the area of geology.
//           Given indirect measurements, determines lithology.
//           Inputs:  Gamma Ray, Neutron, and Density.
// Inputs:   Gamma Ray log value, Neutron log value, and Density log value
// Outputs:  Identification (Shale, Dolomite, Limestone, Sandstone)
// Notes:    The first time the script is run, the network will be created,
//             trained, and saved (in geology.nnf). Thereafter, running the
//             script will process input and generate output.
//           The file required for training is geology.trn (text data file).
//           The file required for processing is geology.inp (text data file).
//           Results are output to the file geology.out (text data file).
////////////////////////////////////////////////////////////////////////////

//if this is the first time this script is being run,
//create, train, and save the neural network

lookup "geology.nnf"
else
{
  setneural 0.45, 0.90
  createneural "backprop", 3, 4, 4
  trainneural "geology.trn"
  saveneural "geology.nnf"
  closeneural
  show "Network has been created and saved. Run script again to process data."
  end
}
//open previously saved neural network and run it against real data
openneural "backprop", "geology.nnf"
processneural "geology.inp", "geology.out"
closeneural
show "Network has been run against input data. Processing is complete."

Listing Four
opendb "customers"
select "SELECT Customers WHERE BALANCE > 0.00;"
while
{
    show CustID, Company, Addr1, Addr2, City, State, Zip, Phone
    nextrecord
}





2

