gms8994’s benchmark at master – GitHub

Yazan: dp | 11 January 2010 | Comments
Categories: Uncategorized

I’ve recently been posting my benchmark scripts to github.  You can find them here: gms8994’s benchmark at master – GitHub.  I’ve also started posting the results within the wiki, each page with the same name as the script.  For example: comparing MySQL inserts with one set of values, or multiple sets of values.

Codeblocked: An Adventure in Slow Code

Yazan: dp | 16 December 2009 | Comments
Categories: Uncategorized

It’s amazing how much content a company can add in a year, especially when that company writes articles for it’s living. A year and a half ago, I wrote this code against Sphinx:
$cl = new SphinxClient ();
$res = $cl->Query ( $q, $index );
foreach ( $res["matches"] as $docinfo ) {
$excerpt = [...]

Cleaning up bad data in an SQL database

Yazan: dp | 02 June 2009 | Comments
Categories: Uncategorized

Recently, I needed to find all of the data in a table that was being used for HTML output, that had non-printable characters. The following SQL statement should do that for you:
select id, name
from table_name
where name not regexp ‘^[a-zA-Z0-9_ ,&;\/<>(²):%*#?$|!+.\"\'-]+$;
This code is MySQL specific, but should be applicable anywhere, really.