November 12, 2009
While it would be nice have my own fancy server, a private server, or a private vm, I really don’t need it. I’ve always opted for shared hosting, because anything else seems like overkill. I currently have a shared plan with Dreamhost and they have served me quite well and meet all my needs. Recently though, while working with another hosting company, I realized there were some things missing that have become absolutely critical to my workflow. So here is my list of bare-minimum requirements for hosting:
-
LAMP
Linux, Apache, MySql and Php. No Windows please. Not because Windows sucks, but because Windows has no shell access. Cli’s for mysql and php are a plus.
-
Shell access
For me, there is no better way to work than through ssh and scp. Working through ftp is balls. Also required is easy-to-set-up shell access. Let me check a box on a control panel somewhere and wait at the most 10 minutes. Please do not make me enter my phone number, wait for a call, get a confirmation code from the call, enter the code somewhere in the control panel, and then wait 72 hours for my shell access to be “activated”.
-
Source control
Binaries. At least Subversion. Git would be ok too. Repo hosting is a plus.
-
Vim
The ultimate editor.
-
Other binaries
Curl and/or wget. Ant would be nice too. Xmllint and tidy.
June 26, 2009
I love E4X in AS3. It's powerful and fairly simple. If you haven't worked with it yet, check out Roger Braunstein's excellent tutorial. But I was recently annoyed by this gotcha when doing some xml combining. Let's say you have this:
XML:
-
<xml>
-
<people>
-
<person id="123">
-
<name>John</name>
-
</person>
-
<person>
-
<name>David</name>
-
</person>
-
</people>
-
</xml>
Let's parse with E4X:
Actionscript:
-
// #1
-
trace( xml.people.person.length() );
-
// 2
-
-
// #2
-
// no animals, but e4x still returns an XMLList
-
trace( xml.people.animal.length() );
-
// 0
-
-
// #3
-
// no animals, so no further children, but still returns XMList
-
trace( xml.people.animal.fur.color.length() );
-
// 0
-
-
// #4
-
// gotcha
-
trace( xml.people.person.( "123" == @id ) );
-
// thows: ReferenceError: Error #1065: Variable @id is not defined.
The first 3 examples work great. Even though there are no <animal> nodes, E4X still returns an XMLList. Even looking for more siblings under nodes that don't exist works great - it always returns an empty (but valid) XMLList. Always returning an XMLList makes it easy to work with because you can always for-each over the result.
What I don't understand is the 4th example. It fails because not every <person> node has an id attribute. But so what? If you look at the 2nd and 3rd examples, not every <people> node has an <animal> node. So why don't we get the same result - an empty XMLList?
Turns out that there is an easy solution/work-around, that Roger mentions in his tutorial:
Actionscript:
-
// will error if every person node does not have an id attribute
-
trace( xml.people.person.( "123" == @id ) );
-
-
// use this
-
trace( xml.people.person.( attribute( "id" ) == "123" ).length() );
-
// 1
A bit wtf, but at least it works like the other examples.
April 27, 2009

Yahoo! invasion
Is that a Yahoo! ad in a Youtube player? No. It's a Yahoo! logo in a Youtube player. How did it get there? Via Flash's secret javascript api!
Ok, so it's not really secret. More like old, surely deprecated, and forgotten. I've been working with flash for a good while now, and I had no idea this existed until my friend Robert Ames stumbled upon it.
What's cool (or not cool) about this api, is that it's part of the Flash plugin itself and has nothing to do with Actionscript. All you have to do to enable this api is... well... embed a swf. Try going to a youtube video page like this one, and then entering this in the address bar:
JavaScript:
-
javascript: document.getElementById( "movie_player" ).LoadMovie( 98, "http://l.yimg.com/a/i/ww/beta/y3.gif" );
I want to play around with this a bit more... I wouldn't be surprised if some of these API methods bypassed some of the Flash Player's security restrictions.
April 22, 2009
It's almost done. I just have to cut the trim and do some caulking and touch up painting. A couple more photos are in the full set.

My new vanity.