Site Contents

John Leach

Pictures/jhl.jpg
I'm a freelance software consultant, born in the United Kingdom, and now living in Italy. A long time ago I had a site (now sadly defunct) where I displayed a series of Java Applets, and where I put some information about Verona, the city where I live. I'll find some time and the old HTML pages so that I can put some of that information back on-line.

Read more...

Binary File Format Compatibility

../Pictures/sunshade_blue-xxx.jpg
Most of the software applications I have worked on have demonstrated the following properties:
  • the application has a longevity far beyond the original forecast,
  • the binary file formats change dramatically over time,
  • these binary files can be shared between different versions of the same application,
  • more and more binary file handling code is developed to handle the different file formats,
  • sooner or later, applications break trying to read the various binary file versions.
This article proposes a method to prevent such breakages.

Read more...

What (Programming) Languages?

../Pictures/hydrant.jpg
This big unanswered question.
This is a common question on the Internet - what programming language should I learn? Unfortunately, it doesn't have a common answer. If you were asked what human language should I learn, you probably wouldn't give an immediate answer, because a lot depends on the person asking the question. Do they already know another language? Do they know their native language very well? What do they want to learn a language for - interest or work?

Read more...

Beginner's JavaScript

../Pictures/spectacles-xxx.jpg
This tutorial is for those of you who are thinking of trying out programming, and have little or no previous experience. I have chosen JavaScript since it is an easy language to understand, whilst being extremely powerful. Although you probably know of JavaScript because it is the de facto scripting language within HTML pages, I'm not going to use a browser. Instead I'll use an interpreter based on the SpiderMonkey scripting engine (the JavaScript implementation within Mozilla Firefox, among others), called JSDB. I'll use this interpreter to create the output to the 99 bottles of beer song.

Read more...

99 Bottles of Beer

This is the 99 Bottles of Beer song, embedded in an HTML page. It is the final result of the Beginner's JavaScript article.

Read more...

LUG Villafranca Programming Course

January, 2008
../Pictures/chairs_stuehle.jpg
This document gives a brief outline of the programming course organised together with the Linux User Group of Villafranca, Verona, Italy. The course introduces programming in JavaScript, Ruby, and fundamentals of Ajax over a ten week period. In twenty intensive hours, students are introduced to the tools and methods used in modern programming practices, and the author's twenty years of experience.
This document is being published on the Internet in parallel with the course. Once the course has finished, it will remain as a tutorial for other fledgling programmers.
This, and the other articles outlined here, are also available as a PDF document (about 2.3 MB).

Read more...

Welcome to the Course

LUG Programming Course, 14th January 2008
In this first lesson, I spent some time asking the students about their programming backgrounds. There are three web designers, four programmers, three web masters, and an enthusiastic beginner.
Their computers ranged from Windows Vista, Windows XP, to Mac OS X, Debian, and Ubuntu. Fortunately the software I have chosen should work on all these platforms.
Most of the lesson was spent downloading and installing software. I only managed to ensure that everyone had Firefox and Firebug installed and working. Next week we'll see if Aptana runs OK – some people have 512MB machines, but I hope that's not a problem.

Read more...

Simple JavaScript Concepts

LUG Programming Course, 21st January 2008
In this lesson we started to write some simple JavaScript. This was a little tedious for those with previous programming experience, but it served to highlight several important points of the JavaScript programming language.
Just as importantly, this lesson helped familiarise the students with the Firebug add-on.
I was a little too slow starting the lesson, wasting about 30 minutes, so I overran by about 20 minutes, and didn't manage to finish all the material. Fortunately, this first real programming lesson gave me some feedback, so that I can better pace the following lessons. I'm glad to say that I had at least prepared enough material, finishing 30 minutes early might have been embarrassing.

Read more...

Advanced JavaScript Concepts

LUG Programming Course, 28th January 2008
Writing code snippets in Firebug is interesting, but not permanent. As soon as you close the browser, or the tab you were using, all that experimenting is gone forever. The time has come to create a permanent development project.
Overran the lesson by half an hour again, and didn't get as far as creating objects, I stopped short of “The Power of JavaScript”. I'm also a little worried that I'm leaving some students behind. To rectify, I'll add a refresher lesson in a couple of weeks.

Read more...

Prototype and script.aculo.us

LUG Programming Course, 4th February 2008
The third lesson showed some of the power available in the JavaScript language, but also kept clear of the uneven surfaces that exist in currently available browsers. The plain fact of the matter is that browsers behave differently, and they are not perfect. Unless you want to become a specialised consultant, most web programmers don't have the time, energy, or resources to understand, and find solutions to these problems.
This fourth lesson makes use of two popular open source JavaScript libraries (Prototype and script.aculo.us) which take care of smoothing out the browser bumps, and create some very professional results, with very little code required by the developer.
This time I managed to recover the part of last week's lesson that I didn't finish, and get though this lesson with about 15 minutes to spare. Unfortunately, I lost about a third of the class along the way. I spent half an hour going over the concepts of the Document Object Model, and anonymous functions, but we'll have to look at these again in the next lesson, which will be a review of the things we have seen up to now.

Read more...

Review of JavaScript, CSS and XHTML

LUG Programming Course, 11th February 2008
The last two lessons introduced us to XHTML, CSS and some pretty advanced aspects of the JavaScript programming language. This lesson will reinforce our knowledge of these topics, mostly by providing links to articles and short tutorials available on the Internet, and answer some of the student's questions.
This time I managed to get though the lesson with about 30 minutes to spare. I think that some of the information given here helped clear up some of the doubts that the students had. We spent the last 30 minutes looking at specific problems, and discussing students interests and aims.

Read more...

Ruby Full Immersion

LUG Programming Course, 18th February 2008
This week we move on from JavaScript to the Ruby programming language. Ruby is a dynamically typed, interpreted programming language. It's available for the Windows, Mac OS X, and Linux operating systems.
This lesson will give a very brief overview of the language, noting important differences from JavaScript where necessary. The first, and probably most important difference from JavaScript, is that Ruby runs on the operating system itself, rather than within a browser.
Ruby can be used to create classic glue language scripts, much like AWK or Perl. It can also be used to create desktop applications, using a variety of bindings to underlying libraries, such as Fox, wxWidgets, Korundum and Qt, and Tk. You can also collect your Ruby scripts together to make a stand alone executable using RubyScript2Exe. Undoubtedly, Ruby on Rails has made Ruby widely known as a web application programming language. Il sito Ruby Italia fornisce guide ed altri informazioni in italiano.

Read more...

Ruby and Ajax

LUG Programming Course, 25th February 2008
After our brief, but intense, first look at Ruby, we can start using this excellent scripting language to create our first web application. We previously used the Prototype and script.aculo.us libraries to dynamically modify an XHTML page, now we'll use Ajax via the script.aculo.us Ajax.Autocompleter to 'talk' to a simple Ruby web application.
This lesson will introduce you to WEBrick, the Ruby web server, HTML forms, the ERB templating system, and Ajax.
Despite the amount of code involved, the lesson went quite quickly, and I managed to finish with about twenty minutes to spare. We used that time to go over some of the Ruby code again. Everyone seemed to enjoy the results of running their first web application. One student even started adding his own text files, which I found gratifying, because that was what the application was designed for – any number of plain text files.

Read more...

Review of Ruby, Overview of Ruby on Rails

LUG Programming Course, 3rd March 2008
The last two lessons presented a whirlwind guide to Ruby, demonstrating a simple command line program, and a simple web application. That was a lot of material to digest, so in this lesson we'll make a short review of the important things we learned, and explain iterators and code blocks in a little more detail, since they caused some problems for some of the students.
As we still have much ground to cover, half of this week's lesson is also dedicated to an overview of the Ruby on Rails framework, which we'll be using in the next two lessons to construct a more complicated web application.
The lesson went reasonably well. I overran by about 15 minutes. I'll be overrunning a lot more in the next two lessons, as there's much more to go though. Seems I haven't lost anyone permanently from the course – they all diligently show up , some even and smile occasionally.

Read more...

Ruby on Rails, Part 1

LUG Programming Course, 10th March 2008
This week's lesson starts us on a two part adventure building a web application using Ruby and the Ruby on Rails framework. You'll need to install Ruby on Rails – we're using version 2.0.2. Our application also uses RMagick and SQLite. Installing RMagick is explained in this FAQ, we're using version 2.0.0. Installing SQLite is explained in this How-to, we're using the Ruby SQLite3 wrapper version 1.2.1. Windows users will need both the .exe and .dll versions of SQLite. The Ruby on Rails Wiki page also gives helpful information for SQLite.
The lesson went quite well, and although there was a lot to cover, we overran by only 15 minutes.

Read more...

Ruby on Rails, Part 2

LUG Programming Course, 17th March 2008
This week's lesson concludes the two part adventure building a web application using Ruby and the Ruby on Rails framework. Although we'll have a working application by the end of the lesson, good enough to play with at home, there will still be some work required to bring it to production environment standards.
The lesson went quite well, and although there was a lot to cover, we overran by only 15 minutes. We finished off the evening to celebrate the end of the course with a drink in a local bar.

Read more...

Road Map

Pictures/two-excavators.jpg
This is where I am hoping this site will end up. The road map is a brief outline of the things I have already written, and of course, those which are still in the pipeline.

Read more...

What's New

Pictures/time_dust.jpg
This section details the most important changes on the site since the last published version. New versions will become available when sufficient current articles are updated, or new articles are added.
As this is the first public appearance of the new web site, everything is new. This page will be updated when existing articles are updated, or new articles are added.

Read more...