Archive for October, 2008

Oh my god, PHP.

Wednesday, October 29th, 2008

For reasons I don’t understand, this does not work (ReflectionException ‘Class Foo does not have a property named prop’):

class Foo
{
protected static $prop = ‘My value’;
}

$ref = new ReflectionClass(’Foo’);
$prop = $ref->getStaticPropertyValue(’prop’);

However, this does:

$ref = new ReflectionClass(’Foo’);
$props = $ref->getStaticProperties();
$prop = $props['prop'];

This does not work; PHP cannot dereference array return values:

$props = $ref->getStaticProperties()['prop'];

This does [...]

Why Emacs is the only editor I can use

Tuesday, October 28th, 2008

Alex Payne – who I sincerely hope does not become a regular foil – agonizes about Mac users using “old text editors.” Phil Hagelberg responds.
My 2¢: What I demand in an editor, in rough order of necessity, is:

Syntax highlighting for a wide variety of programming languages and file formats.
Tight integration with source code management, preferably [...]

Enhancing Emacs’ SQL Mode

Sunday, October 19th, 2008

I use sql-mode a lot. It’s incredibly handy to have my abbrevs and Emacs bindings available when I’m interacting with SQL servers. But there’s always room for improvement, so I’ve identified a few areas where sql-mode could work a bit better, and fixed them.
Better Buffer Naming
I found this code somwhere a while back, and threw [...]

Apple’s new laptops: Ugly, unusable crap

Tuesday, October 14th, 2008

I’m sure you couldn’t tell, but I’m not happy about Apple’s announcements today.
They’re Ugly
Really. These things just look bad. I hated the nasty black bezel on the aluminum iMac, and I hate it on these. It hasn’t grown on me. They’re plain ugly, eschewing clean minimalism for a terrible retro throwback design. I mean, we’ve [...]

Remote iTunes Sharing

Thursday, October 9th, 2008

I keep most of my media - music and photos - on a 250gb external WDC Passport drive. I usually bring it with me when I come in to the office, but I forgot it today. Whoops. So I set about figuring out how to access it remotely.
The Ingredients
iTunes needs two things to access shared [...]