Alex Hardy


Hello there!

Archive for ‘Development’

RIP Netscape

Tuesday, March 4th, 2008

As a follow up to my post about the future of Microsoft Internet Explorer, I should note the passing into history of another browser. AOL ended support for Netscape as of February 1st, effectively pulling the plug on its life support.

I started to learn web design and development at university in 1996. At that time, Netscape Navigator was a major player in the browser market. Since then its market share was eroded by Microsoft’s integration of IE with Windows, upstarts like Firefox and an apparent lack of interest and direction from AOL (who bought it in 1999).

So Netscape joins IE5 on the list of dead browsers where the difficulty of supporting them massively outweighs the benefit. The number of visits I get from Netscape users is so negligible (0.13%) that it is no longer worthwhile to test against it.

AOL’s advice to Netscape users is to upgrade to Firefox.

UPDATE: Corrected a factual inaccuracy in the original post.

Microsoft’s Interoperability Principles and IE8

Tuesday, March 4th, 2008

Microsoft have posted on their IEBlog that they have decided to modify their stance on version targeting in Internet Explorer 8. The previous suggestion that developers would have to explicitly invoke IE8’s standards compliance mode (via a meta tag) was a well-meant but controversial move.

The rationale was that the doctype switch is no longer effective. Less educated web developers were expected to omit the doctype in ignorance of its purpose, but equally well-meaning software authors have added them into the page templates in their applications.

Microsoft, quite rightly, take their responsibilities as the dominant browser maker seriously and don’t wish to “break” millions of websites in pursuit of web standards support. The goal was to find the lesser of two evils.

Purists were not happy, even though high profile developers like Jeffrey Zeldman and Shaun Inman came out in favour of it. In Inman’s words:

The strong have always been tasked with carrying the weak. In the case of the ongoing X-UA-Compatible bluster, the strong are the savvy standardistas. The burden? A single meta tag or http header. Can we move on now?

If you were knowledgeable enough to add the tag they argued, then go ahead and add it and stop moaning. Fair enough…

Microsoft have decided though that even this is not fair enough, and have done a u-turn in favour of standards. A meta tag switch will remain, but for those that want their pages to render as under IE7. If your website looks wrong under IE8 standards mode, it is far less painful to quickly add a tag while you address the problems than to have a broken website.

I applaud this move, and Microsoft’s commitment to openness and interoperability. Apple could learn a thing or two about that. The “browser wars” will be truly over not when only one app is left standing, but when web professionals can get on with creating content without worrying about browser quirks.

More cause for excitement about the iPhone software development kit

Friday, February 29th, 2008

Check out Trism, an upcoming puzzle game by Steve of Demiforce. GameSetWatch have posted an interview with him. It looks like the accelerometer may do for the iPhone what the stylus did for the Nintendo DS.

If people like him can create gems like this with no tools, documentation or support from Apple then I can’t wait to see what appears once the SDK is released.

A poll of sorts, about how to fairly license a self-hosted application

Wednesday, February 27th, 2008

As I’m now working on simpleContact Pro I need to tackle licensing a commercial self-hosted application. I’ve been looking into how others do it and there seem to be a variety of options. Putting aside price for now, the dilemma is actually a collection of smaller issues:

  • I want as many people as possible to use and benefit from my software
  • If many people profit from my work and few buy it, I’d call that “getting ripped off”
  • Per-domain licensing seems a little bit too strict
  • Usage of an app where the code is not compiled would be impossible to police
  • My resources are too limited to invest significant time and effort in the above

On reflection, the licensing model I’d like to adopt is as follows:

  • Application costs x, for a personal use license (not restricted to one domain)
  • Installation for a third party (e.g. a web designer working for a client) dictates a transference of ownership and requires a new purchase
  • A user is not permitted to re-sell the software
  • They may however charge for installation as a service at their discretion
  • Charities or non-profit organisations may request a free copy of the application
  • Users are trusted to act in a professional manner – no active policing
  • Support will be denied to users who do not have a license

So what do you think?

Support forum (soft launch)

Tuesday, February 19th, 2008

I’ve added a support forum to this website. I refer to this as a “soft launch” because I haven’t integrated it with the rest of the site, graphically or in the navigation. The only exception is a link on the footer for the downloads page.

My reasons for this are simple:

  • I wanted to add a forum to help support current users of simpleContact 1.2
  • To get it live before releasing simpleContact 2.0 Pro, so I can document it
  • I didn’t want to be sidetracked from building ‘Pro to make the forums purdy

You’ll find sections for FAQs, installation, troubleshooting, requests, miscellaneous and a section that I’ve called “Out and About”. This is where you can earn yourself some link-love by posting about your simpleContact powered website.

Let’s get a discussion going :)

UPDATE: Added a link to the contact page.

FancyZoom

Tuesday, February 12th, 2008

FancyZoom

Cabel Sasser has released the JavaScript image zoom used on his blog and Panic’s website as FancyZoom. It provides a nice smooth zoom effect, caption and drop shadow.

Free for non-commercial use or $39 per domain.

Some may find the price a little steep for what is no more than a slick alternative to Lightbox (which I use myself) or Thickbox, but I can see it being popular with people who want a web gallery to be über cool.

UTF-8 text encoding and self-hosted PHP / MySQL web applications

Monday, February 11th, 2008

One of the best things about web development is that there is always something new to learn, no matter how much you know. If you want to really learn how to build a solid, portable application then I’m convinced that the best way is to release one.

Users will be swift to report bugs and incompatibilities for you. This isn’t negligent; it’s natural. A developer can’t anticipate all possible configurations and behaviour. Your response is what matters. You may be equally swift to issue a fix, but issues may sometimes go unaddressed because the effort outweighs the benefit.

Issues with simpleContact have been rare, but a self-started forum thread caught my attention last week. A member commented that they hadn’t been able to submit their name properly. I’ve researched the matter and in the interests of transparency I’m going to present what I found and what I plan to do.

Character encoding is a thorny issue that few bother to understand and implement in a considered way. There are articles on the web that cover the subject in detail, so rather than re-hash their points I’ll add some relevant links at the end.

The issue

simpleContact uses MySQL’s default collation, which is latin1_swedish_ci – fine for English and most Western European languages, but other languages (e.g. Greek, Japanese, Russian etc) will not be stored or represented properly. This is a matter I wish to address because I want as many people as possible to use my software.

The ideal course of action would be to process and store data in UTF-8 encoding. UTF-8 is a multi-byte character encoding that supports the characters of just about every language in the world.

Advice abounds for how to reconfigure your server and scripts to use UTF-8, but matters are more complicated when users will host an application on their own site. As developers of apps like WordPress and Mint know, ideal configurations in shared hosting services and availability of non-default PHP extensions like mbstring can’t be guaranteed. Some of the servers I have access to lack the necessary functions.

The easiest thing would be to put up a wall and say “If you don’t have x, you need to get a better host”. Meanwhile back in the real world, users are far more likely to reject an app than swap hosts. A middle ground has to be reached.

The solution

UTF-8 support must be added, but not without respecting a user’s situation. I plan to keep Latin-1 encoding and collation as a baseline standard for compatibility. It is better to support a subset of commonly spoken languages than not to work at all. For users whose server supports mult-byte string functions, the database will be silently upgraded to UTF-8 and appropriate methods will be used in PHP.

Beyond that, there isn’t much else. If you want a truly international solution and your host won’t support mbstring then you really do need to choose another host.

So what next?

I have fixed the feature-set for simpleContact 2.0 Pro and don’t intend to add UTF-8 support to it. When 2.0 is done, it will become a high priority feature in version 2.1, which will be a free upgrade. I will add it to simpleContact Lite in due course.

Useful links

Back to basics

Monday, February 4th, 2008

I started work on simpleContact 2.0 Pro tonight. That is, I started to sketch my ideas on paper. To decide what will make the cut for the first release. To start working on answers for the what ifs and formalise the database structure that’s 80% designed in my head. The key features will be:

  • Custom form fields. My most requested feature, which was always planned.
  • Double opt-in mailing list. Services like Campaign Monitor insist on this.
  • CSV export. This acts as a bridge to other software and services.
  • Client-side validation. Powered by jQuery, a nice-to-have that I want to add.
  • Easy upgrade. simpleContact 1.2 users can migrate settings and data easily.

I’ve gone back to good old fashioned paper because design comes first. I want to use my experience as a web designer to build an elegant solution to real needs. There will be no comparison tick list. I won’t add useless features for their own sake. I’ll be adding some over time however, that I’ve seen nowhere else…

I want to make something that’s remarkable because it makes a difficult thing easy. One user was kind enough to share that he’d tried seven other products without success before simpleContact 1.2. It is very rewarding to get feedback like that.

I’m not going to commit to a release date because of my schedule, but I’m going to aim for May/June. Version 2.0 Pro will cost $25, and the existing free version will remain, re-branded simpleContact Lite. Version 1.3 Lite will follow thereafter.

It’s nice to be Sociable

Wednesday, January 23rd, 2008

I thought I’d mention a Wordpress plugin that I installed today: Sociable. It’s an easy way to add social bookmarking links to posts in a similar way to the good ol’ Beeb.

Choose the networks you want to link to and you can also set the circumstances under which those little badges appear. I’ve set mine to only appear inside a post, because I think it looks tacky to have a page filled with icons.

I took the liberty of modifying the plugin to add support for Facebook and 9rules and have submitted the changes back to developer Peter Harkins for general release.

A quick guide to installing a local PHP MySQL development server on Mac OS X

Friday, December 21st, 2007

Mac users are sensitive little souls. Artistic types. We love our beautifully designed computers and software, but poking around in the guts of our operating system doesn’t come quite as naturally to us as to our PC using friends.

Sometimes though that can be a very worthwhile exercise, such as installing a dev server. Perhaps you have a laptop, and need to be able to work or present when you don’t have internet access (eg: while travelling). Here’s how…

Good news, everyone!

The Apache web server and PHP are already installed as part of Mac OS X and only need to be turned on. The MySQL database server will have to be downloaded and installed, but we’ll cross that bridge when we come to it…

This is an easier job than it used to be and doesn’t have to involve typing code into the Terminal. Marc Liyanage does a fantastic job of creating PHP installer packages if you want to keep your installation bang up to date, but for most purposes the instructions below should be sufficient.

Note: I have used Mac OS X 10.5 Leopard and MySQL 5.0.45 (the latest at the time of writing) on a MacBook Pro. I used TextMate to edit text.

Part 1 – Apache and PHP

  1. Go to Apache folder

    Start by editing the Apache config file to enable PHP. This file is hidden by default, but you can access it from the Finder’s “Go” menu. Enter /etc/apache2 and confirm to make the folder appear.

  2. Edit Apache config file

    Open httpd.conf in a text editor. Find the line that says:

    #LoadModule php5_module libexec/apache2/libphp5.so

    Uncomment it by removing the hash. Save the file (you will be asked to enter your admin password).

  3. System Preferences – Sharing

    Open System Preferences and go into “Sharing” (under “Internet & Network”).

    Turn on ”Web Sharing”. You now have an active Apache server with PHP. Test this by typing localhost into your browser. You should see the default Apache page.

  4. Turn on Web Sharing

    If you feel curious, create a PHP file with the phpinfo() function call in it to see the details of your installation.

    Place your own files in /Library/WebServer/Documents

Part 2 – MySQL

  1. MySQL Community Server

    First things first: Head on over to MySQL.com and download MySQL Community Server and the GUI Tools.

    As their names indicate, the former is the database software itself while the latter is a collection of graphical tools to make the task of administering MySQL easy for those of us that find the Terminal a bit too scary.

  2. MySQL GUI Tools

    I use an Intel Mac, so I got the Mac OS X 10.4 (x86) builds. Take care to download the most appropriate build for your computer and OS version.

    I recommend that you always use the latest GUI tools for the latest features and stability improvements.

  3. Mount the MySQL disk image and run the main package first, then install the startup item, finally the prefpane. I needed to restart before MySQL would turn on.

  4. MySQL prefpane

    Open System Preferences and go into “MySQL” (under “Other”). Tick the box to automatically start MySQL on startup.

    You can install the GUI Tools by dragging them from their disk image to your Applications folder. Nearly there now!

  5. It is crucial that you now set a password for the MySQL “root” account. Open MySQL Administrator and log into localhost with root (no password). Under “Accounts” you can assign a password to root, as well as create other database users.

    Avoid using the root account in your applications – use it only for administration.

    That’s it! You can start creating databases and coding the PHP applications that will run on them.

Recommended Reading

PHP and MySQL for Dynamic Web Sites

If PHP and MySQL are new to you, I recommend PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide by Larry Ullman. In common with other books in the series, this book gives you a solid grounding in the subject, with plain English examples.

If you are already familiar with HTML and maybe a scripting language or two, you should hit the ground running!

If this guide was useful to you or you would like me to elaborate further, please feel free to comment. I’m thinking about writing a series of how-tos in this manner and your feedback would be appreciated.