3 Intermediate Computer Tools

being revised June 2006 - links updated
Google site search

ContentsIntroductionBasicIntermediateAdvancedFuturePolicyInfrastructure
You need the Tcl Plugin to read this page. If this spot  is not green (v2) or cyan (v3)you may want to download the latest Tcl Plugin.

3.1   Introduction - Tool Review        

It is easy to believe that working with computers is a highly skilled job, but by 1995 this ceased to be the case. This was not due so much to the web which had not yet become ubiquitous, but due to businesses using basic tools to cut clerical costs. These days an office clerk earning $15 per hour is typically expected to be proficient with the use of a word processor, skilled at data entry, be able to query a database, and do large printing jobs such as a customer mail-out.

The topics covered in this section should be considered core skills.

On the other hand - covering only these skills does not mean that a student is only fit for a job as typist. There are many specialised computer tasks which this intermediate section provides a basic grounding for careers such as

The web, by itself, is creating new job definitions every week that have never been conceived of, and that do not require more than the development of skills based on this intermediate section. Here is a review of some of the basiccomputer program tools.

3.1.1   Word Processor        

The Word Processor has become such a basic computer tool that it hardly requires special schooling. But certain issues need to be addressed. Since it is so prevalent any student who does not have access to a Word Processor is going to be disadvantaged. Teachers should determine that all students have ready access to a Word Processor.

Teachers should also make sure that students develop good keyboard skills. As an example, something approaching touch typing is not an optional requirement but is a necessary skill that should be encouraged and rewarded. Students should at least attempt some of the basic typing tutors to adopt a 10 finger profficiency and hand positions. I personally find my touch typing is too slow comparerd to my 'glance' typing.

A Typing Tutor should be available for use at secondary Schools so that students who may have missed out at Intermediate School can catch up.

3.1.2   Secretarial Functions email, messaging, mail merge        

Secretarial Functions that involve computers include Historically, Management and Secretarial tasks were separated. This was because the main piece of technology, the typewriter, had several faults. The laptop computer is portable, quiet and unobtrusive. The Word Processor allows rearranging, editing and reformatting as an integrated part of the data capture process. For all these reasons Managers now learn touch typing and do much of the Secretaries traditional duties. Use of a Word Processor is now a basic Management as well as Secretarial skill. In today's business environment a Secretary is more likely to be doing larger scale jobs such as In a large company, just one of these tasks is a full-time job. In a small Company of say six employees or less the Secretary may be expected to be fully involved in all of these tasks.

3.1.3   Image Editing        

In the Basic section image editing software was covered and software pertinent to that level deiscussed in more detail. This Intermediate Section is the place to look at the next level of tools for those who are interested in a career designing and creating with computer software.

3.1.3.1   Image Painters        

At this level one should develop a good working knowledge of how to use image editors. This should include doing all the tutorials that come with the software, and engaging in projects which use the software creatively such as poster design for school concerts or productions. It can also include making images for use in other computing areas such as textures, clothing and faces for 3D objects and avatars.

Exercise - write a list of functions and features which should be covered at this level.

3.1.3.2   Vector Image Painters        

Vector Image painters can be quite complex and a full working knowledge of a product is more suited to advanced level. But a basic proficiency should be developed at this level.

Exercise - write a list of functions and features which should be covered at the intermediate level.

3.1.3.3   3D Painters        

Active Worlds is a good place to start here. While active Worlds itself can be regarded as a kind of 3D painter, here the topic is concerned with creating objects to put in the 3D World using such programs as RenderWare Modeler. One should have access to an Active World in which one can build and install new models. This will also involve creating textures for the objects. Some good objects to start on are plants and furniture.

Trees modeled in 3D have always been a test piece. Todaty we can get reasonably close to producing something tree-like without burning out a computer chip. Various techniques are used for this, many involving reuse of model primitives combined in interesting ways. But a lot can be acheived with quite simple models which are nested and have transparent texture maps of leaf clusters. The kinds of objects which we find in gardens such as hedges, stands of bamboo, edging, topiary etc. Furniture is also good subject for beginners. This means assembling perhaps 8 components to for a simple chair, or 5 for a table. It doesnt sound like much but modelling in 3D is quite a science and producing styish furniture in this medium is a good way to design furniture and to explore style.

mean using RWModeler or some similar 3D modelling program. Creating textures for objects, mapping the textures and using the objects in a 3D World. Some basic actions in Active Worlds can be attempted too such as opening doors, creation of objects on user interaction etc. If you have your own Active World, then it is only a small matter of time before you set up bots to act as guides in it using Xelagot. This is a basic introduction to robot avatars which is a topic in virtual reality, but effectively comes with the package of managing 3D Worlds.

VRML worlds could also be explored at this level, but the principles are similar to Active Worlds and you dont get the same immediate satisfaction because you do not interact with other people and get their feed-back on a realtime basis. Because of this VRML should be left until it is necessary to use it. That is, it need not be included in any curriculum because the principles are covered in other areas.

3.1.3.4   Animation        

3.1.3.5   Video Editor        

There are many video editors readily available, many provided free with the video cards. For anyone using a camcorder, the concepts in video editing are not particularly new or challenging. The notions of videotape format and transitions are familiar from using the camcorder, so the only new notions are to do with multiple tracking.

One additional notion that video editing does provide, is the abstract video: a video constructed entirely from transition effects.

Editing video can take a lot of time. It is best to carefully plan what is to be recorded and create the video without relying too much on editing.

3.1.3.5.1   Exercise 1 - Video Editor Survey        
Survey current video editors. Base the survey on ease of use end learning curve for Basic, Intermediate and Advanced level users.
3.1.3.5.2   Exercise 2 - Video Editor functions and concepts        
List the functions and concepts of video editingt that should be covered at the Intermediate level, That is, greater than beginnier level but less than professional level.

3.1.3.6   Animation Editor        

Animations may appear to be simpler than videos, partly because they tend to be small images embedded in a webpage, and to only do simple things over a short timespan. However they involve additional concepts, such as sprites, 3D-objects, rotation, movement and so on which are more complex than the basic concepts of video editing. However animation editors are often used to construct the titles and credits for videos.

For more complex painters that model 3D lettering and logos see the Advanced Chapter.

3.1.3.6.1   Review of 3D GIF Designer        
The following is the abstract copied from TUCOWS who gave this software a 4 cows rating 28 Aug 2000.

Version Number: 2.2
Revision Date: May 24th, 2000
License: Shareware
Byte Size: 1,899,355
Cost: $49.00
Home Page: http://www.pysoft.com/?GIF_Designer_fr.html
Also Available: Windows 2000 Version
Also Available: Windows NT Version

Description: 3D GIF Designer produces animated high-quality 3D pictures, titles, banner ads and buttons for your Web page or for a presentation. You can create animations from your own pictures (JPG, GIF, BMP, AVI) and easily add 3D text and shapes. The sprites technology enables control over placement, size, motion, appearance, soft-edged shadows and opacity. You can add unlimited number of 3D text strings with own color, font, size, extrusion, texture, rotation and lighting. For quickly getting started, design your own animation from over 30 professional templates (banners, buttons, logos), and then save as animated GIF or AVI movies, or as set of JPEG or BMP files. The files have optimized size and are 90 percent smaller than non-optimized. In addition, 3D GIF Designer allows you to animate sprites with several effects such as Swing, Rotate, Blink and Animated Coloring.

This software is reasonably priced. The shareware version plants a small demo logo in all saved files which precludes use in production. But for instructive use the program is good and uses a structured object model by which to construct and edit animated GIFs with 3D style lettering. However the Help menu, while reasonably complete does read as though it was translated literally from the Taiwanese.

3.1.3.6.2   Macromedia Flash        
Macromedia Flash is a complex tool to learn to use fully. The reason why it is in the Intermediate Section rather than the Advanced Section, is that it is mainly used to provide streaming animation to webpages. Flash has been extended with a whole host of functions and objects so that you can do almost anything in Flash that you can do in JavaScript, or HTML itself. As such Flash only replicates functions readily accessable by other simpler means. Therefore only the basic elements of Flash need to be covered, those that provide the provide the functions which make Flash Special.

3.1.3.7   Spreadsheet        

Spreadsheet use can vary from relatively simple tabulation to calculation of electrical plate voltages using recursive algorithms.The basic principles of spreadsheets are fairly easy to grasp. But they can be used in sophisticated ways. This is dependant more on ones knowledge of maths than knowledge of how to use spreadsheets.

3.2   Running a Web Server        NEW May 2006

As the projects later in the Intermediate Section involve cgi scripts and other applications on a webserver, this is the place to look at how to run a webserver. The actual program required to interact with the net and serve html pages over the web is quite small, only about 250 lines of Tcl code, and there are micro webservers that run in very small machines, even down to the size of a mobile phone thes days. However for practical purposes , ease of management, and integration with the rest of the computer fetures a much larger program is normally used. But some webserver programs with lots of features are still simple to use and some run "out of the box" , cost nothing, and run on your computer at home. Two of them are:

3.2.1   Sambar Server        NEW May 2006

The Sambar Server has been around for many years and has functioned reliably. It is free to download and use if you are not using it in a commercial context, for instance for educational use at home. It self installs easily and runs out of the box. There are easy to use configuration sections which you will need to make changes to in order to run the tcl cgi scripts that you write or download later. It also has an ftp server for uploading files by ftp and other server features which are added to.

The Sambar Server performs dynamic page serving using the classic cgi script method. Sambar has perl embedded but handles cgi scripts in any scripting language. Under Windows this is managed by the Windows Registry. If you can run a .tcl script under Windows then your .tcl scripts will run in Sambar. Your tcl scripts need to use a cgi package such as cgi or ncgi, to communicate with the server and client. Cgi scripting is covered later in the Intermediate Section. Sambar also has shtml pages with some dynamic functions provided by the server, such as time, date last updated etc. Sambar also has https, Secure http protocol.

The Sambar Server is recommended for beginners as it has the lowest learning curve and the easiest support environment.

3.2.2   Tclhttpd        NEW May 2006

The Tcl server is called Tclhttpd which breaks up into Tcl-http-deamon. The deamon being the program that runs in the background waiting for service calls. This is written almost entirely in Tcl with a tiny portion precompiled for Linux, Windows and Mac. You should have the ActiveState Tcl distribution installed before you attempt to run this server.

Tclhttpd offers cgi which assumes the use of .tcl scripts. So it can be used the same way as the Sambar Server. However Tclhttpd has alternative methods for delivering webpages that are far more efficient, called "direct domain URL". In this case the webpages are part of the server program itself and use the same Tcl namespace. This requires a little more careful thinking about how you structure your website on the server, particuluarly if the server is being used for several different sites or projects. The Cgi architecture automatically keeps everything seperate, but with direct domains, everything gets put together in the same pot, so to speak, and care needs to be taken with the way you manage global variables.

For these reasons it is recommended that you use Sambar for the Intermedite Section projects, using cgi scripts. This keeps everyones work in isolation and also in more manageable self-contained units. Once you become proficient with Tcl then move onto using Tclhttpd.

Tclhttpd does not have an easy to use management interface, instead you simply alter configuration scripts written in Tcl. This is anaother reason to defer using tclhttpd until you are a confident Tcl user and understand the configuration details of a webserver.

3.2.3   Line connection        NEW May 2006

There are a number of ways you can connect to the internet from home. The two most usual are dailup 56k Modem, and DSL Modem. Either of these can be used with a webserver but the 56k Modem line has obvious bandwidth .limitiations and will not support a graphics intensive use.

The 56k Modem line has another limitation. Your ISP will most likely not give you a permanent IP address so that others can access your server using the same IP address all the time. This means that for others to see you server you must tell them your current IP address each time they try to access your server. For this reason the 56k Modem line is only good for hobbyists, and those learning how a webserver works, or developing a website that will then be uploaded to a site with a permanent IP address. This means you can do all your web development at home on your own test webserver, before unleashing your creation on the rest of the world.

3.2.4   DSL connection        NEW May 2006

A 56k Modem is a farily primitive device, but a DSL Modem requires a bit of configuration before your webserver can be seen on the net. You also need to do some configuration in your operating system. Check out this tutorial for details.

3.2.5   Wiki        NEW June 2006

A wiki is a website with collaborative authorship. The general idea is that anyone can edit the pages in a wiki site. "wiki wiki" is the Hawaiian for "quick". The idea being that a wiki provides a quick reference. This is done by maintaining a page title index, while the pages themselves have an independant numbering system.

Wikis have lately become in vogue, but are not just a passing fad. Wikis have some highly desirable properties that are missing from other web entities. Anyone can contribute information - but this also has a negative aspect in the form of abuse. Wikis use an integer number to identify each page in the wiki. This makes each page URL independant of its content and its title. This means that a number of more flexible methods can be used to bookmark wiki pages without the bookmarks getting out of date. This index/search system works well for large bodies of information.

There are now several different flavours of wiki, depending on the page content of the wiki, the editorial state of the page, and editorship constraints.

Wikit, the Tcl wiki is a fairly simple system compared to wikibooks. Wikibooks recognises 6 levels of page state from framework, through to draft to complete. Wikit has no page state. Many wikis now require you to register before you can edit the wiki. A cookie is created so that your activity on the wiki can be traced. Wikit does not have this feature either (yet).

A wiki has no internal structure except for the links that people put into it. This is ultimately a good thing. It means there is no formal organisation, compared say to the layout of Webscool Chapters. Therefore there are no maintanance issues. The negative aspect of this is that pages may not address their audience at the user's level. The Tcl wiki for example makes few consessions to tyros, although much information is included to help beginners.

With respect to page content, some wikis such as wikibooks present text and image. Wikit is designed for users who will be wanting to write html and tcl code in the pages. For this reason Wikit uses a markup language different to html so as to avoid contention. Markup Language is too grand a word for are a few simple formatting rules. Clearly, sophisticated presentation is not what Wikit is about when compared to wikibooks.

As a teacher you are recommended to contribute to a wiki to get the feel of how it works. Wikis are now being used to deliver the help subsystem of applications. Some pages in the wiki are read-only and others allow the user to add additional notes to the help documentation. There are also wiki diff programs which update your personal wiki with changes from a master wiki held on the net.

3.2.6   Start Your Own Wiki        NEW June 2006

One practical application you can begin to use on a webserver is a wiki. This is a web application which is to some extent generic. You can set up a wiki simply to see how it works, as a scratch pad for students, or to deal with a particular topic of interest to you.

There is a Tcl implementation of wiki called wikit.kit. As you can see by the .kit suffix, this is published as a starkit, so you also need tclkit to run it. The tclkit program is used as a base for running any application published as a starkit.

Once you have downloaded these two programs are you ready to start. Under windows tclkit.exe is best kept in your C:Tcl/bin directory where it can be found by Windows easily. To run a wiki as a standalone application

tclkit.exe wikit.kit
should get you started and set up a wikit.tkd wiki file in your home directory, i.e. at the same level as My Documents.

The wiki has several pages already builtin on how to use the wiki. Wiki's are now often used as a help subsystem to document applications.

wikit has a builtin webserver. To start wikit as a webserver:

tclkit.exe wikit.kit -httpd <i>port</i>
The port is typically 80 if this is the only server on your system.

A wiki keeps all its webpages in a .tkd file. As mentioned above the default file is wikit.tdk. To specify another file, invoke it as the first parameter, so to invoke the webscool wiki to run as a server I use:

tclkit.exe wikit.kit webscool.tkd -httpd 80
Wikit gives you a small wiki to start with, with a simple home page [1] and some help pages. The home page is called "My Wiki" which you will want to change the title of as well as the page contents. Changing the contents is provided for in the wiki, but changing the title of a page is not. However you can change the title of a page when running the wiki as a Tk program. When you edit a page you will see that the search entry field in the top right of the wiki window has changed to the page title. You can edit this.

3.2.7   Using Your Wiki        NEW June 2006

A page in wikit can be referred to by its unique number. The number followed by an exclamation mark (!) gives a list of pages which refer to this page. The title at the head of each page has a self referencing href with the (!). A page can be referred to by its title by using a search phrase. If there is an exact match (not case-sensitive) of the page title that page is shown. Less precise matches will return a list of candidate pages. This means that even if a pages title is changed somewhat you are likely to still be able to find it. This property of bookmark stability is a big plus when you compare it to the TKI site where everything gets reorganised every 2 years and bookmarks are broken frequently.

The Tcler's wiki has more detailed notes on searching a wikit wiki.

The skeleton wiki that is provided by ikit is worth a look. Ten pages are provided numbering 0 through to 9. Page 0 is the home page, which you can change to suit. Pages 1 through 9 are read-only via CGI but can be changed via the local wiki in Tk mode.

Page 1 is a reference to the wikit authors at equi4.com

Page 2 is the Search page

Page 3 is the Help page - This is a static page which you can change.

Page 4 is the Recent Changes page - This page generates its content from the wiki

Page 5 is the History page. - This page generates its content from the wiki

Page 6 is the Formatting Rules page. This is a static page which you may like to enlarge on at some stage.

Pages 7 and 8 are placeholder pages waiting for when (if) wikit needs to have an extra page in its initial setup. These pages should not be used.

Page 9 is some Tcl commands that set certain variables in wikit. Two variables are currently set:
ProtectedPages - this variable contains a list of page numbers which cannot be edited in the web/CGI environment. Thay can be altered in the local Tk environment.
EditInstructions - this variable contains the html that goes at the foot of every wiki page. You can edit this if you want to do something fancier, say with a logo.gif or add extra details. A grep on EditInstructions reveals that it is used in wikit.vfs/lib/wikit/web.tcl. This is the clue you need if you want to add other page formattinf featires to your wiki. Use the same technique - put the html code into wiki page 9 and alter web.tcl to put the variables contents in the right place in the wiki page for you. To do this you will need to unwrap the starkit, make the changes and wrap it again. The next section explains how to do this.

3.2.8   Exercise re wikit for later        Advanced Level

As soon as you try to author in a wiki you come up against stumbling blocks if you are fluent in html. The markup rules in wikit are quite limited. One of the reasons for this is that when someone allows others to insert any kind of content on their computer, they open themselves up to possible attack, by allowing the authors access to features which could affect the running of the computer. Isolating these features from outside authors is a tricky business which is dealt with more fully in the Plugin section below. So wikis tend to take a highly conservative view of what anyone is allowed to author on a webpage.

But when one looks at the possible applications of wikis, such as for preschoolers, one sees that more flexibility is required. A wiki for preschoolers isan interesting example. It is authored and edited by adults for a preschooler readership. But when you look at the good websites for preschooler readership you find that they rely largely on Flash with some additional JavaScript. Both of these application types pose potential problems, simply for the stability of the wiki let alone any additional computer security issues. So these are outlawed by all wiki systems, not just wikit. Check out for example wikibooks.com which has a complex range of markup features, but omits access to script, object and embed tags.

This exercise is for the Advanced section - to replace the wikit format procedures with a set of procedures which is more flexible and can admit the use opf Javascript, Flash and other plugins, including Tcl.

3.2.9   Starkits        NEW June 2006

A starkit is a directory and its dependant hierarchy wrapped up into a file which is effectively an executable program. A starkit program (.kit) is run by invoking it under tclkit. The tclkit program is operating system dependant, but the starkits it runs are not and can be run on on Linux, Windows and Mac as well as other operating systems for which tckit is gradually being written such as Nokia 770.This is why starkits are becoming a popular way of deploying applications.

tclkit can be got from http://www.equi4.com/tclkit.html. The Windows version is called tclkit.exe. Put this in the same directory as your tcl bin files (tclsh, wish etc) where it will be found easily. Under Windows, set up a .kit filetype with a run action tclkit.exe "%1"

One example of a starkit in common use is the tcl wiki, wikit.kit. To start your own wiki under windows use

tclkit.exe <i>wikit.kit  myownwiki.tdk</i>
To look inside a starkit, effectively unpack it, use the SDX (Starkit Developer Extensions) program, which is itself a starkit. This unwraps the file back into its directory structure much like unzip. I have found this awkward to do in Windows. Double click sdx.kit, having set up its default open behaviour under tclkit.exe. You then get a Tk Console and a seperate commandline window. In the command line window type unwrap /Tcl/sdx.kit and Enter to create the /Tcl/sdx.vfs directory and subdirectories.
sdx.kit unwrap /Tcl/sdx.kit

The tcl wiki has more basics on starkits including a recommendation for the fractal mountain demo.

The starkit archive has a library of starkits that you can just click and run if you have tclkit installed already. Of particular note here is the Tcl Tutor. SQLite is also available as a starkit.

3.3   Scripting Languages        

There are many scripting languages that are used in particular application domains. But there are also scripting languages which are generally available such as JavaScript, Perl and Tcl. All of these languages do similar jobs over a similar range of platforms but have different "flavours". JavaScript is a language with syntax rules, while Perl and Tcl are simpler but effectively more powerful languages. JavaScript is the de facto languiage used in webbrowsers (web-clients).Perl and Tcl are languages used for web-servers. There is no good reason for this division. It has resulted from large copmpanies jockeying for market position.

The projects given here focus on the use of Tcl. This is because Tcl is a language designed to interface with other programs and operating systems in powerful ways. It also has other useful properties for students:

  • Virtually no syntax or "rules" about how things have to be written. This has the important consequence that data can be program and vice versa.
  • Immediate hands on access to important computing constructs such as regular expressions
  • 3.3.1   Programming Methodology        

    This section addresses writing computer programs but is equally applicable to planning any reasonably complex task and is a major skill regardless of whether one learns a computer program or not. This should be considered one of the foundation blocks within an Information Technology course.

    This section introduces the basic processes in writing a program in any language, computer or otherwise. A program is a list of instructions that are written for a specific audience, man or machine, to follow in order to accomplish a specific task.

    Understanding the Problem

    Planning a Solution

    Coding

    Program Testing

    Documenting the Program

    Programming Exercises

    Some examples of programming exercises:

    3.3.2   Programming Language Overview        

    Give an inquiring child a toy and it will be taken to pieces to see how it works.

    Given a computer game an inquiring student will want to get inside it and see what makes it work. Most computer games are available only as programs written in a compiler language, which are then compiled into machine code which is unintelligible. But some games are written in scripting language which is executed directly as the program is run. Students will quickly discover this and want to know all about the scripting language.

    It is perhaps not productive to discuss compiler languages such as C and COBOL at this level. But scripting languages are accessible over the web and students are going to want to know about them very early on.

    There are two languages commonly used on the web, JavaScript and perl, and others which are not so well known such as Python and Tcl/Tk. In addition there are other more complex interpreted languages such as Visual Basic of similar complexity to Javascript.

    I have chosen to use Tcl is these examples. Tcl stands for "Tool Command Language" and is pronounced "tickle". Tcl is a very simple language with few "rules" and this simplicity means that it can be run on small computers. It is free and readily available. It is also available as a plug-in for web-browsers so that tcl scripts can run in web-pages. To this end it is useful for programming active exercises such as the Colour Theory Project. Tcl has a standard add-on called Tk which provides a relatively simple, easy to use, and intuitive Graphical User Interface. Tcl also has commands that allow interface with other computers, other programs and the Web. Tcl programs are also portable between Mac, Linux and Windows systems.

    If we are going to take the trouble to teach children, even young children, a computer language we should consider several issues:

    All these features mean that Tcl is now becoming a major language for use both on the Web and in the programs supporting the Web. In fact the architecture of Web Servers is being changed as the Servers themselves and the browsers are starting to be written in Tcl. It is the use of Tcl as the language behind the Web that is the key factor in my using it here.

    3.3.3   Introduction to xhtml Y5-        

    You may think this is an odd place to start teaching about xhtml. xhtml is the markup language used to describe the layout of webpages. So what is it doing at the start of a section on learning to program in Tcl.?

    The reasons an introduction to xhtml is positioned here are:

    You will note the Y5- and wonder if this is not too early. Foreign languages and concepts of grammar and semantics are typically commenced at this level or Y6. The concepts behind html and Tcl are altogether simpler than natural language constructs and grammar and so Y5 is an appropriate point to commence down this path, or earlier. However, having commenced down this path, this area of development must be maintained for the rest of the students schooling. In other words, this is a key point in the students specialisation within the education framework.

    Tcl can be used to write stand-alone applications, large and small, but its most common use is to write cgi scripts and systems for the web. To do this you need to write programs which create xhtml, so now is the time to learn xhtml.

    Writing a cgi script is also one of the most practical ways for a beginner to start using Tcl and see rewards in a social setting. So the first Tcl scripting exercise is a webpage cgi script.

    This course can be done at Y6 up. It is good practice for students to write their own xhtml and get the principles involved settled in before going on to programming. This is because at this early stage examples have to be absorbed before generalisations can be grasped.

    An introduction to xhtml can cover more material at a higher Level and agegroup. At the Y6 age group just the basic tags required to present something should be used: html head title body h1... b i p div ul ol li dl dd dt table tr td br hr img a

    This should be sufficient for basic needs.

    Introduction to xhtml

    3.4   Introduction to Tcl        REVISED May 2006

    An introduction to Tcl can be covered in two different areas. At this point there are two parallel branches , both of which must be traversed before moving on. Tcl itself is so simple that there is little to learn if you have the basic programming concepts well in hand. However it is here assumed that Tcl is the first programming language that the person is coming in contact with. Tcl is most useful in areas where you need to bridge different kinds of systems with deifferent perspectives. The two perspectives that come immediately to hand when starting programming with Tcl are:
    1. Tcl/Tk - simple projects where Tcl is used to build a graphical interface to a simple application. These applications often use the builtin features of the Tk widgets to provide the application functionality. The text editor is a good example. So one needs to learn about quite a few Tk widgets and a large bundle of new concepts tat they introduce.
    2. cgi webserver programming (.cgi), or possibly Tcl template webserver programming (.tml). This is simpler to learn because one only has to learn the basic Tcl core language and the simple client/server interrface, and also the basics of html, the HyperText Markup Language. This bundle of concepts are not so new, but build on the concepts of editing written text. In the future we need to be aware that this preceding paradigm may not exist.The children may not learn and practice handwriting skills, let alone the editing paradigms of writing an essay, a formal letter, a project proposal or a resume.
      1. This outline treats the cgi webserver programming first, initially with the classic guestbook exercise. This requires learning xhtml fundamentals first. This is about what is under the hood of a webpage, an object that everyone is familiar with and used to using, even if they do not understand the underlying mechanics already. Students can easily relate the HyperText Markup Language to what they know about the everyday behavious of webpages. Once this branch of Tcl application has sunk in, there is a less steep learning curve on the Tcl/Tk branch of projects. These then lead directly into the Tcl Plugin subject which initially uses Tcl/Tk and also brings html into the mix. The basics of Tcl should be taught first. This can be done in class. Books describing Tcl assume that the reader is already conversant with programming language concepts and idioms. They also assume that the reader has knowledge about graphical user interfaces and their programming, and about many of the features of the underlying operating system. These books are written to address a professional audience. However Tcl is an ideal language to teach as a first language due to its simplicity and ease of use and availability on most computer platforms.

        Teaching Tcl in class will require some careful preparation of class material scaled to a level suitable for the class age.

        Basic Resources are

        For the young, the idea of substitution should be played with first. For instance using Post's Tag game in elementary logic. (The Tag Game page has not been written yet(May2006))

        3.5   Introduction to cgi scripting        

        This can be done as a short course for Y5- students. cgi scripting is the way that people communicate on the web. It is probably the most important programming environment in use today. Multinationals as well as individuals communicate via the web because it provides a uniform method of interacting with the computer that most everyone today is familiar with. Placing the same functions within a purpose bulit program means that the users have to get used to a new form of layout and ways of interacting with the program. The web is now so ubiquitous that all applications are now written to operate in the web environment.

        Part of cgi scripting involves writing by hand the webpages to be returned to the user. This means that the scripter must understand xhtml in order to create the pages. Teaching this is the first part of the course. The student writes a simple webpage using the basic html tags using a simple text editor like Notepad and uploads it to the server.

        The student then learns the basics of Tcl, the rules for writing Tcl commands, some of the basic Tcl commands to be used in the following exercise, and how to access the Tcl help Manual. Then a simple guestbook cgi is added to the webpage. At this pint students learn a little more xhtml: the form input and textarea tags for communicating with a webserver.

        Prior to starting this course, students should think about a project they would like to implement. The teacher then selects from the suggestions the project which appears most feasible to complete successfully in the time available, and which delivers most bang per buck. Consideration should be given to the general usefulness of the application to others, not just those in the class. However, avoid projects which appear to have commercial significance as this could cause problems later on. In the courses webscool runs, the students agree to publish the application on webscool as freeware. This is a condition of course attendance.

        The final part of the course is implementing the project. This requires an introduction to techniques in project implementation. This part of the course covers the material in the Programming Section above. cgi applications are naturally suited to this kind of process because each cgi script exists as an independant entity. The constraints of <html> dictate this. When the project is completed it is published in a forum where it is accessable to a wide audience.

        Introduction to cgi scripting

        There are a number of sample Guest Book programs written in Tcl. Here are links to two of them:

        There are also other examples of CGI programming in Tcl and perl at "The cgi.tcl Home Page" which include page counters, and clocks which can be included on the class and student webpages.

        3.6   The Tcl Plugin        NEW May 2006

        Another way to approach the Tcl scripting language is via the Plugin. The plugin is a version of Tcl that is used in a webbrowser, similar to the use of JavaScript or Flash. This way of approaching Tcl has a steeper learning curve because Tk windows and widgets are used to display information in the webpage instead of simply using the [puts] command to output simple text.

        3.6.1   Installing the Plugin        

        The Tcl Plugin does not come bundled with your browser. You need to add it yourself by downloading it from the Tcl Plugin page. The download is a special .zip file called .xpi which should self-install into your webbrowser plugin directory. Watch out for a line appearing just under your Toolbar requesting approval to download from the www.tcl.tk site.

        If it does not self-install, which appears to be the case for Internet Explorer, there is an additional link below.

        3.6.2   Installation for Windows Internet Explorer        

        The wiki provides an .exe download installer for the Plugin for IE provided by Keiichi Takahashi. This may not be quite the latest version.

        3.6.3   Invoking the Tcl Plugin        

        3.6.4   Some Tclets        

        There is a collection of Tclets at the Plugin site. Of particular interest is a Tcl evaluator, that is a Tcl console in a webpage. This also provides a link to a page describing Tcl syntax so you can try some things out.

        3.7   Whereto ?        

        Having completed this course, students are well equipped to do many interesting things. From this point they can choose to develop in a number of directions: These are all worth-while options and all need to be done as some stage. But there is only so much school time. Any school can feel they have done their duty if a student reaches this point.

        However teachers need to understand the environment in which their students work and learn. Some teachers also need to learn these skills in order to create, workwith and manage new tools. CSS needs to be learnt in order to manage any website with more than a few pages. CSS minimises maintain, establishes standards for the website and allows for global updates and changes to layout. All school websites should be using CSS and some teacher needs to know how to use it. So the rest of the computer language projects on this site are intended mainly for teachers. They can also be used by trainee teachers, and teachers in adult education.

        3.8   Introduction to Tcl/Tk        

        This can be done separately or in conjunction with the Text Editor Project below. A useful site for these projects is the , which provides standard icon sets for applications.

        3.9   Student Term Project - Text Editor        

        This project could be coordinated with a course in a scripting language such as Tcl. It could be delivered in staged steps spread over 1 or 2 terms.

        The major problem with this project is that some students will take it home, read up all the documentation over the web and complete it in 1 or 2 weekends.

        Allowance will need to be made for precocious students and either a second project assigned to them. Or a term project in another field such as social science or arts be given to them so that they do not develop a bias to computer studies.

        This project is appropriate for advanced year 7 intermediate students, or for 8 or 9 year high school students.

        Reservations
        One might ask "Why a text editor?, Surely this has been done a thousand times before?". In particular there are three obvious reservations against doing this project. A text editor appears at first glance, to be a complex program to write, but given the building blocks provided by scripting languages it is only a moderate challenge.

        The fact that text editors already exist is a benefit for this project. It means that the student will be familiar with the problem and have a very clear idea of the required result. A good example is Windows Notepad. By writing an equivalent program that will actually be better than Windows Notepad, the student will get a real sense of achievement. The idea that writing a good, useful program is something that only adults can do, will be demystified.

        While it may seem wasteful for every student to produce basically the same piece of software. The benefit in the exercise is not so much the "text editing" function. This is already provided by the scripting language and does not have to be written by the student.What the student writes is the "framework" for any general application program. This framework can then be reused by the student as a basis for other application programs he may wish to write. Because the students will "own" their source code, they will be free to develop the program in any way they see as being useful.

        So the "reservations" about this exercise actually serve to highlight the benefits of the exercise.

        Benefits
        The project is designed so that a useful product is produced at the end of each programming session At this point the project can be considered complete, but further sessions can explore ways of improving the product further. This author uses the program he produced designing this project as his standard text editor for his Tcl pages and also for these webpages. Text Editor Project

        3.10   Simple Calculator        NEW 22 May 2006

        3.11   Student Term Project - Bitmap Editor        

        This project is similar to the Text Editor and might be used as a follow up to the text editor in a succeeding year for preteens or a succeeding term for teenagers.

        The bitmap editor is slightly more complex and requires more thought and care with design than the text editor because the functions have to be provided by the programmer, whereas in the text editor the Tk widget itself provided all the basic text editor functions.

        What is a bitmap?

        A bitmap is the simplest piece of graphical information used on computers. It is commonly used to describe the small icons used on buttons in programs. Here are some examples:

        3.12   Image Editor        

        This is an exercise to make a small image editor with just few basic macro functions rather than something like Photoshop. Functions are: This is not a common feature list of image painters. Uusually the adjustments are made in a seperate window to the composing window, so you cant easily see the result all in one piece. This painter is for creating relatively small images for webpages - up to logo bars for webpages or webads. It is used later as a component in the logo painter exercise.

        A starting point for this exercise is TkPhotoLab which deals with just one image at a time, rather than multiple images displayed in a larger canvas. TkPhotoEditor is a subwindow of this application.

        3.13   HTML Text Painter        

        This is an exercise which paints text in an html widget using html features. This painter provides access to all the text attributes of html and also some CSS style attributes. The CSS part can be toggled on or off so that you can see the html text either with CSS or without. This painter outputs html. This is a component of the Logo Painter exercise. This is an excellent way to learb just what is possible to achieve in html.

        3.14   HTML Form Painter        

        This is an exercise which paints an html form over an image. The point of this painter is to see how a small form will look in a particular setting - typically with an image background where you may want to position the form elements in a special way. The only forms elements needed for this are input text and input submit. This is for placing a small form such as a user login or a search field in a webpage logo. As you can guess, this is also a component of the logo painter exercise.

        3.15   Tclets - Colour Exercise        

        This is a small exercise to write a small tcl program that accepts a colour as input as a background colour abd returns a collection of colour coordinated swatches for various uses on a webpage or application. Provide a choice of a couple of algorithms based on what is learned from the colour Cube Exercise. You can embed the program in a webpage as a tclet with instructions for how to use it. It can output a CSS stylesheet of colours. You can see a number of painters a bit like this one in webpages on the net.

        3.16   Tcl Topics        

        The following topics deal with aspects of Tcl that have to do with general style, conventions and useful techniques.

        3.16.1   Name-Value Lists = Array Lists        

        3.17   Relational Database        

        Relational Database is perhaps the most important theoretical aspect of information technology. Although the only tools generally available are computer based, the underlying principles are fundamental to the understanding of how to organise, access, combine and manipulate all information.

        Relational Database has an underlying mathematical theory which properly places it in the Mathematics syllabus along with other topics such as set theory and calculus. While for younger students it is possible to construct queries using intuition in a progressive manner to form more complex queries, perhaps limited connectives like AND only, an understanding of set theory and boolean operators is essential to grasping the full power of database query.

        The problem with any RDB exercise is that it relies on lots of information and that takes time and care. Getting readily available information that is accurate, interesting and will provide interesting results is the main problem. Usually Databases exist to automate the processing of paperwork which is very boring. Databases were not invented for their educational and entertainment qualities. This means that finding an interesting project is 100 times more difficult than say finding a video editing project.

        Designing and building a functional database is a very useful project - but it is a lot of work because Databases are typically used to process large amounts of information which must be captured, stored and maintained. Databases never exist exist in isolation. Databases exist only as a mechanism to assist some other project, therefore any Database Project should be seen as only being an adjunct to the Project in which it is embedded. Therefore thought should be given to designing a database which is an adjunct to some other tool and which has a useful purpose outside the class. Many of these projects have already been done, such as, CD database, image database. But there are still many openings, in particular databases which are accessible over the net for hobby enthusiasts of any sort. Examples are:

        This list has few limits and can form the basis for social interactions.

        Databases used to be expensive to set up and could only justify their existence by being readily accessible and maintainable over a long period of time. THis is no longer the case. The SQLite database engine is so simple and easy to use that it becomes the preferred method for storing any and all application data.

        Perhaps, the best, most obvious project is to make a database of student achievements that is used by the school. This is a "Scout Badge" type of system that issues Certificates of Achievement in various project areas which students successfully complete. A requisite tree could be designed, maybe oriented just to ICT skills to start with, and students could work at progressively collecting all the Certificates available, just like collecting Scout badges. This database would become part of the school's administrative infrastructure and effectively out of reach of students once it was completed. So this project is a oncer, but it could be extended year by year to include more subjects and become more integrated with the school's assessment system. This is far more in keeping with the way Databases evolve in reality. This system is discussed in more detail in the Infrastructure Chapter.

        Here are some simple database projects which almost anyone can relate to.

        3.17.1   Populating an RDB        

        3.17.1.1   Personal Genealogy        

        This project is to simply populate an existing genealogical database structure with the students' personal data. A student can keep his own database or the class can have a database as a whole. The database can be queried to see of there are correspondences and relationships. The database can be used as a source of information for statistical testing. Output from the database can be incorporated back into each students homepage.

        It is difficult to see what compellingly interesting or useful outcomes will be provided by such a Database. The Database itself may not provide any useful information, and this of course makes it somewhat redundant. But there are several benefits from this Project. Students get an opportunity to explore their own cultural heritage. In particular in New Zealand the subject of Immigration will loom large for everyone and so this Project should be part of a Social Studies course on the History of Immigration in New Zealand. There are purpose built Database packages for genealogy, so the Database does not have to be designed from scratch, and the software for printing family trees is available. Presenting database information in interesting graphical formats is a useful aspect of the exercise. This shows how a list of words and numbers can be used to describe complex structures.

        3.17.1.2   A Search Game        

        Here is a report of an RDB exercise for which unfortunately the source has vanished off the net. The author is a teacher of 4th graders in Virginia, USA.

        Here is what I have done with my entire 4th grade. It is working like a charm to teach the basics of database:

        My latest venture into this is teaching data base, using Microsoft Access, to 4th graders (age 8 and 9). The curricular objective at that level is to create databases and use them with assistance. My first step in doing this was to create a data base myself, on solar system facts. I copied it to all the computers. I wrote up a fictional brochure dated 3 centuries ahead, about "Space Camp" for "Star Scouts" (replaces the ancient girl scouts and cub scouts) describing 3 summer camp programs that take place on various sets of planets.

        Then I wrote 3 "letters to mom and dad" from "star scouts" on 3 mystery planets. I spent 10 minutes in each class teaching about records and fields. Then I spent 5 minutes or so teaching about queries and how create them. Finally, working in pairs, they had to create their own queries in Microsoft Access, using the clues from the letters to build their queries, and analyze the search results to figure out which planet each "camper" was on. All my letters required that the queries be changed at least 3 times to become more narrow in scope.

        An example of a clue: "Dear mom and dad, we are less than 90 million miles from the sun." That narrows it down some, but one has no idea how much until one does a query into the database. Then one finds that several planets meet this criteria, so the students have to alter their query to take another factor into consideration until only one planet (record) meets the query requirements.

        When the kids figured out what my three planets were, the next assignment was to write letters of their own. In this assignment, they had to use 3 views of the data: table view, which allows them to see all values of a field, form view, which allows them to see all fields of a record, and query view which allows them to select a few fields and see all values for all records. They have to use me to test their letters (they are supposed to test it also), to make sure there are no logic errors, or to make sure the very first clue/query doesn't give it away.

        It has worked so smoothly you would be amazed! The teachers are amazed, too. All classes had over 90% of the kids easily building queries in the design view during the first lab. They had to analyze the letters, choose the correct fields, create their own queries, view the results, then go back and refine the query. All of my letters required them to go back and refine their queries at least 2 times. We are now having several of the classes writing their own "letters from home," and they have to use table views, form views and queries to write and test their letters. It's incredible!

        The bottom line is (1) these kids have become very comfortable using Microsoft Access and (2) they think it is great fun. WOW! What a victory. They **KNOW** what a record is and what a field is. They understand different views of data, and how to sort for ease of viewing.

        The second step will be for them to build their own database. We have several thoughts on this, but no decision as of yet. One idea is a "time travel" data base on Virginia history, another is an imaginary solar system.

        For 7th graders, I would think any curricular topic with lists of information would do.

        My personal reservation about this particular exercise is that I would have been able to work out the right planets immediately without recourse to the database or any other reference. I would have been wondering what this database thingy was doing in the Planetary Camp Exercise. However this is an excellent framework game for getting students to phrase database queries.

        However it is interesting to note the early age at which database is being introduced to students. Typically this subject is being broached at Y6,7 and 8. The availability of database software makes this possible and one could criticize teachers for teaching database just because the software is there. However this is an unfair criticism. Database relies on quite a number of concepts that can be introduced to students at various appropriate learning levels. Here is a progressive list of concepts and a rough guide of appropriate years for their introduction. I have not matched up these concepts with their mathematical equivalents in the syllabus, and a little more work could provide specific indicators of when it is appropriate to introduce these concepts.

        3.18   Projects        

        3.18.1   Maths Projects        

        3.18.1.1   The Art of Computer Programming        

        The classic text on Computer Programming is D Knuth's Art of Computer Programming now recognised as one of the 10 most important books of the 20th Century. This work has been actively revised over more than 20 years in 3 volumes. However 7 volumes are planned and Vol. 4 is now in progress. The work examines all the basic algorithms used in computer programming and subjects them to mathematical analysis. The work is designed to be accessible to students with a college mathematics background. The first chapter of 300 pages (including answers to exercises) covers the basic mathematical background required for the rest of the book. It is also very readable and is an excellent reference for the bulk of Y12-13 finite mathematics.

        As well as a rather complete examination of programming techniques and the very readable introduction to mathematical theory, Volume 1 has very many interesting exercises, some of which are major projects. At the extreme end they explore the basics of what will eventually be recognised as Artificial Intelligence.

        Here are projects on some simpler arithmetic systems. A knowledge of Tcl only is required for these, without using Tk.

        3.18.1.2   Integer Arithmetic        Y8- NEW May 2006

        Tcl integers have a max value of about 1012. Write an integer evaluator that evaluates integers to a max size of a google =100100 or write an integer evaluator that is practically unlimited by allowing references to factorials or powers.

        This exercise has a number of aims. Initially to program integer arithmetic in its full doamin and thereby learn about the details of how to calculate with integers.

        That is the core of the exercise but there is no application

        The resulting set of procedures for sum, multiply etc can then be placed in a more general "integer' command that accepts more general integer expressions. This involves parsing a simple expressions syntax. Alternatively you can slot these procedures into the apprpriate places in a generalised calcultor GUI (graphical user interface). The result is a calculator that can be used to explore some number theory. You can add some special integer functions such as exponent, factor and greatest common divisor.There are some other intersting integer functions as well. for instance you can have a function that tests for primes.

        3.18.1.3   Quotient Arithmetic        Y8-

        This procedure calculates quotients exactly either by a numerator/divisor method or a repeating decimal expansion method.

        3.18.2   Technology Projects        

        3.18.2.1   Term Project - Graphical Painter        

        This project is a close analogue to the Text Editor Project and the result is a program akin to the MS Painter which is provided with the Windows Operating System. Here the Tk canvas widget is used to do most of the hard work, so that the project is not as difficult as one might at first suppose. And like the Text Editor, the result gives students a basis which they can then use to develop more specific applications that use image manipulation. This may include games and teaching tools for young children, or disabled persons.

        The benefits of this exercise are comparable to the benefits of the Text Editor exercise. What is not so clear in this case is the usefulness of the application that the student is being asked to build. With many extremely sophisticated image processing packages available with very advanced features few children even bother to use the MS Windows Paint program. About the only place it is used actively in a creative manner is as part of NetMeeting so that you can draw diagrams of ideas to communicate across the net. How to do this using Tcl is a later project. But this painter can be extended in personal ways to create art work, to create colour combination systems, and using Tcl's time mechanism, even moving pictures, cartoons and presentations and displays.

        Painter Project

        To see an example of a fully developed painter based in the canvas widget look at tkpaint. For Windows, unzip the file and double-click on tkpaint16/tkpaint/tkpaint.tcl. Tkpaint is used to draw the diagrams in WEBSCOOL. These diagrams are all displayed as plugins. However it is important not to copy tkpaint in the Painter Project but rather to invent the user interface from scratch. It is the way that the user interacts with the tool which is the createive element in this project, not so much the resulting painter.

        3.18.3   Language Projects        

        3.18.3.1   Project - Dynamic Hyper-Fiction        

        In the Basic Chapter the section Hyper-Fiction introduced the idea of non-linear storytelling. The examples in that section used simple hypertext links to achieve static strands of narrative that could be made to combine with varying degrees of complexity.

        This section explores dynamic storytelling. This is more like storytelling as it was done by the bards going back to Homer. In this format the reader gets to influence the narrative flow, or it may be altered at random. The most simple mechanism to be used in this case is dynamic page serving. The page that is served to the reader may depend on three factors: what the reader asks for, what the reader has already been served, and chance. The reader's identity must be remembered by using a sign on or a cookie. This process gives the writer more control over the way the narrative is accessed. However the frameworks for writing stories for this format are not all that different from the static example.

        The dynamic story is not bound by having its pages fixed. The reader cannot presume to be able to browse the story. This means that the narrative direction and outcome can change completely and multiple endings are possible. The degree of variation depends on how capricious the author wants to be and how carefully the plot transitions are controlled. But given examples set by such satirical parodies as the TV series "Soap", there really are no limits.

        All this can be accomplished by using the GET/POST parameters attached to URLs and a CGI script (perhaps written in Tcl) to process the parameters and select the next page to serve.

        3.19   Prelude to Virtual Reality        

        Introduction to Active Worlds

        Prev Next

        ©2000 - 2006 WEBSCOOL This page last updated 27 Jun 2006. All rights reserved - including copying or distribution of any portion of this document in any form or on any medium without authorisation. For more regarding the copyright.