November 16, 2008, 14:07
I am currently working on a small project to help me organise my Guild Wars skill builds but I came across a problem, I had nothing to help me decode the templates and I found I had a gap in my knowledge when dealing with converting binary and base 64.
I found some source code long ago from GWFreaks however it was so old, messy and written in VB.NET that I really struggled to understand it. The last resort was a PHP based version of the template parser and a small snippet I found on a Code Guru forum. With this information I begun playing around and eventually began to build a greater understanding of what was involved.
Using the wiki guide on the Skill Template Format and the Equipment Template Format I finally built a set of objects to help encode and decode the templates.
You will find the details and the project files on the Template Parser project page
November 12, 2008, 22:36
Huzzah! I have found a way of being able to run the Unit tests in NetBeans.
Since phpUnit is essentially a set of php scripts itself, I thought to myself there must be a way of invoking it.
What I did was setup a source file as the boostrap for the Test Runner, set this file as NetBeans index file and from there you can just run it and see the test results in the output window or debug and it step into the test you are interested in.
It is not a fantastic solution but it is definately a stop gap until they do implement php Unit testing.
Heres my boostrap file for running tests:
<php
$args = array(
__FILE__,
"--coverage-html",
"D:\\Logaan\\Documents\\XamppData\\htdocs\\FormManager\\CodeCoverage",
"--verbose",
"D:\\Logaan\\Documents\\XamppData\\htdocs\\FormManager\\tests\\TestSuite.php"
);
$_SERVER['argv'] = $args;
$_SERVER['argc'] = count($args);
require_once 'PHPUnit/TextUI/Command.php';
// Exclude this file from code coverage
PHPUnit_Util_Filter::addFileToFilter(__FILE__);
?>
Its very simple, what I am doing is hard coding my arguments into the server environment variable (you could use the arguments in the NetBeans configuration) which is where phpUnit gets the arguments from.
Including the phpUnit TestUI test runner which has the main entry point, excluding this file from code coverage and then I just sit back and l let phpUnit run its course.
This is only a work around until Netbeans supports phpUnit.
November 12, 2008, 18:17
The other day I had hit a brick wall, I was really struggling with part of my FormManager project and really needed to debug it.
I started looking into XDebug and discovered what it could really do, and diving into the website I found they listed a set of compatible IDEs that could use the extension to debug php. Since I had spurned eclipse I thought there was nothing else short of the Zend IDE that could help. Thats when I noticed NetBeans. The last time I had used NetBeans was back in college for some Java projects. I was really surprised when I found out that they offered a PHP IDE.
Within a couple of seconds of getting the project setup in the IDE it found the problem already for me. It does a much better job of context sensitive variables than Eclipse ever did, and it can pick up all kinds of problems much better than Eclipse, within a few minutes I had fixed the problem and even found a couple of problems that I did not yet know about.

It even includes some basic refactoring tools!
NetBeans does support Unit Testing however there is currently no support for phpUnit at this time. It is planned as a feature some point in the future.
November 9, 2008, 17:15
The company I work for packed me off to the PDC last month. This had a load of firsts for me; my first time to America, my first time on a plane.
The plan journey was 11 hours there in cattle class… not particularly enjoyable however I did get the chance to watch lots of movies on the journey that I had wanted to watch for a while. The flight back was less than 10 hours, I think the pilot had is foot planted :P Only there was lots of turbulance, every time nature called, the plane would hit a whole new patch of turbulance. It was very disconcerting.
I think this trip solidified the fact that I am not a travelling person, it took me 4 days to get over the jetlag, the waking up in the early hours of the morning wide awake. To compound the problem the hours were long, I would get up about 6:30am to get on the bus for 7:30. Spend 10 hours in the convention center, then get back to the hotel for an hour before diving off out for the evenings event.
To make things worse, my laptop would not connect to any of the wireless connections available at the convention center so for half the trip I was carrying at least 5kg of dead weight. The only useful job the laptop played was to charge one of my colleagues iPhone as he forgot to bring his mains charger and his laptop bricked itself.
We arrived in LAX late on Continue reading ‘PDC 2008’ »
November 2, 2008, 11:03
NClass is a free open source class diagram modelling editor. It currently supports C# and Java. However recently I have used it to help model some of my php applications. Its quick and easy to use, simple installs, all round good app.
