Archived entries for

Custom ‘useful’ 404 error page?

I read an article on Digg a few weeks back about making a successfully useful error page. Let’s eb fair about it, while the designers and programmers of the world may well understand the server error response code 404, for most it makes no sense – although I’d bet every web surfer in the world has seen at lease one. So why is it that most error pages are completely useless. If I hit an error page, I don’t want to be told that the server encountered a problem and have to mail the webdev, I want an explanation and a way to continue my navigation of the site. I had a think about this and decided I would make a simple custom page for this scribbish theme, none to difficult really and here’s what we did.

Open up the following directory on your server:

'wordpress-path'/wp-content/themes/scribbish/404.php

The path will be similar, no matter what theme you have installed, just replace ’scribbish’ with the theme you are currently using. If you look at the bog standard error page, you will see that it just states the generic message within your template. We want to change this so that the user is

  1. Informed that some sort of error has occurred
  2. Given the option to go somewhere else

Part 1 is easy, just add the appropriate H1 and H2 tags, along with a couple or ‘p’ marks to write what you need to see.

Part 2 is a little bit more complicated, but not by much. I wanted to show the users the last 4 posts, perhaps that is what they were looking for. We need to know the function call in wordpress to display previous post along with a variable for the number we wish to show. A quick visit to the wordpress help pages and we find this little snippet.

wp_get_archives('type=postbypost&limit=4');

My blog is having trouble posting php snippets with the correct tags. So you’ll need to surround the above code with php tags.

So insert that into your 404.php page, above the footer and possibly the sidebar depending on how your page is set out. Now when somewhere clicks or visits a part of your site with an error page, at least they may click back into your site and continue their search. You can change the ‘postbypost&limit=4′ to any number you wish, that determines how many of you recent post display.

The new broadband?

So, we finally switched the broadband for the entire company last week. We moved lines from both IZR solutions and BT over onto Griffin Internet. Admittedly, we had the obligatory 10 day ‘wibbely-wobbeley’ period while the lines decided which speed they wanted to run at, not a bad result at our main building. We load-balance two incoming connections over a Sonicwall TZ-170, and they both achieve an acceptable 3-4Mb, with their upstreams set to approx 78Kbps, giving us a total upstream in peak times of 156Kbps, which I’m more than happy with – quite a jump from 54Kbps!

I’ve got one on the lines covering my house on a rangemax router, and the figure above is what I’m getting on a 802.11g connection, I haven’t even upgraded the MBP to n yet, but I’ll be trying it shortly – I don’t expect an increase in speed but owing to leaving the 2.4Ghz band, I am expecting less interference and a more steady connection speed.

XBLA – How hard can it be?

The Scene
Concept stage 1 I’m sitting on the floor admiring the plasma, playing a bit of worms with a friend.

Now this friend has always had a head for crazy ideas. As kids I used to like blowing things up, my friend made a laser and burnt a hole through his door (no small feat. when your 12), it was always about the science. A railgun, a particle accelerator, a bigger laser, an explosive, a gauss rifle, a gas turbine, a new type of spaceship propulsion, all things we have tried (and had varying levels of success with) to build over the years. A bit older (26) and a bit wiser these days, we still chat about building the next ‘great’ project.

Him: Do you remember that game we used to play in school?
Me: On what?
Him: The A3000 (That’s an archimedes for those not in the know)
Me: The game that consumed every lunchtime for 2 years?
Him: That’s the one!
Me: What about it?
Him: That would make a great XBLA title, don’t cha think……..

And so another crazy idea was born. Sometimes (read: often) the simplest ideas are the greatest and has to be the best idea we have come up with yet. Take a childhood favourite of ours and pretty much everyone we every played at it, rip the source from the original (it was public domain), convert it into c#, complile with XNA and deploy to the little white box, now how hard can that be?

Problems

  • I’m a graphic designer / web coder so I now next to nothing about c#
  • My friend is an accomplished artist with a definitive creative flair
  • We have to learn to program, and quickly

It’s a daunting task, as I’m sure you will appreciate, but we all got to start somewhere. I’ve looked in Torque which seems to have a lot of the components I don’t want (don’t know) to write, collision detection, sprite mapping, layers backgrounds and all that, so starting off shouldn’t be to difficult – the thing that worries me the most is writing the physics!

What’s great about this project is an hour after we had started talking about it we already had it planned on paper, I can’t wait. The Macbook Pro will be here soon, so I can jam xna / torque and c# onto it and get my fingers wet.

Macbook Pro

Macbook ProSo it looks as if my 12″ powerbook is about to leave my side, it’s been all over the world with me and the only cosmetic damage is a missing rubber foot and a z key which falls off occasionally, I’ll be sad to see the little girl go. I’m sure it will go to a good home (most likely one of the production team), the agonising decision I had to make is what to replace it with.

I love Apple, I love their products, their aesthetics and their whole brand, but choosing a new laptop has become an increasingly difficult task, with reduced product life cycles and Apple’s renowned secrecy, it’s hard to know when to buy and when to wait. I was just going to plonk down the cash (my company was) and get a Macbook, but then your start thinking about glossy vs matt screen (that’s another debte entirely), reduced ram, integrated graphics – I only really wanted it for a bit of web design, graphic design, coding, print work, network maintainence…. ah, you see the problem, suddenly I realise that I need it for a lot of different tasks. Goodbuy Macbook, hello Macbook Pro.

I went with 2gb of ram and the 160gb HDD upgrade. It’s £350 ($680) extra for the additional 1gb of ram and there was no way I’m going to pay that, 1gb extra (2gb stick) of lappie ram can be brought for £150!!

My only two concerns now are

  • Waiting for it to turn up
  • Reorganising the powerbook with UB applications so the transition goes as smoothly as possible

Although I might just transfer everything over manually, that way I can be sure the laptop will work the way I want it to.

The perfect DVD rip (the simplest) – Part 1

Got a mac? Got some DVD’s? Why not put them on your mac with this handy little guide. This is just one of many ways of ripping and backing up your DVD’s, this is the absolute simplest way of doing it – you’ll need three pieces of software, but you could probably get away with just two of them if you don’t mind using Mac os to burn your discs. So download the following pieces of software:

Mac the Ripper (free)
Dvd2OneX (inexpensive)
Toast Titanium (expensive-ish, although you can do this without toast)

The Problem
Your on a train / plane, in a car and you want to watch your favourite films, but there are a few problems with this.

  • Carrying around a load of DVD so you have some variety, those cases can be bulky
  • Carrying around dics without their cases risks scratching them
  • Playing discs in your laptop drains the battery at a much higher rate

So you rip your discs onto your hard drive and watch a selection of them from here. So stick your DVD into the drive and if it runs close DVD Player. Load up Mac the Ripper (MTR) and let it scan the disc which it will do automatically. You will be presented with the following screen.

Mac the ripper 02

If you click where it says ‘Mode’ you can choose which parts of the disc you would like to rip. If you like watching everything including all those extras then leave it as is with ‘Full Disc Extraction’. You may want to look at the options in the drop down list and select ‘Movie Only’ saving you a bit if space on your hard disk. Click go and choose where to save your disc, wait for the rip to complete and the little bomberman to give you his warning – you’ll see what I mean.

Your done!
Now if all you want to do is watch the film, open up dvd player and click ‘File -> Open DVD Media and navigate to the folder you just created, play! But maybe you want the shrink your DVD rips down a bit to save space or maybe you would like to burn these ‘backups’ onto a disc for safekeeping? There will be another post on this soon!

Subversioned….

What is Subversion?
subversion logoSubversion is an open source revision control system. What does that mean? – I hear you cry, in a nutshell, it means that you can keep a copy of your files with all the changes you made from day one and more importantly bring back any version you previously worked on. Think about a project you’ve been working on (A web site, programming project, database systems etc.), anything which requires a code base. If your the only person working on this project that you should probably stop reading here (although subversion could be useful to you), but if you work with many people on a project one of the biggest problems is making sure everybody is working on the same code and that where subversion makes things really easy. It can keep track of who has what files, what versions (revisions) of those files and make sure that everybody is working with the same code so you avoid destroying each others work – brilliant.

What do I need?
Depends on which way you want to go about it, I’ve tried both the graphical utilities and just plain old simple command line (which I find much easier), this tutorial covers the command line so you’ll only need one thing to start with and that the subversion client:

Subversion Client Download Site

The link above will take you to the packages pages where you can download binaries (compiled source) for the popular operating platforms (Mac, Windows and Linux), this turorial assumes you are using Mac / Linux.

What is a repository
A repository can be thought of like a file store, it’s really just a fancy name for a directory and subset of directories / files on you subversion server.

ACL
The access control list sorts out who can access your repository and what they can or can’t do, put in basics, you can let your users read / write files, deny access to private directories or just configure guest access so that anybody can read / write. A sample acl file looks like:

[YourProject:/]
User1 = rw
User2 = rw
User3 = rw

This would give complete read / write access to 3 users. Guests would not have any access to your repository.

[YourProject:/Hidden]
User1 = rw
User2 =
User3 =

Only user 1 would have access to the directory /Hidden, users 2 and 3 would not have any access. If you put the two files together, all 3 users would have access to the entire project barring the /Hidden directory which only user 1 would be able to edit – clear enough.

Import
So you have a repository, you have your users set up with their own ACL’s, now you need to stick something in your repository to start working with it. Open up your terminal, navigate to the directory that contains the files you want in the repository and tap in the following:

svn import https://location.of.your.server/repos/your.repository

Now that all depends on how your server is setup, you may have it locally on your computer, or within your lan or hosted on a remote server / hosting service. You’ll need to know the location in order to continue.

Once you’ve imported your files, you still can’t start working with subversion until you have what is known as a ‘working copy’. Navigate to where you would like to store your working copy and tap in:

svn co https://location.of.your.server/repos/your.repositry

This will bring the latest version of the files down from the server for the first time and you should get:

At Revision 1

Great! So now you have a working copy and you can start editing your files under version control. All you need to know now is how to update your files, add and delete and check for difference which we will cover below.

Basic Usage
So you’ve edited your files and given your developers / users access to the repository, but how do you put your latest revisions onto the server:

svn commit

Your computer will access the repository and probably ask you to edit the log file to make a note (On my mac this takes me into a VIM session), if you don’t want to add a note just type

:q

If prompted just press ‘c’ to continue with the upload. Your files will then be uploaded into the repository and tagged as a new revision:

At revision 2

Your developers can simply open their terminal and tap in:

svn update

This will update their copies to match your own, so again you are all working from the latest revision. There you go, subversion in a few simple steps. You might want to look up some additional command and command line arguments for svn. You still need to learn about adding / deleting files, and checking the status of your files against the repository. Here’s a clue:

svn status


Copyright © 2004–2009. All rights reserved.

RSS Feed. This blog is proudly powered by Wordpress and uses a modified version of Modern Clix.