Software Development Module Notes

March 17th, 2008 Software Development

The following are tutorials or Powerpoint shows used in this years Software Development module. Apologies for the bulk upload.

Class Diagrams

Defensive Programming

Design Patterns

Fundamental OOP

Use Cases

Extreme Programming

Changing the default source editor in IE

February 19th, 2008 Programming, Software Development

Not a new idea this but something that can save hours of annoyance if you’re working with IE. You can change the default editor with a simple registry edit.

Navigate to HKLM>Software>Microsoft>Internet Explorer and create a new key called View Source Editor. Now inside this create another new key called Editor Name and then set the default value to the path to your chosen editor e.g. “C:\Program Files\Notepad2.exe”. Of course if the keys are already there you just need to edit the default value.

Hats off to Thea Burger for the super-useful post I found this in.

Setting Up Local Virtual Hosts in Apache 2.0

February 16th, 2008 Programming, Software Development

A particularly useful feature for anyone developing for the Web using Apache is that you can define virtual hosts for your local test environment. This brief article will tell you how to do exactly that but assumes that you have some very basic knowledge of Apache (as long as you can edit the httpd.conf you should be fine). For our example let us say that I am currently developing three applications: Spiffy; Tidee; and Kewl. The code for each of these projects lives in a folder, named after the application, under “C/wamp/www”. Note that my strive towards complete idleness means that I have used the excellent WampServer to set my development environment up. I should also say that while these instructions are written for Windows systems they should apply pretty much to Linux as well.

Now I could just change the document root in httpd.conf when I switched to working on a different project but this is a pretty unsatisfactory state of affairs. What I really want to be able to do is to type http://spiffy (or one of the alternatives) into my browser’s address bar and get the spiffy start page. And that’s where virtual hosts come into play. If you’ve never come across the term before it is the same way that Web hosts can host multiple Web sites on the same server.

Setting up virtual hosts in Apache 2.0 is simplicity itself. Just open up httpd.conf and add (or un-comment) the line

NameVirtualHost *:80

this tells Apache to listen for any requests for your virtual hosts on the default http port 80.

Don’t close httpd.conf just yet as you also need to define your hosts. The code below shows our three example apps defined as well as the default localhost. It shoudl be pretty self-explanatory but the most important elements are the ServerName (which should be the name you want to type into the address bar) and the DocumentRoot (the folder containing your app).

<VirtualHost *:80>
DocumentRoot "C:/wamp/www"
ServerName localhost
ErrorLog logs/defaultsite-error_log
CustomLog logs/defaultsite-access_log common
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "C:/wamp/www/spiffy"
ServerName altlocalhost
ErrorLog logs/spiffy-error_log
CustomLog logs/spiffy-access_log common
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "C:/wamp/www/tidee"
ServerName localhost
ErrorLog logs/defaultsite-error_log
CustomLog logs/defaultsite-access_log common
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "C:/wamp/www/kewl"
ServerName kewl
ErrorLog logs/kewl-error_log
CustomLog logs/kewl-access_log common
</VirtualHost>

I’ve changed the apache and error logs for two of the apps but you could leave them at default if it isn’t important to you.

That’s it for the Apache side of things. Save and close httpd.conf and we have one more job to do.

The code above will set up your Apache virtual hosts but you still need to get your browser to recognise that http://spiffy is a local host. This is another easy task and just involves editing your systems ‘hosts’ file. On Windows you can find this in “C:/windows/system32/drivers/etc. Open this file in notepad and you will see it contains a list of IP addresses and hostnames. If you have never edited the hosts file before you should see at least one entry:

127.0.0.1 localhost

For our example we would need to add the following lines:

127.0.0.1 spiffy

127.0.0.1 kewl

127.0.0.1 tidee

And that is it. That’s all it takes to get your virtual hosts up and running.

Admittedly there are lots more options for virtual hosts and if you’re interested there is a wealth of information in the Apache documentation but for most uses this is as much as you need to do.

New Assignment

January 11th, 2008 3D Graphics, Module Stuff

Following our chat before Christmas I have decided to change Assignment 2 (the practical assignment). The new assignment involves the modelling of an Airbus A380 and can be downloaded here.

Girl, Tree, Grass

November 18th, 2007 3D Graphics, imagery

A quick render using Poser and Vue.

girltree.jpg

Crappy thumbnail size is courtesy of Wordpress. I should really sort that out.

Backpack for Software Project Management

November 16th, 2007 General

I have some reservations over this but we have decided to trial Backpack as our project management software.

The reservations I have are not to do with the quality of the software, time will tell on this, but on its suitability for software development. But we considered a couple of options, including Trac, and Basecamp won out. I suppose the main reason for this is that the other systems were primarily focused on developers while what we needed was something that provided good developer-side tools but was user-friendly enough to encourage interaction from stakeholders. It will be interesting to see how it pans out but this does seem to be another underdeveloped area.

Assignments

October 22nd, 2007 3D Graphics, Module Stuff

These are the two assignments for 2007. Please note that as of writing they have not been validated so they may be subject to minor changes. You’ll get plenty of time in class to work on the labs assignments so don’t worry about it. If you have any questions then don’t hesitate to ask.

Assignment 1.

Assignment 2.

Terragen

October 17th, 2007 3D Graphics

A couple of years ago I spent some time playing around with the, excellent, free and British 3D, terrain generator called Terragen. Having not looked at it at all for quite some time now I thought I’d see if it was still available and was pleasantly relieved to find that it was not only still around but it was still free.

Playing with it again now you can see that it doesn’t have the polish of Bryce or Vue but that’s not necessarily a criticism. There’s a lot to like about Terragen.

Firstly there’s the tiny download size, under a couple of Meg, so provided you’re not living in the back of beyond the download is over before you’ve noticed it’s begun. Installation is also lightning quick so you don’t have to wait to long before you can get to dabbling.

While the basic installation of Terragen is fun you can really start to get a feel for its flexibility by adding a couple of plugins from the resources page including the For Export Only plugin that allows you to export your terrains as OBJ (amongst others) files.

There’s a lot less control over render settings than you’ll see elsewhere and to me rendering doesn’t fell too sprightly but then again did I mention it was free? All-in-all Terragen is a great download for anyone interested in 3D graphics and, as my 15 minute image below hopefully demonstrates, it can produce some very satisfactory images.terragen.jpg