john's blog

How To Section

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.

SWFObject, YouTubeAPI Chromeless Player and "Error calling method on NPObject!"

I am using SWFObject to embed and control YouTube videos using the YouTube API. I'm putting the videos in a lightboxed player and need to explicitly tell the movie to stop when the lightbox is closed. Mostly...this works great. But I had to crawl around into the nooks and crannies of what works and doesn't work (i.e., try this...fail, try this...fail, etc.) before settling on a less than ideal solution.

How To Section

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.

How To Section

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.

How To Section

“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

Drupal Views Module and XHTML valid links

This isn't the first time that the Views Module has spit out invalid code. It's not a huge issue, but I've seen Views spit out div blocks without a close tag, just causing me all kinds of headaches in IE.

Why your website should support Internet Explorer 6

I mean, who uses Internet Explorer 6 (IE6) anyway?

Well according to this wikipedia article...about 17% of us. Clearly a significant share of the market.

Alfresco on Mac

So I'm considering an Alfresco installation for a client to be hosted on an XServe Mac OS X Server. Alfresco seems like a viable open source replacement for Sharepoint. And I'd like to believe that, but I'm currently having troubles with the install on my local machine. So I'm going to log my attempt at solving this problem for future posterity.

Apache in 32 bit vs. 64 bit mode and Zend Debugger on Mac OS X

While trying to do some ahah uploading for a 5.x Drupal module I'm porting to core 6.x, I discovered some problems with my local 32-bit apache setup on my Mac OS 10.5 development machine.

Ad hoc Drupal node creation

This is how one creates a node in code:
http://drupal.org/node/60479#comment-114666