Archive for November, 2011

Calculations To Scale An Image

Calculations To Scale An Image

Posted on: November 9th, 2011 by deanpugh

A couple of times I have had to deal with images in my code. Recently I had a project that needed the user to upload an image, which then needed to be scaled down to fit an area. Below I detail the calculations that I used. For this demonstration we will be using an image […]

Pre Check Form Before Submit

Pre Check Form Before Submit

Posted on: November 8th, 2011 by deanpugh

Below is a script to allow you to run a precheck function in Javascript, preventing the form from submitting if you detect a problem. First, in a separate, external Javascript file, copy the below script: The above code is checking a checkbox value in the sent form to see if it has been selected. If it has, then […]

Domain Name Wars

Domain Name Wars

Posted on: November 7th, 2011 by deanpugh

A interesting article recently appeared on the BBC Website recently which I thought was rather interesting. It details a few occasions when the ownership of domain names are disputed in the UK by Nominet. I must point out that this article isn’t about when someone has been accused of stealing a domain name. It’s when […]

Select a Range in MS SQL

Select a Range in MS SQL

Posted on: November 4th, 2011 by deanpugh

Selecting a range from a table is easy in MYSQL. Say you want to bring back results that you are paginating. Bringing back thousands of results is inefficient and needless. MS SQL there isn’t a simple way of doing this. The best way I have found, or my colleague Daniel has found, is to wrap […]

Quick SQL Copy Table

Quick SQL Copy Table

Posted on: November 3rd, 2011 by deanpugh

Just a quick SQL tip that I have been using recently, and is aimed mainly at MS SQL, but I cant see any reason why this wouldn’t work on MY SQL, except for the fact the MY SQL has easier Backup facilities. The background for this is that I was making changes to a table, […]

SQL Custom Order

SQL Custom Order

Posted on: November 2nd, 2011 by deanpugh

I recently had a problem while creating a list of players for a project. I needed to list them in a certain order based on their position. I knew there were only 4 possible positions, but wanted them returned in the order of GK, DEF, MID and STK. I managed to find two ways of […]