===============================================================================
WEST COAST WEB ADVENTURES, INC. NEWSLETTER - Vol #1, Issue #1, January 15, 2001
Online version at: http://www.WestCoastWebAdventures.com/news/news01152001.txt
===============================================================================
Visit http://www.WestCoastWebAdventures.com for additional information, or to
add your two sense, or to unsubscribe from this newsletter.
===============================================================================
Contents
- About this Newsletter
- Cool Tools: Optimize your Web Toolbox
- Case Study: Building a Search Engine
- Working with Code: A Graphing Object
- FGL Tips: Debugging Secrets
- This Week's Referral: JimTools
===============================================================================
About this Newsletter
===============================================================================
This newletter was created as a free resources by West Coast Web Adventures for
people interested in providing themselves with more control of their web
presence and overall computer experience.
It is published via email once or twice per month, more or less, as the
opportunity and need arises. We hope that users of all experience levels will
get something out of each issue.
The newsletter is published in-house by West Coast Web Adventures staff
members, but outside content contributions are always welcome. Contact the
webmaster if you have something to contribute.
===============================================================================
COOL TOOLS: Optimize Your Web Toolbox
===============================================================================
While there are lots of fancy programs out there that can help you get the job
done, there are a few that once mastered are tough to beat.
Due to popular request, here are the tools we use to create all of the things
you find at the West Coast site. Used correctly, they are the only tools you'll
ever need...
-- INTERNET BROWSER --
We do most of our surfing with Microsoft's Internet Explorer v5.5. We have
found it to be a bit more stable and substantially more flexibile than previous
versions and other browsers.
Though we primarily use IE for development and surfing, we also use the latest
version of Netscape just to make sure everything looks good in both
environments. If you can make your stuff look good in both environments with a
single set of source code then you will have succeeded in appeasing the vast
majority of the internet marketplace.
-- PROGRAM EDITOR --
While the trend seems to be larger programs that do everything for you, such as
Front Page, we prefer the simplicity of a good text editor with HTML and other
language familiarity.
To that end, we use our own Program Editor which is part of the freely
available VMSDK. It supports multiple files of any size, has syntax
highlighting for a number of languages, and is blazingly fast. Every page you
see on the West Coast site was created with this program. And the price is
right...free. Check it out at:
http://www.westcoastwebadventures.com/products/vmsdk.htm
-- GRAPHICS PROGRAM --
Photoshop. Are there really any others? This program is hands down the best
product out there. It can do anything and everything. Older versions are ok too
as long as it supports layers. Newer versions have more web stuff in them but
also new interface paradigms. Our preferred release is Photoshop 5.0. Check out
the imagery on our site to get a feel for what this thing can do!
-- FTP SOFTWARE --
There are a lot of really good software products in this category. We tend to
use either WSFTP or, depite its terrible name, CUTE FTP. Both programs are easy
to use yet powerful and flexible. Both have free trial versions are are
realatively inexpensive to purchase.
-- LOCAL SERVER --
There's nothing like developing a web site or browser-based application with
your own local server running on your machine. No FTP, no CHMOD, just write and
see - instantly. For us, WebSuite's the thing. Period. And it too is free.
http://www.westcoastwebadventures.com/products/websuite.htm
===============================================================================
CASE STUDY: Building a Search Engine
===============================================================================
The process of creating a search engine to compete with Yahoo or one just for
seaching your own site is remarkably similar --- only the scope and depth of
functionality are different.
In either case, you need to get a search request, search for matches, process
the results, and format the output. Beyond that, simply throw in a few adds,
a couple of pitches for your other endeavours and, presto, you've got a real
search engine! Of course the real defining quality is the accuracy of the
search and the depth of its content.
For our purpose, we'll leave the professional seach engines at peace today and
concentrate exclusively on building a solution for your own web site. The case
study in point can be found at at the top of every page within the West Coast
web site. This article will provide the concepts involved without direct
reference to source code, however, full source code is provided for the
example used.
Since we don't want every page on our site to be indexed, after all there may
be things that we deem private, we need a list of files to index. Likewise,
we want to control the descriptive text that is displayed if a match is found
in a specific file. We keep this information in a ASCII text data file which
is extremely efficient and very easy to maintain.
To get the request, we add a small input form to the top of each of our pages
that does nothing more than get the request and forward it to the actual
search engine. We also added a checkbox option so the user can request a
broader search than just our site.
Once the request has been received, the search engines loops through a text
search process for each searchable file. If a match is found, we store
information about the file and number of hits found into an array.
Once the search is complete, we sort the array based on the number of actual
hits, then format the output and display it back to the user. In our case, we
also generate a relevancy graph to accompany the output. The graph object used
is detailed in the "Working With Code" section of this newsletter.
In case the user wants a search beyond our site, the request is repackaged and
passed on to an external search engine (our preferred one is G02NET.COM), which
we pop up in another browser window so as not to loose control of our site.
This method is easy to implement and maintain, and provides very good
performance on sites containing less than a few hundred pages to search. The
next level of search engines involves spiders, high-speed indexing, and
advanced extraction functionality --- which is more than most web site need and
certainly beyond the scope of this article.
The source for this case study can be found at:
http://www.westcoastwebadventures.com/download/search.ap_
===============================================================================
WORKING WITH CODE: A Graphing Object
===============================================================================
We wanted a simple FGL class object that could format a bar graph for use in
our search engine project (see previous article). We also wanted it to be
customizable for other uses and easily incorporated into a web page.
The object itself contains only two methods and a half dozen instance
variables. The variables are used to initialize the format and presentation of
the graph including size and color. The new( ) method is invoked with these
default values when the object is created.
The display( ) method is used to actually display the graph in the web page.
It is optionally passed a single parameter that represents the percent value
to display. If no parameter is provided, the default percent value that was
provided when the object was created is used.
Including this function in a web page requires either the class definition to
be in the file or a reference to a FLB library file that contains the source.
Once that is accomplished, the graph can easily be incorporated directly into
your HTML as in the following example:
This year's rainfall is 27% less than last year's,
as illustrated in the following graph:
<[
g = new( "graph", "black", "red", 200, 50, 1, 0 )
! g.display( 27 )
]>
Note: This source has been slightly altered to better format this screen.
You can view the source in its original format as part of the search engine
project mentioned in the previous article.
//////////////////////////////
// Graph Object Source Code //
//////////////////////////////
CLASS graph
PUBLIC:
local aclr, bclr, width, height, border, pct
METHOD new( aclr, bclr, width, height, border, pct )
::aclr = aclr
::bclr = bclr
::width = width
::height = height
::border = border
::pct = pct
return( 1 )
END
METHOD display( pct )
local s
if ( type( pct ) == "N" )
::pct = pct
end
if ( ::pct > 99.49 )
::pct = 100
else
::pct = int( ::pct )
end
if ( ::pct < 1 )
::pct = 1
end
s = "
"
s += "\r\n"
s += " \r\n"
if ( ::pct < 100 )
s += " | "
s += " | \r\n"
end
s += " | \r\n"
s += " \r\n"
s += " |
\r\n"
return( s )
END
END
////////////////////
// End of Listing //
////////////////////
===============================================================================
FGL TIPS: Debugging Secrets
===============================================================================
Debugging FGL programs can be simplified through the use of a handful of
internal resources and straight-forward techniques. FGL possesses a robust
error-handling system that is fully detailed in the online FGL documentation.
The TRY/CATCH methodology provides for customizable error trapping and
recovery. It specifically identifies the procedure, line number, and error type
that occured.
A simpler method involves the strategic placement of println( ) statements
within your code. Combined with the type( ) function, this method allows for
the easy tracking of program execution and interrogation of data elements.
The println( ) function routes the output of the paramaters passed directly to
a display screen that can be viewed while your program is running.
For example:
FUNCTION main( )
local a, b, c
println( "Begin debugging..." )
InitVariables( )
println( "Variable 'a' is type: " + type( a ) + " with a value = " + a )
println( "Variable 'b' is type: " + type( b ) + " with a value = " + b )
println( "Variable 'b' is type: " + type( c ) + " with a value = " + c )
return( 1 )
END
A couple things to keep in mind when debugging Active Pages. First, line
numbers do not match up since the page is resolved differently, and secondly,
and incidently the most common mistake, you must turn off "AP CACHING" when
interactively altering Active Page source files. This is because the server
dynamically caches compiled code for optimized content delivery.
An additional debugging resource is the use of the CMD.EXE program which is
provided free as part of the VM-SDK. This program lets you interactively
communicate with the FGL language in the form of a command line interpreter.
Additonal debugging tips for TCP/IP interaction and other high-level processes
exist which will be discussed in subsequent articles.
===============================================================================
THIS WEEK'S REFERRAL: JimTools
===============================================================================
Jim Wilson has successfully created a collection of webmaster tools and
resources affectionately housed at http://www.jimtools.com
These resource includes everything from syntax and spell checker programs to
search engine fine tuning and submital systems.
Better yet --- he's always adding stuff --- all of which is FREE!
Kudo's Mr. Wilson!
===============================================================================
This newsletter is the copyrighted material of West Coast Web Adventures, Inc.
(c) 2001 by West Coast Web Adventures, Inc., All Rights Reserved.
===============================================================================