Category: Programming

Div, IFrame, Form: the CSS version of Scissor, Paper, Stone

Div, IFrame, Form: the CSS version of Scissor, Paper, Stone

An interesting browser (mostly, it has to be said, Internet Explorer) rendering issue has produced an slightly odd workaround. The problem arises from the rendering of form elements, specifically dropdowns, by the browser. These are registered as windows components and hence are rendered somewhat outside of the other HTML elements. (This is not true in …

+ Read More

JavaScript as a ‘real’ language

JavaScript as a ‘real’ language

I’ve just come across these pages about JavaScript that I found very interesting. The examples of private variables and inheritance are quite an eye-opener for someone like me who’s been writing away in JavaScript and DHTML for a few years now.

Class type hinting in PHP 5

Class type hinting in PHP 5

PHP 5’s OO structure is way ahead of PHP 4 and has so many ‘proper’ object oriented concepts built into it that writing well-structured code is much easier than ever. The problem that PHP faces (and may always face) is that being a loosely-typed language (click here for an explanation of the differences between PHP …

+ Read More

JavaScript Haiku

JavaScript Haiku

There are a few sites on the web which will generate haiku’s using a set of code rules. I think I can lay claim to have written what could be the world’s first (and only) haiku actually in JavaScript. I’m quite interested in the idea of code being poetry, but just generally not interested enough …

+ Read More

Microsoft ISV programme

Microsoft ISV programme

Microsoft have recently launched a new programmed for Independent Software Vendors. Basically, as long as you’re commited to developing a saleable Microsoft product over the next two years then you get an excellent deal on an MSDN subscription. It’s similar to the Action Pack, so there are licensing restrictions on the software, but still a …

+ Read More

Monty Hall problem and simulation

Monty Hall problem and simulation

There’s been a bit of a debate on the forum at Freelancers.net about the Monty Hall problem. The crux of the problem is: There are three doors. Behind one is a car, behind the other two a goat. The contestant picks a door. One of the other doors is opened to reveal a goat. The …

+ Read More

TRUNCATE TABLE on MySQL InnoDB databases

TRUNCATE TABLE on MySQL InnoDB databases

Having come up against the extremely poor performance of using TRUNCATE instead of DELETE on MySQL InnoDB tables (see previous post MySQL Truncate slow performance problems) I thought I better come up with a solution that didn’t mean leaving a table to clear for an hour. The solution is to use a combination of SHOW …

+ Read More

Multiple SQL queries using MySQL and PHP

Multiple SQL queries using MySQL and PHP

Something that I’ve had problems with using MySQL/PHP is the limitation of only being able to run one line of SQL at a time. Using something such as Microsoft SQL Server it’s possible to write multiple lines of SQL and run it all in a single database call. Until stored procedures (in MySQL 5) are …

+ Read More

Optimising MySQL a query with packed keys

Optimising MySQL a query with packed keys

I’ve been learning more about MySQL lately and particularly optimising SQL queries on large tables. Large, in this case, being at the moment hundreds of thousands of rows but soon to be millions. One of the problems I’ve had is that MySQL sometimes decides not to use an index even when a handy one seems …

+ Read More