Great Way to Learn XHTML/CSS

The link above is to a great book for learning XHTML/CSS. I bought it for my daughter, as an introduction to building web pages and sites - and then I read it.

First, and most importantly, it is technically up to date and accurate. The information presented will help the reader build web pages and sites.

Next, it is really fun to read. I read the entire book, which is something I very rarely do with technical books (usually I use them only for reference). I confess I didn’t do the exercises, I write enough code as it is.

Finally, I learned the following:

  • The difference between block and inline elements, and their relationships
  • The value of putting height and width attributes on img tags
  • How float and clear really work, and the impact of them on the pages, especially pages which may be viewed with mobile devices
  • Other finer points of positioning page elements
  • How to center pages in the browser

If you are new to the web, it is a great book to start with. If you are more of a software engineer than a web page coder, it can really help you understand the front-end.

Professional Volunteers - Web

The Internet is a vital communications tool. Web sites and email are important for most organizations that are striving to reach a widely distributed audience in a cost-effective manner.

Many small organizations, especially non-profits, need a site, but don’t have the money to pay professionals. Without a friend that can help, they may get an intern, a volunteer that will work in exchange for experience, a contractor, or use services like GoDaddy’s web site tonight or other template based systems.

Most of these are stop-gap approaches, and some can be extremely expensive.

A great solution is a WordPress blog, hosted by WordPress.

Benefits

  • WordPress is a great application, it is very powerful, and easy to use
  • No application management, no security issues to worry about. No server management necessary.
  • It is a good value, their premium services are priced fairly
  • Great templates, so you can have a professional design, without paying for it. There are so many templates available, it is extremely unlikely anyone will know that you are using an existing template instead of a custom design.
  • You can map a domain name to the blog, so it looks like you’re hosting the site.
  • email can be run through a different server, the people at WordPress can help you find a good company
  • You don’t need a volunteer, contractor, friend, or anyone else to set it up, and it is easy to pass it along to other people

Never forget, you get what you pay for. A volunteer is often someone trying to build up a portfolio. They may have limited skills, and limited experience. Volunteer work will always be pushed aside for paid work - everyone has to eat. People willing to work for low pay are the same - if they could get a job which paid more, they would. Friends are usually more reliable than strangers, but they may have other commitments.

For web projects that are too small for a web company, or don’t have the budget, it is worth considering services such as WordPress, and learning how to handle email on your own. There is little technical skill required and hosting companies are usually very helpful.

If you are concerned that you don’t have the time to set up a WordPress blog or handle the email, remember that even if you have someone help you, you will have to spend time with them to explain what you want. When you want changes, you will have to contact them, then check their work. Investing in learning to do the work yourself will save you time in communicating your needs to others.

AJAX Limits

AJAX and RIA’s are rapidly redefining web interfaces, but they can be expensive and complex to implement.

A key consideration is to keep server side logic on the server. Background scripts should be written to require little to no user interaction, and should allow users to view their progress as they execute, and receive an email of the results when they complete.

The synchronization required to preserve states across accesses and sessions is probably not cost effective. Accepting that the web can initiate resource intensive background scripts, but not interact with them (other than possibly killing them) is a reasonable consideration.

Testing for a script in progress should be done to avoid redundant and potentially corruptive requests.

dojo AJAX file upload demonstration

This is a demonstration or example of how one can use dojo.io.iframe.send to submit form data to a server. This is useful if you have file inputs, which cannot use other methods.

The page includes good notes, and all source can be viewed.

Monitor Script Execution with PHP

The following is a very simple script that can be used as a framework to monitor the execution of a script.

Comments are used for explanation.

<?php
/* Ensure the viewer has logged in. */
session_start();
if (!isset($_SESSION['bLogged_in']))
	die();
?>
<html>
<head>
<?php
        /* 
        The escapeshellarg is there as a reminder to escape any input.  In this
        case, it is unnecessary, but if $_GET was used, it would be important.
        */
	$script=escapeshellarg('httpd');

        /* 
        Use ps and grep to check for the script running.  ps -C $script may also be used.
        */
	$ps=nl2br(`ps|grep $script`);

        /* 
        This command is used to simulate execution of a script.  It just appends the date
        to a file.  
        */
	$time_data_maker=`date >> ../test.data`;

        /* 
        Test to see if the command is executing
        */
	if ($ps != '')
        {
                /* Update the timestamp on the session file */
                $_SESSION['tick']=1;
                /* Tell the browser to refresh the page in 3 seconds */
		echo '<META HTTP-EQUIV="Refresh" CONTENT="3" />'."\n";
        }
?>
<title><?php $_GET['title']?></title>
<style>
body 
{ 
	font-family : "Courier New", Courier, monospace;
	font-size: .8em; 
}
</style>
</head>
<body>
<?php
/* If script is not running ... */
if ($ps == '')
{
	echo $script.'is not running<br />';
}
else
{
	echo $script.'is running<br />Current Status<br />';
        /* Display contents of file */
	echo nl2br(file_get_contents('../test.data'));
}
?>
</body>
</html>

Notes:

  • Refreshes stop when script stops
  • Page display prolongs session until it finishes
  • Session id may be used to identify data file, script name can make a nice extension
  • Placed in an iframe, with a print button, this is a very nice interface