Archive for the 'Coding' Category

SQL_CALC_FOUND_ROWS - Is it faster?

Reading through a post on SQL_CALC_FOUND_ROWS actually being slower that running one query followed by a count query I decided I needed to do a little benchmarking on my own.

addthis_url = ‘http%3A%2F%2Fforumsblogswikis.com%2F2008%2F06%2F12%2Fsql_calc_found_rows-is-it-faster%2F’;
addthis_title = ‘SQL_CALC_FOUND_ROWS+-+Is+it+faster%3F’;
addthis_pub = ‘RyanNutt’;

JSDoc - Docmentation for JavaScript files

I’ve finally dragged myself, kicking and screaming, into using phpDoc on my PHP files to keep my sanity. But I’ve always been very sparse on my JavaScript documentation. I’ve got what I thought was a good excuse though - those comments have to be downloaded to the visitors machine meaning more time before [...]

Generating element IDs with JavaScript and counters

The code that I posted in my previous post on creating a unique ID in JavaScript is fairly similar to code that’s all over the internet and seemed like it should work. And to be fair, it did work, although with one major problem. If the code runs too quickly it’s possible for [...]

How to generate a unique id in JavaScript

PHP makes it pretty easy to generate a unique it with the uniqid() command. JavaScript doesn’t have that command, but using the getTime() function of the Date object we can do almost the same thing.
PLAIN TEXT
JavaScript:

function uniqid()

    {

    var newDate = new Date;

    return newDate.getTime();

    }

The function returns [...]

XML Parsing Error: junk after document element

Since I had to go through about 20 pages to find the cause of this error, I figured I’d throw up one more with the cause that I found. Hopefully it’ll help somebody spend less time debugging the problem than I had to spend.
I’ve got a PHP script outputting XML that’s called from an [...]