Skip to content

Folding Plug

29-Jun-09

Now why didn’t I think of this? I’m sure we have all thought that about something or other. This, is pure genious. The UK plugs are huge compared to the double pin plugs from various countries around the world. Because of this problem a great solution has been created by Mr Min Kyu Choi.

Get elements by class name with javascript

14-May-09

Javascript does not support getting elements by class name; it only allows you to get elements by id. It is very useful having the ability to do this however, such as opening windows on a click when an anchor has an “external” class attached to it. As I don’t use frameworks such as JQuery for [...]

Separating MySQL Username and Host

06-May-09

As the MySQL USER() command returns users as ‘user’@’host’, it can be difficult to do straight comparasons. One way to extract both username and host is by using SUBSTRING_INDEX. For example, in a stored procedure you could use:

– USER
SELECT SUBSTRING_INDEX(USER(), ‘@’, 1) INTO txtUsername;
– HOST
SELECT SUBSTRING_INDEX(USER(), ‘@’, -1) INTO txtHost;

Voila!

Users and Permissions in MySQL

24-Mar-09

The best way for creating users in MySQL is by using CREATE USER or GRANT statements. Another way is by manipulating MySQLs grant tables, but this is not recommended.
By default the superuser is root. A password must be specified for this. It is best if this is only used for superadmin purposes.
For new accounts [...]

Backing up a MySQL Database

24-Mar-09

Using cmd prompt in Windows, navigate to the bin directory where MySQL has been installed. There will be a file called “mysqldump.exe” in that directory. Enter the following command:

mysqldump -u root -ppass –databases your_db > backup.sql

Notice that there is no space between the -p and the password, this is a bug in MySQL.
The backup.sql [...]

Disappointments with the iPhone

10-Mar-09

Don’t get me wrong, the iPhone is a great piece of kit. With all they hype and all the amazing things the phone can do, I was let down by a few basics that I would have taken for granted with even the cheapest of phones. For example ..
You cant send MMS with an iPhone
What? [...]

The Best Firefox Plugins

05-Mar-09

A lot of plugins for firefox are labour and time saving. Some are a godsend. Here is a list of the ones I use a lot.
Firebug
Firebug is a development tool that you use directly in the browser. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page. It is great [...]

XHTML Table

17-Feb-09

Standards based web development and the semantic web call for markup language which matches the stucture and semantic meaning of the data. Screen readers are also an important aspect which need to be catered for. This does not mean that the tables cannot be “beautified” so I have included some CSS for the table.

table
{
border-top:1px solid [...]

Handy Special Characters

17-Feb-09

–
EN dash: –
—
EM dash: —
’
Apostrophe: ’
“
Open double quote: “
”
Close double quote: ”
−
Hyphen: −
‘
Open single quote: ‘
’
Close single quote (Apostrophe): ’
…
Ellipsis: …

Copying One Table Into Another Using MySQL

17-Feb-09

I wanted to copy the contents of an existing table I had which only had certain fields populated.

INSERT INTO new-table (field1, field2)
SELECT distinct original-field1, original-field2
FROM existing-table WHERE original-field1 is not null