Thursday, May 01, 2008

buried treasure


I know you're all very busy, but if you get some time you should check out the resources on Smashing Magazine's Best Of April 2008 page - some of this stuff is gold.



Image: 'buried treasure'
www.flickr.com/photos/35468137797@N01/64228609

Tuesday, April 29, 2008

intro to programming

Hope you all had a good break - I certainly did. It was totally unsullied by any menial tasks like marking web development assignments - but don't panic, I'll have some nasty comments for you by next week... I promise :-)

This week we're launching into programming proper, working through Robyn's excellent notes and converting them to web pages, which should give us plenty of html and css practice along the way. So, create a week1a page with some extra scripting and compiled languages on the relevant table, also create a home page linking to your week1a page and upload both new pages to your web space on the bathurst-tafe sever.

Images can be created from screen captures (hoversnap might be handy for this) or you can find creative commons licensed images via flickrcc (don't forget to add the attributions at the bottom of your web page)



Image: 'the only flow-chart you will ever need'
www.flickr.com/photos/55847834@N00/1229271594

Monday, April 07, 2008

taking shortcuts

Today we're looking at a CSS template: blueprint
and an online grid editor for the same.

Tuesday, April 01, 2008

validation


^ This is what you want to see. To test a page that's been uploaded to the server you can use the validation options on the firefox web developer toolbar (found under 'tools').

You can also go straight to the W3C validation page. Note the tabs on the page which allow you to enter a URL, upload a file or cut and paste code.

Finally, if you enjoyed yesterday's PMOG mission, there's another one on validation that you could take.

At the end of the day I'd like you to validate one or more pages on your Bathurst TAFE web site and include the little validation link that the W3C give out when you pass their test.

Sunday, March 30, 2008

Image mapping

Today we're giving PMOG a bash, with a little image map mission that I've put together for your learning pleasure. You'll need a login (send me an email if you need an invitation - I think they're out of beta now, but I could be wrong). You'll also need a firefox addon (there's a link on the PMOG site). Have fun.

Sunday, March 23, 2008

happy easter

I know you'll all miss our weekly get together - the same way I know you probably wouldn't do any exercises that I post here. So here's a compromise... an excellent CSS cheat sheet. Print it out, memorise it and then eat it so that it can't fall into enemy hands.

Monday, March 17, 2008

tables and backgrounds

Today we worked through the backgrounds tutorial on tizag

If you want to experiement there's a background image library on http://www.grsites.com/textures/

We finished up with some work on creating tables, followed by a table exercise on the wikiversity.

If you're feeling chirpy, try the harder advanced table exercise

Image: 'buena vista'
www.flickr.com/photos/70825417@N00/358756373

Monday, March 10, 2008

CSS for layout


This week we're looking at how to use CSS to lay out a page. To kick off, work through this tutorial on subcide called 'Creating a CSS layout from scratch' (up to, but not including page 10, the navigation).

There are some interesting techniques used here to ensure the divisions stay in the right places. And some not-so-interesting uses of graphics instead of text (did you spot them? What would you do differently?)

One thing I noticed was a lot of code in this tutorial that set the padding and margins for various elements to zero. If you're wondering why, there's a good article on the subject called 'No Margin For Error'

Taking the idea of stacking DIV boxes to make a page layout one step further, here's two more web pages to look at:

  • layout-o-matic - which lets you plug in some variables and automagically generate some CSS
  • Little boxes - which has a set of templates ready to download

Once you've explored these a little, revisit your '10 things' page and apply some CSS layout so that there's a column on the left of the content. Put an unordered list of links to each detail page in this column. For bonus playing time, decorate your left hand column list using some CSS from the listamatic.

At the end of the day you should have some html that looks like:

<html>
<head>
<title>title</title>
<link rel="stylesheet"
type="text/css"
href="css/default.css" />
</head>
<body>
<div class="breadcrumbs">
<a href="index.html">Home</a>&nbsp;.
</div>
<div class="title">
<h1>Title</h1>
</div>

<div class="sidebar">
<ul>
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="thing1.html">Thing 1</a>
</li>
<li>
<a href="thing2.html">Thing 2</a>
</li>
<li>
<a href="thing3.html">Thing 3</a>
</li>
<li>
<a href="thing4.html">Thing 4</a>
</li>
<li>
<a href="thing5.html">Thing 5</a>
</li>
<li>
<a href="thing6.html">Thing 6</a>
</li>
<li>
<a href="thing7.html">Thing 7</a>
</li>
<li>
<a href="thing8.html">Thing 8</a>
</li>
<li>
<a href="thing9.html">Thing 9</a>
</li>
<li>
<a href="thing10.html">Thing 10</a>
</li>
</ul>
</div>
<div class="content">
<div class="pic">
<img src="xxx.gif" alt="a picture" height="200px" width="150px" />
</div>
<div class="wikiquote">
<p>some text from the wikipedia</p>
</div>
<div class="backgroundinfo">
<p>why this item made my list</p>
</div>
<div class="credits">
<p>Flickr Image: <a href="#">pic name</a></p>
<p>Wikipedia Article: <a href="#">wiki article title</a></p>
</div>
</div>
<div class="footer">
<ul>
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="thing1.html">Thing 1</a>
</li>
<li>
<a href="thing2.html">Thing 2</a>
</li>
<li>
<a href="thing3.html">Thing 3</a>
</li>
<li>
<a href="thing4.html">Thing 4</a>
</li>
<li>
<a href="thing5.html">Thing 5</a>
</li>
<li>
<a href="thing6.html">Thing 6</a>
</li>
<li>
<a href="thing7.html">Thing 7</a>
</li>
<li>
<a href="thing8.html">Thing 8</a>
</li>
<li>
<a href="thing9.html">Thing 9</a>
</li>
<li>
<a href="thing10.html">Thing 10</a>
</li>
</ul>
</div>
</body>
</html>

and some CSS that includes:

.content {
margin-left: 150px;
}
.sidebar {
float: left;
}

Monday, March 03, 2008

godzilla vs. filezilla


Today we looked at installing and setting up our own ftp client - filezilla (the client not the server). For the full scoop on ftp, including the all important difference between active and passive modes, check out this little wikipedia entry.

Now, I need you to write a blog post on your ftp experiences so far. If you haven't tried your second ftp client yet, pick one from the list, install it, and take it for a spin - then post an entry on your blog comparing it to your first client (core ftp-lite).

In the blog post tell me which one (if either) will you be using from now on and why. Some other things you might mention include:

  • The name of your ftp client
  • The URL you got it from
  • any installation woes you encountered
  • some comments on its ease of use
  • $
  • the platform(s) it works on
  • the install file size
and any other interesting bits of information you came across. cu next week. bbb





Image: 'Houston, we have a problem.'
www.flickr.com/photos/76074333@N00/301015327

more on lists and CSS


We re-visited our template today, looking at how we could apply CSS to the blocks on the page in more detail.

A couple of the areas we covered were:


Here's how the html template looked like when we'd finished with it:

<html>
<head>
<title>title</title>
<link rel="stylesheet" type="text/css" href="css/default.css" />
</head>
<body>
<div class="breadcrumbs">
<a href="index.html">Home</a>&nbsp;.
</div>
<div class="title">
<h1>Title</h1>
</div>
<div class="pic">
<img src="xxx.gif" alt="a picture" height="200px" width="150px" />
</div>
<div class="wikiquote">
<p>some text from the wikipedia</p>
</div>
<div class="backgroundinfo">
<p>why this item made my list</p>
</div>
<div class="credits">
<p>Flickr Image: <a href="#">pic name</a></p>
<p>Wikipedia Article: <a href="#">wiki article title</a></p>
</div>
<div class="footer">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="thing1.html">Thing 1</a></li>
<li><a href="thing2.html">Thing 2</a></li>
<li><a href="thing3.html">Thing 3</a></li>
<li><a href="thing4.html">Thing 4</a></li>
<li><a href="thing5.html">Thing 5</a></li>
<li><a href="thing6.html">Thing 6</a></li>
<li><a href="thing7.html">Thing 7</a></li>
<li><a href="thing8.html">Thing 8</a></li>
<li><a href="thing9.html">Thing 9</a></li>
<li><a href="thing10.html">Thing 10</a></li>
</ul>
</div>
</body>
</html>


and here's the final CSS:
.backgroundinfo {
background-color: pink;
text-align: center;
margin-left: 20%;
margin-right: 20%;
border: 2px;
border-style: dotted;
border-color: purple;
}
.breadcrumbs {
background-color: red;
padding: 5px;
border: 0px;
border-color: blue;
border-style: dashed;
margin: 5px;
float: left;
width: 10em;
}
.breadcrumbs a:link {
text-decoration: none;
color: yellow;
}
.breadcrumbs a:visited {
text-decoration: none;
color: yellow;
}
.breadcrumbs a:hover {
text-decoration: underline;
color: blue;
}
.credits {
background-color: #eeeeee;
padding: 5px;
border: 1px;
border-color: blue;
border-style: dashed;
margin: 5px;
float: right;
width: 25%;
margin-top: -45px;
font-family: sans-serif;
font-size: x-small;
}
.footer {
clear:both;
}
.footer a:link {
color: white;
text-decoration: none;
padding: 3px;
}
.footer a:visited {
color: white;
text-decoration: none;
padding: 3px;
}
.footer a:hover {
background-color: skyblue;
color: navy;
text-decoration: none;
padding: 3px;
}
.footer li {
display: inline;
padding-right: 7px;
list-style-type: none;
}
.footer ul {
background-color: navy;
color: white;
padding-left: 0;
margin-left: 0;
font-family: sans-serif;
font-size: xx-small;
}

.title {
background: gray;
clear:both;
text-align:center;
margin-top:1px;
}
.pic {
background: skyblue;
text-align: center;
display: block;
margin-left: auto;
margin-right: auto;
}
.pic img {
border: 5px;
border-style: ridge;
}
.wikiquote {
background-color: purple;
text-align: center;
font-style: italic;
margin-left: 20%;
margin-right: 20%;
margin-top: -20px;
border: 5px;
border-style: double;
border-color: orange;
}

body {
margin: 0px;
}



Image: 'consume now3'
www.flickr.com/photos/17949364@N00/202924682

Monday, February 25, 2008

making a list and checking it twice


whew, what a wild ride we had this week.

We started out by creating a new page titled "Ten things I want to do before I die" - saving it as an index.html file in a new directory called tenthings. On this page we created an ordered list of... 10 things we wanted to do before shuffling off this mortal coil.

Then we spent a little time designing a topology map of a site we could build around this page; 10 more pages with details of each of our ten things, links to each of these pages from our index, links from each detail page to the index page and to the next and previous items in the list.




Next we looked at designing the layout for a typical detail page. Paragon of page design that I am I came up with the following jewel...

What followed was a whirlwind of activity...

  • Locating and saving an image (into an images directory) from flickrCC
  • Inserting said image on the page (including setting the alt, height and width attributes)
  • Making the image into a clickable link back to the original page on flickr
  • Using CSS to remove the unsightly blue border using an embedded or internal style tag in our document's head section
  • Creating a CSS div and adding a class name of "quoteblock" for a wikpedia quote about our goal.
  • Putting an H2 and blockquote into that div and cutting and pasting some wikipedia text there.
  • Setting the border, padding, background-color and font-style for our quoteblock class
  • Giving the other blocks on the page a similar treatment
  • Removing the CSS and putting it into an external style sheet so we can use it in the other 9 detail pages too.


Image: 'Dead Can9t Dance'
www.flickr.com/photos/19487674@N00/407283421

Monday, February 18, 2008

Head first into web development


For this subject (and our CSS module) we'll be using the excellent text: Head First HTML with CSS and XHTML. It's not compulsory that you buy a copy ('though it wouldn't hurt), but you will need to visit their web site and download the example files.



Image: 'Freefall'
www.flickr.com/photos/17088109@N00/1157425229

Saturday, February 09, 2008

Welcome


Hello and welcome to the Bathurst web class for 2008. This will be a great year I think.

So that we can keep in contact, I'll be posting lesson notes here on the cert IV weblog which might be worth bookmarking (perhaps in a del.icio.us account).

During the course I'll be asking you to post material on-line; reflections, interesting finds and assignment answers (for a great example from last year's class, check out Sharlene's blog) If you don't already have one, I'd like you to create a blog of your own. Blogger is a good free offering, but there are many others.

Once you have a blog set up, bookmark it, write an introduction about yourself and what you hope to get from this course and then come back here and leave me a comment with the web address of your space (copy and paste from the browser's address bar) - when I get the URL I'll add it to the hall of fame on the right :).

Another tool we'll be using a lot this year is the Training O2 website. Create an account there and then search for htmldog. Visit the link that comes up for the html beginner tutorial and work through the first four lessons: getting started; tags, attributes and elements; page titles; paragraphs and headings. After you've worn yourself out go back to the detail page for htmldog on the training o2 site and leave a comment on what you thought of the tutorials. For bonus marks see if you can figure out how to vote for the htmldog web site.

Whew, that's probably just about a brainfull for the first day, but if you want to do more, post another entry on your blog about your impressions of the web course so far - I'd love to hear what you think.



Image: 'Entry into the Celaphopad'
www.flickr.com/photos/35034345972@N01/340449446

Monday, October 29, 2007

Monitoring traffic and compiling website traffic reports


For this assignment you will need to write a short report on the Bathurst TAFE website or a part thereof, say: your web page(s).

The report should...

  • Identify and analyse available site analysis software - what software or reporting service would you recommend and why.
  • Give a brief description of how to obtain and install the most suitable site analysis software
  • Identify the required report options
  • Develop a traffic monitoring program
  • Show examples of the required traffic reports
  • Analyse reports to identify any improvements that might be made to server/site performance
  • Apply forecasting methodologies to predict traffic peaks
  • Recommend changes in hardware and/or software that might be needed
  • Suggest what training might be required to use the package

In particular, I'd like to know:
  • how many people come to visit the site in a week
  • how long they spend on the site
  • which are the most popular pages on the site
  • where they're coming from (both where they live and how they might have found the web site)
  • what search terms were being used if they arrived through a search engine
  • what browser and operating systems they are using
  • when the busiest and slowest times are on the site
You can blog your answer or print it out with a cover page. Try to get it all done and posted by Monday 19th of November.



Image: '1D3_03323p_1310'
www.flickr.com/photos/84739639@N00/1432102881

Monday, October 22, 2007

Political Accessibility


To flex our accessibility assessment muscles we're going to analyse a real live web site and blog the results.

Pick one of the sites being maintained by the Australian politician or party of your choice (e.g. the Labor Party, Liberal Pary, Kerry Bartlett, Bob Debus)

What demographic do you think is being targeted? Describe the target audience's age, education and reading level. Analise some key pages on the web site for reading and comprehension levels (juicy studio might be useful here) - does the copy match up with the audience's education level?

What are the legal (and ethical?) accessibility requirements for the web site? Does it meet these requirements? (UITest might be helpful here, along with the usability checklist set out in the Victorian Government Accessibility Toolkit)

What changes would you make to the site to improve its accessibility and/or make it comply with current legal requirements?

Post your answer or print and submit by Monday the 5th of November.




Image: 'Have you?'
www.flickr.com/photos/19487674@N00/291687660

Monday, August 27, 2007

a joint venture

We've had a little excursion into table joining - extracting data from tables that have a relationship between them (sharing primary and foreign keys that is)

to get some practice, let's extend our earlier customer table, making two more tables so we can let them place orders for products. These tables will be:

Products
productID (int, 11, auto_increment)
productname (varchar, 250)
price (decimal, 25)

and

Orders
orderID (int, 11, auto_increment)
productID (int 11)
customerno (int 11)

the productID and customerno in the orders table are foreign keys to the products and customers tables, and so our customers can have orders for many products, and our products can be in many order records.

Once you've built the tables put some test data into them - let's say 4 customers, 4 products and 4 orders - make sure that only 2 of your customers have placed orders (the other 2 are still thinking about it), and that only 2 of your products appear in any order (the other 2 are just gathering dust)

Once you have your test data in place create 3 SQL queries to show the following data:

  1. all orders (show customer name and product name only)
  2. all customers (and what they've purchased, if anything)
  3. all products (and who purchased them, if anyone)
the first query is a straightforward inner join, the last two will be left and right outer joins

Once you have the SQL working correctly, try building a set of php pages to display each one. For bonus marks, only show the customer name once on the all customers report (with a list of purchase items), and the product name once on the products report (with a list of customer names)

Finally, make an index page that points to each of the 3 reports - upload the lot (and your tables and test data) to the bathurst-tafe server and post a link back to the index in your blog.




Image: 'Join Us'
www.flickr.com/photos/16682940@N00/94736480

Friday, August 10, 2007

Cheating

Last week we looked at creating a table, inserting some information and showing the results.

You could have written the code from scratch - or done the smart thing and used phpMyAdmin's 'show php' feature.

This will take you a long way towards most of the things you want your web pages to do, but you might need some help getting phpMyAdmin to do its tricks in the first place - which is where the ilovejackdaniels cheat sheet comes in handy.

This page will list the common select statements and functions - and contains enough information for you to accomplish the following performance criteria:

Write an SQL statement that selectively retrieves data
  1. Restrict the number of rows retrieved by placing criteria in the 'where' clause

  2. Restrict the number of rows retrieved by placing specific criteria in the select statement

  3. Use comparison operators in the 'where' clause to compare numeric, character, string, date and time data

  4. Use Boolean operators with the correct precedence

  5. Use criteria in the 'where' clause to check for a range of values, to select values from a list, and to check for values that match a pattern

  6. Use SQL syntax to suppress duplicate values from query results

  7. Take action to exclude null values from a query result


Write SQL statements that use functions
  1. Use arithmetical operators with the correct precedence

  2. Use string functions and operators to obtain the required query output

  3. Use mathematical functions to obtain the required output, where required

  4. Use date functions to obtain the required output

  5. Use SQL aggregate functions to obtain the required output



Go on, try it out (you won't regret it)


Image: 'Blatent Cheating'
www.flickr.com/photos/81719291@N00/88894036

Monday, July 30, 2007

pop quiz

Here's a short exercise to practice what we've learned so far.

Create SQL statements to accomplish the following tasks. Post your answers in your blog. Hint: you might find this easiest to do using phpmyadmin.

  1. Create a customers table with an auto-incremented custno field, an indexed custname field and a single address field.
  2. Write the SQL code that would insert 'J. Smith' into the custname field and 'Leeds' into the address field.
  3. Write the SQL code that would extract all the customer details from the customers table in alphabetical order
For bonus marks:

Create an html page with a form for entering new customers. Link the form to a php page that inserts these values into your table. To include this code into your blog, you're going to have to do some formatting (blogs don't like < and > characters) - cut and paste your code into and out of the postable site to fix this.


Image: 'We Won the Quiz'
www.flickr.com/photos/24204505@N00/148260617

Monday, July 23, 2007

Cutting Code


catching up with some things I glossed over last week...

Creating a table

once you have a database server and a web server set up on your local machine, you'll need to open a web browser and start up phpMyAdmin. Something like: http://127.0.0.1/phpmyadmin (the capital letters may or may not be important)

The first time you log in the default administration account for mySQL is root with a blank password. Since this database will only be used for development we can keep this, but if you were setting up a database on an internet facing web server you'd want to set the password (or better, create another user and delete the root user altogether).

Once you're logged in to the database server you'll need to create a database (test) and create a table on it (contacts) with the following fields (as set out in the tutorial):

Name
Type
Length
Description
idINT6A unique identifier for each record
firstVARCHAR15The person's first name
lastVARCHAR15The person's last name
phoneVARCHAR20The person's phone number
mobileVARCHAR20The person's mobile number
faxVARCHAR20The person's fax number
emailVARCHAR30The person's e-mail address
webVARCHAR30The person's web address


Inserting some data

In order for our php interpreter to use data in the database you need to tell it a few things:
  1. where the database server is located (on the development machine that's easy, it's the localhost, but in the real world the database server is usually another computer with an ip address all of its own
  2. Who's trying to connect and the password (to keep out casual snoopers)
  3. The name of the database you're trying to access (a database server can host mutliple databases - each database consisting of a collection of tables and indexes)
Typically this information will be kept in a single file which gets included on all the php pages that access the database. This means you can change the details in just one spot to update the whole site when you come to move it from the development environment to the production server.

I keep this information in a connect.php file which has the following code in it:

<?
$user="root";
$password="";
$database="test";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
?>

$user, $password and $database are all variables (php variables all start with a $ sign) which can be changed at any time. You can include it in your php pages by inserting the following code:

include "connect.php"

the actual process of inserting records is outlined quite well in part 3 of the tutorial.

This week we went on with part four looking at how we get new values from a form to insert into the table. We then worked through the rest of that part to see how to display the contents of the table on a web page.

And that was about it for this week - next week we'll look into how to create a search form, and how to sort the results.

Still to come: editing and deleting records, and then: using a multi-table database.




Image: 'Neon scissors'
www.flickr.com/photos/48889087714@N01/9658510

Friday, July 20, 2007

prequel to SQL

Time to star thinking about using structured query language (SQL) to create database structures and manipulate data

But before we do, we'll be needing a local development environment with a web server, database server and php scripting engine all rolled into one... XAMPP

Install this on your operating system of choice and bingo - you've got a grown up web server in a tiny little package.

To check that it's working start the program (on a windows machine that will be something like running C:\xampplite\xampp_start.exe) and then type: http://127.0.0.1 into your web browser's address bar. This should display the home page for your new local web server.

If everything's working OK you should see the xampp home page - and on the left a link to your phpMyAdmin page where we'll be setting up a database and single table as outlined in this PHP/mySQL tutorial

Try it out and post some php pages to the local server's root (somewhere like: C:\xampplite\htdocs) remember, test them by calling the local host ip address (e.g. http://127.0.0.1/test.php)



Image: 'Will code for food'
www.flickr.com/photos/67523311@N00/114420037