PHP

v6 MSN Adcenter for PHP

Mike Taggart of Envoy Media Group and I have collaborated on a new little project to build an easy to use PHP library for MSN AdCenter (v6). Handles Ads, AdGroups, Campaigns and Keywords, here.

Mish(S?)Mash

MishMashSMash is my ambitious new OSS opensocial container for housing individuals own personal, arbitrary and portable online datastores, where they can build personal or social data feeds amongst ‘friends’ with a finer grain of access control than is generally offered by seed funded social networks. Think Yahoo! Pipes, but for ‘local’ feeds you create yourself (like your record collection, favourite OMGLOLCatzHAHAOHDAD! or whatever), or with friends (a collection of my mates french jungle records circa 2003-2005 who live in Brisbane). Clear as mud?

The project has just been started and is available on github here (feel free to fork), with an ongoing developer blog here relating to opensocial standards, LOD/RDF(s) + semantic web, online privacy, interoperability, the irony of building a possibly monetising system to avoid vendor lockin and every one of my tedious technical discoveries. It’d be nice if this talked building AR/Layar services as well.

Tech is PHP/CodeIgniter for a quick backend prototype + some serious client side behaviour using Mootools + Gears (offline mode) + Cassandra cluster for elasticity with *minimal* server-side application logic. So much to chew! lucky these meats are truly delicious.

HipHop PHP, the day has arrived

HipHop PHP has been a rumored Facebook project for a few months now, finally it’s arrived.

“HipHop transforms your PHP source code into highly optimized C++ and then compiles it with g++ to build binary files. You keep coding in simpler PHP, then HipHop executes your source code in a semantically equivalent manner and sacrifices some rarely used features – such as eval() – in exchange for improved performance.” (more info, repo).

It looks neat (in a Google GWT kind of way), keen to see how it plays with opcode caches, xdebug, shared memory stuff etc. and whether it makes pcntl_fork() actually useful (no eval(); so chances are slim). Facebook has very different requirements to the rest of us and an already highly optimised code base, so HipHop may be filling a very specific niche. Hopefully developers won’t use it as a bandaid to actual performance profiling, or expect it to solve their I/O issues. fingers crossed :p

Form Validation with PHP + jQuery

Form validation tutorials – done to death right? As a player for Team Redundancy, I’ve built one for the Pandra library (PandraValidator class) which performs server side validation with the help of jQuery. Both client and server side uses the same validation function, and the good thing is – it’s really fast. It ticks a few security boxes also (referrer checking, a honeypot field, POST timer, GET > POST method enforce) and may be a good conceptual guide for building your own.

Source is here, enjoy.

Writing a simple Cassandra CRUD class in PHP with ThriftInterface

NOSQL – so hot right now. As part of my own learning curve, I’m building a simple abstract and schema-less Factory Patterned CRUD class for Cassandra, and shoe-horning it in with Apache Thrift.  There’s a very thorough blog by Evan Weaver to help dealing with the RDBMS to Cassandra conceptual jump. If you haven’t dealt with Cassandra before, it may be a good place to start. For a very decent cluster setup example, check here, and for Thrift just grab the source and follow the instructions I guess, but if you’re using debian/ubuntu I’ve written a quick install guide.

Dubbed Pandra, it will be maintained via github. Requires PHP 5.2, Cassandra 0.4, and latest Thrift Interface.

for fun, Euler Solution 11 (PHP)

A bit bored so knocked up a solution to this Project Euler problem :

11: What is the greatest product of four numbers on the same straight line in the 20 by 20 grid?
More >