28c4 ReloadSystems

Resetting MySQL password in Linux

After a clean install of MySQL in Fedora 13 I found myself in the position of being unable to set a root password as one had somehow already been created. The situation of forgetting a password is much more likely, never the less the steps are the same:

Kill the mysql service
[root@host /]# service mysqld stop

Start the service with disabled grant tables
[root@host /]# /usr/bin/mysqld_safe --skip-grant-tables &

Open a SQL command prompt
[root@host /]# mysql

Connect to the DB
mysql> use

Posted at 4pm on 10/26/10 | no comments | Filed Under: Linux, MySQL read on

Avoid Dereferencing in Carmacks Implementation of Approximate Roots

Just about everyone who has even looked into maths optimisation has come across the ‘Quake III Magical Inverse Square Root Implementation’ as used by John Carmack. For those that don’t know it is a 32bit integer magic number implementation of the Newton–Raphson method for finding approximate roots.

The original code from Quake III looks like this:
[code]
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;

Posted at 12pm on 11/08/09 | no comments | Filed Under: Theory and Formulas, C++, 3D read on


0