Thursday, December 25th, 2008
Unit testing is becoming more and more popular in every day web development. I decided to see what all the fuss was about. So here’s a quick tutorial on getting PHPUnit up and running with MAMP on OSX.
First you need to grab a PHPUnit release. You need a command line utility called pear-phpunit to run tests and also the PHP files that make up the framework. I recommend first doing an svn export somewhere to get the command line script and then doing another export to just export the framework library.
MAMP’s default include path is /Applications/MAMP/bin/php5/lib/php and the Pear installation is there already so that’s where you should install PHPUnit. So, let’s start by grabbing the PHPUnit Framework:
$ cd /Applications/MAMP/bin/php5/lib/php
$ svn export svn://svn.phpunit.de/phpunit/phpunit/branches/release/3.3/PHPUnit
# ...
# Exported revision 4387.
Read the rest of this entry »
Amnesty International’s Protect the Human campaign centers on standing up for humanity and human rights in general. The US version of the site is a full-flash, animated experience including a google map mash-up where users can post video, text, photos and other data promoting human rights related events and activities.
The site is built primarily in Flash with the Flex and Google Maps SDKs being utilized to develop a custom map solution and ASRA to push data to the Flash/Flex apps. Zend Framework was utilized to develop a small content management system where admins can remove flagged posts. Users can search/toggle map posts and click the map to add their own post in the form of links to images and youtube video.
Saturday, December 20th, 2008
My new mini “studio” at the house is now fully set up. Added some shelving for speakers and quick computer access. Sealed myself in and threw down the last mix of the year. 2008 was an amazing year for drum and bass!
Read the rest of this entry »
Wednesday, December 10th, 2008
If you have a class that you use all the time, you know that it can sometimes be a pain to type or copy and paste the import statement for every class that you use it in. Plus its name and methods might be a pain to type every time you use it.
Case in point: I have a class called Logger (com.bkwld.utils.Logger) which does recursive object logging among other things (with pretty trace output of object trees and what-not). Having to do import com.bkwld.utils.Logger; and then Logger.log("hello, world"); every time can be a pain. Here’s where top-level functions come in. You use them all the time - think trace, unescape, and all the type conversion functions. Here’s how to make one:
Start by creating a file in your class path root. In the Logger case above, I would create a file called log.as in the same directory that the com folder was in (Classes is my class-path root):
/Classes
/com
/bkwld
log.as
The name of the file should be the same as the function you wish to create. Here’s my log.as source:
package {
import com.bkwld.utils.Logger;
public function log(...args):void {
Logger.log.apply(null, args);
}
}
You can see there is no class definition, just the function. I imported the class i want to use and then called the method I wanted to use. Since this is in an “empty” package at the top level, all classes in the same path have access to it without having to import it. So, now I can just write:
// -- used to be Logger.log("Hello, world");
log("Hello, world");
Wednesday, November 19th, 2008
It’s been a long time since I did a house mix so I’ve been saving up tracks for quite some time. This mix is loosely based on a 3 hour live set I did at a BKWLD party a few months ago. The album art illustration is by New York artist and illustrator Sandra Chi. She recently started a blog and a big cartel store. Tracklist after the jump.
Intoxicated With Love - Sandra(w) Chi
Read the rest of this entry »