| |||||||||||
| |||||||||||
Designing an application - start here
Programming Principles example from a Well House Consultants training course
More on Programming Principles [link]
Source code: design.001 Module: Q101
# 83.91.63.108 - - [07/Jun/2009:03:30:54 +0100] # "GET /forum/registering.html HTTP/1.0" 200 11131 # "http://www.wellho.co.uk/registering.html" "Mozilla/4.0 # (compatible; MSIE 6.0; Windows NT 5.1; SV1; Crazy Browser # 2.0.0 Beta 1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)" =head1 Specification / initial design In order, I write the following Story: The objective of this application is to get an idea of what operating systems people are using when they visit our web site. Inputs: Web access log files Outputs: for this initial story ... identify a number of specific strings in access log records (last field), and count them up Storage / data structure design: 1. A hash, keyed by OS string, containing count to date (we'll parse the log file to build up the counts) 2. A list of all the standard strings we look for (the OS string is very hard to generalise!) Notes: 1. Initially just identify a few OSes and come up with some sort of way of listing out / analysing those lines which have not matched any of them. 2. Take care that none of the lines should report as being multiple operating systems! =cut # Open the log file # Loop through each record in it # Split the record out into fields, get the last field # Check if the last megafield contains any of the specified OS identifiers # if it does, count the access. if it doesn't count 'unmatched' # OK - quick dump of the results to check our logic! Learn about this subject
This module and example are covered on the following public courses:
* Learning to program in PHP * Learning to program in Python * Learning to Program in Java * Learning to program in Lua * Learning to program in Ruby * Learning to program in Tcl * Learning to Program in C * Learning to program in C and C++ * Learning to program in Perl * Learning to program in PHP * Learning to program in C and C++ Also available on on site courses for larger groups Books covering this topic
Yes. We have over 700 books in our library. Books
covering all the subjects we teach are listed here and when you've selected a
relevant book we'll link you on to Amazon to order.
Other Examples
This example comes from our "Programming Principles" training module. You'll find a description of the topic and some
other closely related examples on the "Programming Principles" module index page.
Full description of the source code
You can learn more about this example on the training courses listed on this page,
on which you'll be given a full set of training notes.
Many other training modules are available for download (for limited use) from our download centre under an Open Training Notes License. Other resources
• Our Solutions centre provides a number of longer technical articles.
• Our Opentalk forum archive provides a question and answer centre. • The Horse's mouth provides a daily tip or thought. • Further resources are available via the resources centre. • All of these resources can be searched through through our search engine • And there's a global index here. Purpose of this website
This is a sample program, class demonstration or answer from a
training course. It's main purpose
is to provide an after-course service to customers who have attended our
public private or
on site courses, but the examples are made
generally available under conditions described below.
Web site author
Conditions of use
Past attendees on our training courses are welcome to use individual
examples in the course of their programming, but must check
the examples they use to ensure that they are suitable for their
job. Remember that some of our examples show you how not to do
things - check in your notes. Well House Consultants take no responsibility
for the suitability of these example programs to customer's needs.
This program is copyright Well House Consultants Ltd. You are forbidden from using it for running your own training courses without our prior written permission. See our page on courseware provision for more details. Any of our images within this code may NOT be reused on a public URL without our prior permission. For Bona Fide personal use, we will often grant you permission provided that you provide a link back. Commercial use on a website will incur a license fee for each image used - details on request. |
| ||||||||||
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho PAGE: http://www.wellho.net/resources/ex.php • PAGE BUILT: Sun Oct 11 14:50:09 2020 • BUILD SYSTEM: JelliaJamb |