User Interface - colour schemes

Posted on March 16th, 2007 in Software development by chris

Traditional software developers used to do coding, by which I mean writing program code that made computers perform tasks. In recent years with the growing emphasis on web-based applications even developers like myself who are more comfortable programming the server logic of a web application often have to write the user-interface layer too.  When the user interface was a Windows forms application the user usually expected (and got) an interface with varying shades of grey.  Nowadays, with the user interface being presented in a web browser, in fact the same web browser that delivers music, movies, games, chat-rooms and other cool stuff, users expect colours, which can be a problem to those of us with a maths or science background who have no innate creative flair.

The following rules have proved useful in helping me to create passable colour schemes for user interfaces.  I forget where I first found these but they are definitely not my own work!

  • Work with a limited palette
  • Pick two hues that work well together
  • Use these colours throughout the design
  • Add variations of these colours as needed
    • adjust saturation and luminosity (lightness)
    • don’t change the hue
  • Add a few other hues as accents
    • use these sparingly
  • Use saturation like contrast
    • relevant information has a higher saturation

CAPTCHA

Posted on February 11th, 2007 in Software development by chris

Every day we learn something new.  I publish an insignificant little non-profit website about a local folly called Alfred’s Tower.  You can view the site at www.AlfredsTower.info.  It has an ASP.NET feedback form where visitors can submit comments.  The comments are sent by email to me and the sender receives an acknowledgement email thanking them for taking the trouble to make a contribution.

Recently the feedback form has been ‘found’ by spammers who are now using it to send several emails a day containing the URLs of their websites.  I have amended my code so that the sender doesn’t receive an email acknowledgement when a URL is included in the text, but the spam keeps coming, presumably sent by some automated process.  This is when I turned my attention to CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart).  This is a challenge to the user of a web form that attempts to determine whether the form is being used by a human or by an automated process.  The test usually takes the form of an image that displays jumbled, overlapping, or distorted letters and numbers, and the user is asked to copy the characters into a textbox.  If the user correctly transposes the characters they are assumed to be human because computer programs are not good at this kind of test.

CAPTCHA testI decided to add such a test to my ASP.NET 2.0 web form.  A quick Google found a few paid-for controls that appeared to meet my needs, but since the website is not commercial I didn’t want to spend $50 or $100 that I wouldn’t be able to recoup.  After a little more hunting I found exactly what I was looking for; a free, public domain offering from Peter Bromberg that doesn’t generate images, it actually forms the text characters in HTML at runtime (see eggheadcafe.com).  This is arguably a better method than displaying a distorted image because the generated text is easy to read by everyone who isn’t visually impaired, whereas some of the more sophisticated CAPTCHA controls are hard to use because the distorted text is difficult to interpret even by intelligent humans.  The picture above shows an example of the random text generated Peter Bromberg’s code.

Since introducing this method no spam messages have been received from this form.

ASP.NET 2.0 version numbering

Posted on January 8th, 2007 in Software development by chris

Today I decided to display the version number of the web application I’m writing, but had to do some hunting around to see how to retrieve this.  Basically I had to create an AssemblyInfo.vb file in the project’s App_Code folder that contains the following:

Imports System.Reflection

 

<Assembly: AssemblyTitle(“Program Title”)>

<Assembly: AssemblyDescription(“Written by Chris Nelms”)>

<Assembly: AssemblyCompany(“My Company Limited”)>

<Assembly: AssemblyVersion(“2.0.*”)>

Then in the Page_Load event of my web form (or anywhere else) I insert these two lines of code:

Dim MyAssembly As System.Reflection.Assembly = System.Reflection.Assembly.Load(“App_Code”)

Dim strVersion As String = MyAssembly.GetName.Version.ToString

That’s all there is to it!

Turning Autocomplete off

Posted on January 5th, 2007 in Software development by chris

This is the first of several oddments that I shall save here for future reference.  They are mainly snippets of code that I spent half an hour hunting to find, and don’t want to have to repeat the search again.  I used to keep these on a website at VBsampler.net but now that I’m posting this blog on a more or less regular basis it seems the more logical place to save them.

In this case I wanted to find a way to turn off the Autocomplete facility offered by Internet Explorer (and presumably other web browsers too) whereby the user is prompted with previous values they entered into a text box.  Useful at home when you repeatedly enter your name or address but less so on a business application when different customers’ details are being entered each time.

The solution is as follows:

<form id=”form1″ runat=”server” autocomplete=”off”>

This works on an ASP.NET 2.0 Master Page so that I can disable Autocomplete for a complete web app if I wish.

The Google mystery

Posted on December 28th, 2006 in Software development by chris

I’m a relative novice at creating public websites although I have developed intranet ASP and ASP.NET web applications for over six years.  However since 2002 I have run a small, amateur, non-profit website that provides information on a local folly, King Alfred’s Tower.  The site aims to be the definitive source of information about this building.  When first set up the Alfred’s Tower website quickly went to number one in the Google rankings, which is not surprising since there is very little competition.

In 2004 the site suddenly disappeared from the Google index, and has remained unindexed by Google ever since.  If I search Google for site:www.alfredstower.info or info:www.alfredstower.info it returns no matches.  I regularly submit the URL to Google for inclusion, but when I use Google’s webmaster tools it reports that “No pages from your site are currently included in Google’s index”.  This is very odd since several other search engines such as Yahoo and Ask include the site in their index, and there are dozens of other sites that link to mine.  I’m not using any dubious tools to promote the site.

In contrast I started this blog just a few weeks ago.  To the best of my knowledge no other sites link to it.  Yet within four days of creating this blog the Googlebot had found it and included it in the Google index.  All pages on the Alfred’s Tower site are XHTML compliant and pass the w3.org validator.  It hasn’t got a robots.txt file.  The server log shows that googlebot visits the site regularly but doesn’t download many pages.  I would welcome any suggestions as to how I can get Google to include the Alfred’s Tower site.