|
|
Tcl/Tk training with Noumena Corporation
|
|
Tcl/Tk training sessions provided by Noumena Corporation are modular and
focused to allow you to tailor a training series to meet your needs. The
alternate lectures for sessions (such as 131, 132, or 133) include the
same basic material, but the examples and supplemental information are
tailored to specific application domains.
The Basic Tcl/Tk Training course (usually 3 days) consists of 4
of the 100 level sessions (110, 120, one of 131, 132, or 133 and one of
141 or 142) to provide a solid foundation of Tcl/Tk knowledge, plus two
of the 200 level sessions to build on that foundation with focused
information.
The Mini lectures present focused instruction on topics that don't
warrant a full lecture. These lectures can be added to a multi day
training session at no charge.
Noumena Corporation will be happy to customize a set of lectures to meet
your specific needs.
As suggestions, these lecture sets are optimized for common
requirements:
- The business/database series: 110, 120, 132, 142, 231/232/233, and 220.
- The systems/network admin series: 110, 120, 131, 141, 210 and 220.
- The web administrator series: 110, 120, 131, 141, 250, 350, and 360 or 335.
- The database-backed web developer series: 110, 120, 131, 142, 231/232/233, 350 and 335 or 360.
- The developer/tester series: 110, 120, 133, 141, 210 and 220.
|
|
|
|
|
|
|
Tcl-110: Introduction to Tcl/Tk
|
Introduces Tcl/Tk.
Describes why and where Tcl is being used, the language's strengths, and
tools for learning, programming, and debugging Tcl code.
Introduces Tcl syntax, substitution rules and basic commands.
Example: Build a GUI calculator with 30 lines of code.
- An overview of Tcl/Tk
- Discussion of Tcl/Tk features
- Discussion of Tcl/Tk command syntax
- Describe Tcl variables, assignment, loop commands,
- Describe Tcl/Tk development tools
- List resources for learning and extending Tcl/Tk
- Demonstrate building a Tcl/Tk application
This session covers:
| set |
expr |
for |
| append |
exit |
button widget |
| foreach |
label |
widget grid |
|
|
|
|
|
|
|
Tcl-120: Tcl as Glue
|
Introduces using Tcl/Tk as a wrapper for other programs,
starting and retrieving input from the slave tasks, and displaying the output.
Example: button bar to automate and organize tasks.
- Tcl/Tk and Large Program Management
- Describe the Tcl list variables
- Introduce Local/Global variable Scope
- How to create Tcl procedures with a fixed number of parameters
- How to create Tcl procedures with default values
- How to create Tcl procedures that accept an undefined number of parameters
- Invoking new programs from a Tcl script
- Retrieving status and output from child tasks
- Displaying large amounts of text
This session covers:
| file commands |
scrollbar widget |
text widget |
| eval |
proc |
toplevel widget |
| exec |
list commands |
file selector widget |
| source |
cd |
more grid options |
| switch |
|
|
|
|
|
|
Tcl-131: String Manipulation with Tcl/Tk for web/network engineers
|
|
This session introduces methods for parsing strings using
Tcl's list, string and regular expression support.
Example: A web robot that will download an html page,
parse the page, retrieve a selected item from the page and
display a downloaded image on a canvas.
- Large Program Management with Tcl/Tk
- Using package and namespace
- Parsing with string commands
- Parsing with regular expressions
- regular expression syntax
- Introduce the canvas widget
This session covers:
| string commands |
regexp |
regsub |
| http package |
canvas widget |
image widget |
|
|
|
|
|
|
|
|
Tcl-132: String Manipulation with Tcl/Tk for business/database specialists
|
|
This session introduces methods for parsing strings using
Tcl's list, string and regular expression support.
Discusses parsing data from flat ascii report
files and generating formatted reports from database files.
Example: Parsing report data and generating a barchart.
- More Tcl/Tk and Large Program Management
- Using package and namespace
- Local/Global Scope
- Parsing with string commands
- Parsing with regular expressions
- regular expression syntax
This session covers:
| string commands |
regexp |
regsub |
| format command |
canvas widget |
TclODBC |
|
|
|
|
|
|
Tcl-133: String Manipulation with Tcl/Tk for testing applications
|
|
This session introduces methods for parsing strings using
Tcl's list, string and regular expression support.
Introduces the expect extension to Tcl.
Example: An automated email help robot that will invoke the Unix/Linux
mail program to read mail, parse for patterns, and send replies.
- More Tcl/Tk and Large Program Management
- Using package and namespace
- Local/Global Scope
- Parsing with string commands
- Parsing with regular expressions
- regular expression syntax
This session covers:
| string commands |
regexp |
regsub |
| spawn |
expect |
exp_send |
| max_match |
|
|
|
|
|
|
|
|
Tcl-141: Tcl I/O: Using files, pipes and sockets for web/network engineers
|
|
Introduces Tcl input/output. The lecture discusses reading
and writing to files, sockets and other programs.
The Tcl associative array is introduced, with examples describing
how it can be used to simplify a project.
More techniques for using the canvas are described.
Example: Using the socket commands to create a client/server
shared-whiteboard groupware project application.
- Client/Server Architecture in Tcl
- stdin and stdout
- File channels
- Sockets
- Configuring a channel
- Commands for manipulating associative array elements.
- Commands for manipulating entire associative arrays.
- Techniques for data organization with naming conventions.
- Creating a canvas
- Creating items on a Tk canvas
- Manipulating the items on a canvas
This session covers:
| array set/get/names |
client and server sockets |
fileevent |
| canvas widget |
scrollbar widget |
Complex client/server architecture |
|
|
|
|
|
|
Tcl-142: Tcl I/O: Using files, pipes and sockets for business/database specialists
|
|
Introduces Tcl input/output. The lecture discusses reading
and writing to files, sockets and other programs.
The Tcl associative array is introduced, with examples describing
how it can be used to simplify a project.
Example: A Client/Server layer over Microsoft Access,
that displays client activity with a real-time barchart.
- Client/Server Architecture in Tcl
- stdin and stdout
- File channels
- Sockets
- Configuring a channel
- Commands for manipulating associative array elements.
- Commands for manipulating entire associative arrays.
- Techniques for data organization with naming conventions.
- Creating a canvas
- Creating items on a Tk canvas
- Manipulating the items on a canvas
This session covers:
| array set/get/names |
client and server sockets |
fileevent |
| canvas widget |
scrollbar widget |
TclODBC connection to a database engine |
|
|
|
|
|
|
|
Tcl-143: Tcl I/O: Using files, pipes and sockets, router test harness
|
|
Introduces Tcl input/output. The lecture discusses reading
and writing to files, sockets and other programs.
The Tcl associative array is introduced, with examples describing
how it can be used to simplify a project.
The use of the Expect extension is reviewed and expanded on.
Example is a test harness that runs multiple tests on a simulated router.
The harness, tests and the techniques used to simulate the router are described.
- Client/Server Architecture in Tcl
- stdin and stdout
- File channels
- Sockets
- Configuring a channel
- Commands for manipulating associative array elements.
- Commands for manipulating entire associative arrays.
- Techniques for data organization with naming conventions.
This session covers:
| array set/get/names |
client and server sockets |
fileevent |
| Expect timeout and buffer size |
Usnig the expect_out associative array |
Expect debugging |
|
|
|
|
|
|
|
|
Tcl-199: Review for experienced Tcl/Tk programmers
|
|
This lecture presents a quick overview of the Tcl material covered in
the other 100 series lectures. It's designed for programmers with 2-12
months of self-taught experience with Tcl.
The basic commands are introduced, with discussion of the
less obvious features of the commands that new Tcl users may be
unaware of.
Substitution rules are described in detail.
Topics covered include:
- Decision commands -
if, switch
- The Tcl loop commnds -
for, foreach
- Creating and using procedures in Tcl
- The Tcl data structures: simple variables, lists and arrays
- Tcl string processing commands
- Glob rules
- Regular Expressions
- Tcl file I/O
- Error handline
This session covers:
| if |
switch |
for |
| foreach |
proc |
array set |
| array get |
array names |
lindex |
| string |
format |
regexp |
| regsub |
open |
puts |
| exec |
gets |
eval |
| error |
errorInfo, errorCode |
catch |
|
|
|
|
|
|
Tcl-210: Tcl Introspection
|
Shows how the
uplevel and upvar commands are used with
associative arrays.
Discusses the variable tracing, binding, and event scheduling.
Example: Describes how a GUI can be attached to a piece of code
that has no GUI components using variable tracing and bind to monitor
and control the code behavior.
- Using the info command to examine the interpreter state.
- Creating dynamic procedures with the info command.
- Using the trace variable command to examine or modify data.
- Using the uplevel and upvar commands.
- Using the bind and canvas bind commands
This session covers:
| info |
upvar |
uplevel |
| bind |
trace |
after |
| catch |
errorInfo |
error |
|
|
|
|
|
|
|
|
Tcl-220: Modularization: source, package and namespaces
|
|
Describes the details
of using the packages and namespaces, how to organize code modules,
create index files, and find packages.
Example: A Tower of Hanoi game using namespaces to create
private stack data structures for each post.
- The source command
- Using packages
- Creating a package
- Package numbering conventions
- Using a procedures within a namespace
- Creating a namespace
This session covers:
| source |
package |
namespace |
| pkg_mkIndex |
import |
export |
| pkgIndex.tcl |
auto_path |
init.tcl |
|
|
|
|
|
|
Tcl-230: Advanced Regular Expressions.
|
Discusses the new Advanced and Extended
regular expression features introduced with Tcl8.1.
- Controlling the number of matches to a pattern
- Class definitions
- Constraints
- Basic regular expressions
- Advanced regular expression rules
- Extended regular expression rules
This session covers:
| parenthesized expressions |
new regexp command options |
| alpha, upper, lower, etc classes |
?, {X}, {X,Y} modifiers |
| 'backslash' escape constraints |
|
|
|
|
|
|
|
|
Tcl-231: Intro to Relational DBs with Sybase
|
This lecture explains what relational databases are and how to
use the SQL language to create and modify database tables.
The lecture describes either the SybTcl extension
to the Tcl language.
Example: Convert data from a generic ASCII report to a set of
relational tables.
- Vocabulary overview
- What is SQL
- Introduce the essential subset of the SQL language
- Create Table
- Insert
- Select
- Delete
- Update
- Using SQL with sybTcl
This session covers:
| sybconnect |
sybuse |
sybsql |
| sybnext |
sybcols |
sybcancel |
| sybclose |
|
|
|
|
|
|
Tcl-232: Intro to Relational DBs with OraTcl
|
This lecture explains what relational databases are and how to
use the SQL language to create and modify database tables.
The lecture describes either the OraTcl extension
to the Tcl language.
Example: Convert data from a generic ASCII report to a set of
relational tables.
- Vocabulary overview
- What is SQL
- Introduce the essential subset of the SQL language
- Create Table
- Insert
- Select
- Delete
- Update
- Using SQL with oraTcl
This session covers:
| oralogon |
oraopen |
orasql |
| orafetch |
oraclose |
|
|
|
|
|
|
|
|
Tcl-233: Intro to Relational DBs with TclODBC
|
This lecture explains what relational databases are and how to
use the SQL language to create and modify database tables.
The lecture describes either the TclODBC extension
to the Tcl language.
Example: Convert data from a generic ASCII report to a set of
relational tables.
- Vocabulary overview
- What is SQL
- Introduce the essential subset of the SQL language
- Create Table
- Insert
- Select
- Delete
- Update
- Using SQL with TclODBC and MS-SQL.
This session covers:
| database connect |
database configure |
evaluate SQL commands |
| processing row data |
database disconnect |
|
|
|
|
|
|
Tcl-240: Procedure control with expect
|
Introduces the Expect
extension, how to control one or more child processes with expect,
reviews string commands and regular expressions.
Example: An email robot
that uses expect and the mail program to read mail, parse for
patterns, and automaticly send replies.
- Starting the expect interpreter
- Starting child tasks
- Sending data to child tasks
- Receiving data from child tasks
- Parsing with string commands
- Parsing with regular expressions
This session covers:
| string commands |
expect |
timeout |
| regexp |
exp_send |
max_match |
| regsub |
spawn |
exp_internal |
| expect_out |
|
|
|
|
|
|
|
|
Tcl-250: Web Programming with Apache and Tcl
|
Introduces the basics of what a web server is and how to configure
an Apache server.
Introduces cgi.tcl.
Example: A simple page counter.
- What is a web server
- Directory layout
- Configuration options
- CGI introduction
This session covers:
| httpd daemon |
http client/server interaction |
| httpd.conf file |
html, bin, cgi-bin, htdocs, icons and man directories |
| CGI environment variables |
GET and POST methods |
|
|
|
|
|
|
Tcl-260: Procedure control with DDE
|
This lecture describes initiating and interacting with child
processes on a Windows platform using the open,
exec command and dde commands.
String processing with format and scan
are discussed.
Example: Starting Excel, loading a spreadsheet, reading data from it,
and generating a simple graph.
- Starting the expect interpreter
- Starting child tasks
- Sending data to child tasks
- Receiving data from child tasks
- Parsing with string commands
- Parsing with regular expressions
This session covers:
| open |
exec |
format |
| scan |
dde connect |
dde exec |
| dde poke |
dde request |
|
|
|
|
|
|
|
|
Tcl-290: Constructing a Tcl Extension
|
|
Explains how to build a Tcl extension with the C programming language.
Describes the required C files and functions, function and file naming
conventions, creating a makefile for VC++ or Linux/Unix and
the Tcl functions that support extensions.
Example: A checksum extension.
- Reasons for building extensions
- Extension components
- Functional aspects of an extension
- Implementation details of an extension
- Transfering data between Tcl scripts and C code extensions
- Transfering status information between Tcl scripts and C code extensions
- Naming conventions
This session covers:
| extension_Init |
Tcl_NewIntObj |
Tcl_SetObjResult |
| Tcl_WrongNumArgs |
Tcl_NewDoubleObj |
Tcl_PkgProvide |
| Tcl_SetVar |
Tcl_NewStringObj |
Tcl_CreateObjCommand |
|
|
|
|
|
|
Tcl-310: Intro to Incr Tcl
|
This session introduces the [incr Tcl] extension for
object oriented programming in Tcl.
Object oriented concepts including classes, objects, inheritance,
containers and protection are introduced.
An object oriented card game is built as an example.
- Programming language families
- Features of Object Oriented languages
- Constructing classes
- Composition/has-a relationships
- Class and Object methods
- Class introspection techniques
- Incr Tcl variable protection levels
This session covers:
| class |
body |
configure |
| variable |
cget |
info |
|
|
|
|
|
|
|
|
Tcl-320: Intermediate Incr Tcl
|
This session describes more techniques and procedures for
working with [incr Tcl] and object oriented programming in Tcl.
It expands on the information in Tcl-310.
Inheritance, composition and the relationship between Tcl global
variables, object variables and the Tk widgets are discussed.
The classes used in the example from Tcl-310 are extended with
inheritance and composition to create a graphical solitaire card game.
Topics discussed include:
- Aggregation, Composition and Inheritance
- Single and multiple inheritance
- Variable inheritance
- Namespaces and scoping rules
- The
$this variable
This session covers:
| class |
inherit |
scope |
| variable |
namespace current |
namespace code |
info |
|
|
|
|
|
|
Tcl-325: Advanced Tk: Creating megawidgets in namespaces
|
This lecture expands on the namespace material presented in
lecture Tcl-220 to demonstrate using namespaces with Tk to create new
compound widgets that present a single interface to the user.
The lecture expands previous coverage of Tk's object oriented aspects,
and introduces several more Tk widgets.
The example shows how to build an icon-based button selector to
change modes in an application, similar to the iconic task bars in
Windows applications.
Topics covered include:
- Using the frame widget
- Selection widgets - listbox, checkbutton, radiobutton and menu
- Megawidgets for use in a single application
- Megawidgets for reuse in multiple applications
This session covers:
| rename |
namespace code |
frame |
| radiobutton |
checkbutton |
menubutton |
| menu |
listbox |
|
|
|
|
|
|
|
|
Tcl-335: Using the Tcl slave interpreter
|
Explains how to use the Tcl interp command to create new
slave interpreters.
Example: An agent-style client-server application to evaluate
suspect code in a safe manner.
- Starting a child interpreter
- Starting a safe child interpreter
- Evaluating commands within the interpreter
- Mapping procedures between slave interpreters
This session covers:
| interp |
interp -safe |
| interp eval |
interp alias |
|
|
|
|
|
|
Tcl-350: CGI Programming with tcl
|
Explains how to use the cgi.tcl package from NIST to construct
Tcl cgi applications.
Covers generating HTML pages and using CGI scripts to acquire
input from users and track cookies.
Example:
- Layout of a cgi.tcl script
- Font control commands
- List commands
- Table commands
- Form commands
- Accessing input
- Using cookies
- Setting a cookie
- Accessing cookies
This session covers:
| cgi_cookie_list |
cgi_import_cookie |
cgi_cookie_set |
| cgi_cookie_get |
cgi_eval |
cgi_debug |
| cgi_head |
cgi_title |
cgi_body |
| cgi_h# |
cgi_puts |
cgi_p |
| cgi_br |
cgi_img |
cgi_bold |
| cgi_number_list |
cgi_bullet_list |
cgi_li |
| cgi_table |
cgi_table_row |
cgi_table_data |
| cgi_form |
cgi_submit_button |
cgi_select |
| cgi_option |
cgi_checkbox |
cgi_radio_button |
| cgi_input |
cgi_import_list |
cgi_import |
| cgi_import_as |
|
|
|
|
|
|
|
|
Tcl-360: Tcl and XML
|
Introduces the XML language and the Tcl-XML and tclexpat packages for parsing XML
documents.
Describes the layout of an XML document and the DocType DTD.
Examples describe parsing and validating XML documents using a DTD
and internal tags or attributes
- Describes components of an XML Document
- Describes XML tags
- Describes components of an XML DTD
- How to load tclexpat
- How to load Tcl-XML
- Parsing documents with tclexpat and Tcl-XML
This session covers:
| creating a parser |
confirming a document is well-formed |
| parsing a document |
confirming a document is valid |
| parsing a DTD |
|
|
|
|
|
|
Mini-110: Tcl Debugging Techniques
|
Describes static and interactive techniques for debugging Tcl/Tk applications.
The lecture comes in two flavors:
- Tuba
- An interactive multi window based debugger.
- TclPro ProDebug
- An interactive multi window based debugger.
- Static debugging techniques
- puts
- log to a window
- log to a file
- checking program state with tk_messageBox
- using the trace variable command
- using the info level command
- enabling/disabling output
- Interactive debugging techniques
- Starting the debugger
- Setting breakpoints
- Examining data
- Controlling program flow
This session covers:
| puts |
trace variable |
info level |
| catch |
error |
info complete |
|
|
|
|
|
|
|
|
Mini-120: The MyrmocoX IDE
|
|
Introduces the MyrmocoX Integrated Development Environment for Tcl.
Describes how to open a program file, edit data, and use the debugger.
- Acquiring the package
- Installing the package
- Editing
- Debugging
This session covers:
| open file |
save file |
| start debugger |
set breakpoint |
|
|
|
|
|
|
Mini-130: The Synopsis Primetime extension
|
|
A brief introduction to using the Tcl extension for
the Synopsis Primetime package.
Describes what the Primetime package does, and
compares the Tcl extension with the Primetime shell language.
- New data types: Collections, Objects, Attributes
- New I/O commands
- Primetime specific commands
- Creating collections
- Filtering collections
- Adding objects to collections
- Removing objects from collections
This session covers:
| printvar |
echo |
get_attribute |
| get_unix_variable |
query_objects |
list_attributes |
| report_attribute |
define_user_attribute |
set_user_attribute |
| remove_user_attribute |
add_to_collection |
remove_from_collection |
| foreach_in_collection |
collection commands |
filter_collection |
|
|
|
|
|
|
|
|
UML-110: UML Overview
|
Introduces the basics of UML and the standard diagrams.
- What is UML?
- When to use the diagrams
- Overview of diagrams
This session covers:
| use case |
class |
object |
| sequence |
collaboration |
flowchart |
| activity flow |
state diagram |
|
|
|
|
|
|
UML-210: UML: The Use Case
|
Introduces the UML use case diagram and explains how and when
it can be used.
- Developing requirement consensus with customer.
- Defining the functions a package must perform.
- Identifying Actors that will perform the functions.
- Identifying functions which will require multiple actors to interact.
- Delimiting boundaries of the problem.
This session covers:
| graphical use case |
textual use case |
|
|
|
|
|