Automagic Prefixes for Model Fields

Posted by Sean on Jun 23, 2009 under

Say we have a player model, and every field in playerstable is prepended with player_. For example, player_username, player_email, etc.

I'm personally not used to this database design, but I know plenty of people use it. When I work on projects that have this, I'm not particularly found of having to write:


$p = new Player;
echo $p->player_username;

I'd rather ditch the prepended part in all my PHP code.

echo $p->username;

Copy Objects and Arrays with $unlink

Posted by Sean on Jun 17, 2009 under

Basically, if you don't know what happens when you have multiple variables pointing to the same Object or Array, then check out this quick and dirty article and read the first half or so. Or if you don't want to bother, I'll give you a snippet to paste into Firebug.


var a = ['one','b',3,false];
var b = a;
a[1] = 'BEEEE';
console.log(b[1]);

With web standards being all the rage, and accessibility being a major driving factor in people adopting standards, you might be surprised to actually check out the accessibility of web-sites.  After watching a video of a blind user using Jaws , I figured to give using a screen reader a try just to see if I could understand it any better.  I ran into a couple problematic areas; what caught my attention first was the use of forms .