How To Section

How To

Ways to do things (simple or hard) that have been collected along the way

Language Codes: BCP47, IETF, IS0 639.2 and ISO 3166-1

I always seem to have to look this stuff up, so I'm putting it here to re-reference and share:

BCP47 is the "Best Current Practice" for encoding languages as defined by the IETF. It incorporates two standards: IS0 639.2 for the language part of the code, and ISO 3166-1 for the region, e.g., en-US is english as used in the US.

Get ISO 639.2 codes here.

Audio VU Meter in Flash AS3

I play music and have recorded a CD. I'm making a website:
man number 7

I created a simple music player and have decided that I want to add VU meter-like behavior to animate other elements on the site.

So I broke out my handy dandy interweb and found this little chestnut:
Waveform Reading in Flash

I have yet to implement it but can't wait to see how well it works.

Internet Explorer doesn't support getElementsByClassName

Internet Explorer doesn't support the javascript function getElementsByClassName. Not a big deal if you're using a javascript library like jQuery or MooTools. But it's not a good reason to include a library for just one function. So we've got to improvise.

First I check to see if I can use an id instead of a class. In this case I can't because I need to process a series of elements the same way.

“Can’t connect to local MySQL server through socket” on Mac OS X Leopard

I keep having to do this and I'm writing this here so that I remember how to fix it:

PHP is trying to connect through /tmp/mysql.sock by the /etc/my.cnf file is pointing to /var/mysql/mysql.sock.

So I just put a symlink in tmp to redirect the connection:
ln -s /var/mysql/mysql.sock /tmp/mysql.sock