Welcome to Noumena Corporation

;login: Magazine:
The Tclsh Spot
HOME NEWS TRAINING TCL/TK AFFILIATES
Noumena\

Tclsh Spot summaries and code
Clif Flynt has been writing a bi-monthly Tcl article for :login; magazine since April, 1999.

These articles introduce a few new Tcl commands and concepts, and then use those commands (and previously introduced commands) to build some interesting application.

Here are brief descriptions of the articles, zip files of the code, and a link to the complete article if that text is available.

Usenix has made the text of articles over a year old available to the general public. The text for more recent articles is available to Usenix members at www.usenix.org

Noumena\
April 1999:
Intro to Tcl/tk
The first Tclsh Spot article introduced the basic commands and showed how to create a GUI calculator (with 8 commands and about 30 lines of code.)

Text of article


Get the code: (790 bytes)

June 1999:
File IO, Strings, Text Widget
This article described a simple script that will confirm that all the tasks running on a system are owned by legitimate, logged in, users. We used this script to track and kill IRC Robots that crackers left on the college network where Clif Flynt was teaching at the time.

Text of article

Get the code: (848 bytes)

Noumena\
Noumena\
August 1999:
Using the HTML viewer
I like to read mail with a plain old text type mail viewer. But metamail doesn't have built in support for HTML mail. This viewer will handle simple HTML messages (but not most advertising mail).

Text of article

Get the code: (17075 bytes)

October 1999:
Extending the HTML viewer
This article shows how to extend the Tcl HTML package to read images, and bounce to hyperlinks.

The example code is an improved htmlviewer that will let you look at images or load links at your discretion.

Text of article

Get the code: (20612 bytes)

Noumena\
Noumena\
December 1999:
Building HTTP Robots
strings, regular expressions
This is the first of several articles that show how to build a simple stock quote retrieving robot.

This article creates a simple robot that will return the current price.

Text of article

Get the code: (340 bytes)

April 2000:
Building HTTP Robots
fancy regular expressions
This article explains some of Tcl's new regular expression options, and extends the robot to get all the available data.

Get the code: (517 bytes)

Noumena\
Noumena\
June 2000:
File I/O, the BLT Graph widget
Now that we can get the stock data, lets start saving the results, and put together something simple to look for trends.

This article shows how to use the Tcl File commands to save the results, and how to use the BLT extension graph widget to display them later.

Get the code: (1111 bytes)

August 2000:
Better graphs, sales volumes, Associative arrays
This article expands on the previous graphing program and shows how to use bar charts with graphs, use multiple axes, and display custom labels on the tics.

Along with that, it discusses using the associative array to organize the data.

Get the code: (2184 bytes)

Noumena\
Noumena\
October 2000:
Multiple lines on a chart, menubuttons, more associative array techniques
This article described how to:
  • use BLT with multiple lines of data
  • bind actions to the lines
  • generate postscript images of a graph
  • use a tk menubutton

It expands on the discussion from the previous three articles.

Get the code: (1565 bytes)

December 2000:
Introduction to TCP/IP Client-Server in Tcl
Introduces the socket command, and shows how to build a client-server pair that will monitor disk space, and report when the space gets low.

Get the code: (951 bytes)

Noumena\
Noumena\
February 2001:
More IP-style Client/Server techniques
This article expanded on the previous article by:
  • Using a single server with multiple ports for different information.
  • Displaying client data with a barchart.
  • Handling exception conditions with catch.
  • Checking for valid clients.

Get the code: (2583 bytes)

April 2001:
Client/Server System Monitor with History
Shows how to save the last N hours worth of events, and display them in a scrolling canvas.

Get the code: (3170 bytes)

Noumena\
Noumena\
June 2001:
Displaying utmp data with the binary command
Describes using the binary command to dump the information in the utmp file.

Get the code: (1036 bytes)

July 2001:
Using the binary command to examine telnet configuration messages
Describes using the binary command to display the IAC interaction during the start of a telnet session.
Discusses:
  • binary
  • fconfigure
  • read
  • split
  • regsub

Get the code: (4546 bytes)

Noumena\
Noumena\
Sep 2001:
A Telnet Client
Implements a simple telnet client that can interact with a server, maintain its internal state, and respond to various commands the server can send. Demonstrates some features of the Tcl namespace.

Get the code: (2670 bytes)

December 2001:
Extraction information from tcpdump
Describes extracting the text from the hex output of tcpdump.
Discusses:
tcpdump format join
split format string regexp

Get the code: (1957 bytes)

Noumena\
Noumena\
Feb 2002:
Getting and comparing HTML pages
An example application that takes reformatted output from tcpdump and turns it into a Tcl script that can be used to replay an interaction.
Discusses
http vwait
clock format read

Get the code: (5685 bytes)

April 2002:
Advanced Tk Techniques 1
Describes using pack, place and grid to make resizeable GUI applications.
Discusses:
pack place grid

Get the code: (1213 bytes)

Noumena\
Noumena\
May 2002:
Advanced Tk Techniques 2: Automatic Scrollbars
Describes how to build applications with scrollbars that appear and vanish as required, and how to simulate a scrollable frame.
Discusses
frame canvas
grid scrollbar

Get the code: (2644 bytes)

June 2002:
Advanced Tk Techniques 3: popup Help
Adding popup help messages to buttons, labels, etc.
Discusses:
bind after toplevel
winfo wm message

Get the code: (1404 bytes)

Noumena\
Noumena\
Oct 2002:
Firewall Validation 1: Building extensions with SWIG
Describes how to convert an existing library into a Tcl extension using swig. Builds an extension using the dnet library for sending and receiving ethernet packets.
Discusses
SWIG extensions

Get the code: (93131 bytes)

Feb 2003:
Firewall Validation 2: Testing the packet generator with AX4000
Describes using the Spirent Ax4000 to measure line usage and confirm that the dnet extension can saturate a 100-B-T line.
Discusses:
ax interface analyzer
enet

Get the code: (93131 bytes)

Noumena\
Noumena\
Apr 2003:
Firewall Validation 3: Generating packets and validating the code
Describes object style programming using the namespace command in the context of building broadband packets, and then describes validating the new procedures.
Discusses
namespace variable tcltest

Read the article

Get the code: (22108 bytes)

Jun 2003:
Firewall Validation 4: Capturing and Analyzing Packets with an AxTcl
How to use AxTcl on the Spirent AX-4000 to capture packets and display statistics and packet contents.
Discusses:
ax interface analyzer
enet

Read the article

Get the code: (872 bytes)

Noumena\
Noumena\
Aug 2003:
Firewall Validation 5: Monitoring log files with Expect
Tcl's Expect extension is ideal for automated scanning log files. This article describes watching the log files to confirm that expected events occur.
Discusses
spawn expect exp_send proc

Get the code: (824 bytes)

Oct 2003:
Firewall Validation 6: Client/Server sockets
Tcl's Socket interface is clean and simple. This makes it an ideal choice for developing client/server applications.
Discusses:
socket (client) socket (server) flush
fconfigure fileevent vwait

Get the code: (1601 bytes)

Noumena\
Noumena\
Feb 2004:
Firewall Validation 7: Secure Sockets, TLS and creating a simple Certificate Authority
For secure applications, you need secure communications. The TLS extension allows Tcl sockets to use SSL for communications. This article describes setting up private certificates for secure private communications.
Discusses
tls::socket tls::handshake
interp create interpName alias

Get the code: (13364 bytes)

Apr 2004:
Firewall Validation 8: Mobile Agents in Tcl
A client application can send a Tcl script an Agent server for remote evaluation. This article describes creating an Agent based client/server pair, using SSL to ensure that only scripts from trusted agents are evaluated, and evaluating scripts in a Safe sandbox.
Discusses:
safe::interpCreate safe::interpAddToAccessPath
safe::interpDelete info complete

Get the code: (13809 bytes)

Noumena\
Noumena\
Jun 2004:
Fortran/Tcl 1: Using Tcl with FORTRAN
Adding a Tcl intepreter to a FORTRAN program is an easy way to extend your FORTRAN programs to support graphics, networks, configuration files, etc. This article describes how to link the Tcl interpreter to a FORTRAN application and use a Tk GUI for input and output.
Discusses
ftcl_start labelframe entry
button label vwait

Get the code: (20656 bytes)

Aug 2004:
Fortran/Tcl 2: Making a better GUI for FORTRAN Applications
Demonstrates the flexibility of writing a GUI as script appended to a compiled application. A GUI script is easy to modify and extend without affecting the core application. You can even change a challenge/response application to a real-time application.
Discusses:
labelframe image scale

Get the code: (29652 bytes)

Noumena\
Noumena\
Oct 2004:
Fortran/Tcl 4: Generating a graphic display with the canvas widget
FORTRAN applications can generate lots of numbers. The Tk canvas provides a good tool for visualizing that information.
Discusses
canvas scrollbar canvas bind
canvas xview/yview create line create polygon

Get the code: (29605 bytes)

Feb 2005:
Fortran/Tcl 3: Wrapping a FORTRAN/Tcl with TOBE
In order to distribute a FORTRAN/Tcl application, either the client needs to have Tcl installed, or you need to wrap the application into a single executable. D. Richard Hipp's TOBE wrapping solution is best for this application.
Discusses
Wrapping Applications Editing the TOBE Makefile Tcl_Init
Tcl_EvalFile Tcl_FindExecutable Zip

Get the code: (87293 bytes)

Noumena\
" "
Noumena Corporation
9300 Fleming Rd
Dexter, MI 48130
(734) 426 - 1066
clif@noucorp.com


Noumena Corporation homepage