Web Programming

Wohoo, MySQL 4!

Oliver Brown
— This upcoming video may not be available to view yet.

Not that it really makes much difference yet, I’m now running MySQL 4!

The upgrade was easier than I expected with the only problem not strictly being an upgrade problem (I had to manually kill MySQL and restart it to get it to recreate my socket file). This is all preparation for installing PHP5 so everyone can actually see Galaxia Reborn.

Odd PHP problem

Oliver Brown
— This upcoming video may not be available to view yet.

The following produces an error:


function hex2rgb($hex)
{
    for($i=0; $i<3; $i++)
    {
        $temp = substr($hex,2*$i,2);
        $rgb[$i] = 16 * hexdec(substr($temp,0,1)) + hexdec(substr($temp,1,1));
    }
    return $rgb;
}

function hex2rgb($hex)
{
    for($i=0; $i<3; $i++)
    {
        $temp = substr($hex,2*$i,2);
        $rgb[$i] = 16 * hexdec(substr($temp,0,1)) + hexdec(substr($temp,1,1));
    }
    return $rgb;
}

But not the error you might expect. PHP doesn’t even get to complain about redeclaring a function with the same name since the second function is full of parse errors.

I have a vague idea what the problem is but I’m not sure. Any takers? :P

Sorry about the dodgy display…

I quite like JavaScript

Oliver Brown
— This upcoming video may not be available to view yet.

For a long time I hated JavaScript. I think I’m beginning to like it now. The following works perfectly in Firefox and works slightly less well in IE6. http://brownab1.miniserver.com/reborn/demo.php.

To use just click and drag. Or in IE6 press the button, drag then press again.

Objects

Oliver Brown
— This upcoming video may not be available to view yet.

Almost everything in Galaxia is an object. In hindsight this was a bad choice of name (from a programming standpoint I have objects of type Object), but I’m basically stuck with it. And I still can’t think of a better name.

The most interesting type of objects in the game will be vessels. The reason I chose vessel over ship is because not all vessels will actually be ships. Space stations for instance will be vessels that don’t have engines.

Vessels will have components and the components will add most of the functionality. I can’t tell you exactly what these will be or how they will work since this is the next big feature I need to implement. But basically, each component will allow a vessel to be given certain orders. For example engines allows a vessel to move somewhere, guns allow it to fire on other vessels.

The exact makeup of each vessel can be chosen when you build it. This also answers a question that has been causing me problems ever since the original Galaxia: “Why build multiple shipyards?” Well building some of the more exotic components will require some extra facility (Widget Factory for instance) therefore it would be better not to build one with every shipyard (you won’t have room anyway).

Silly .htaccess

Oliver Brown
— This upcoming video may not be available to view yet.

Wordpress seemed to be not updating my .htaccess properly but not telling me. Which is why none of the permalinks work. It’s funny, I was about to comment that none of the new visitors to XHTML Friends had made their way over here. Of course they probably did and just couldn’t comment…

Thanks to Ryan for pointing out the complete failure of all the internal links on the site…

Should Galaxia use Ajax?

Oliver Brown
— This upcoming video may not be available to view yet.

I used JavaScript once succesfully and it goes to my head…

I read a book on doing XML stuff with JavaScript and thought “Very clever. But Why?”. Well apparently it’s taking off. It’s how Google Maps works.

And if you didn’t know (I didn’t; reading blogs is actually helping me) Ajax stands for Asynchronous Javascript and XML.

It would mean you’d just drag the map to scroll in Galaxia… :D

In hindsight. No. Too much effort and too many other things I need to do…

XHTML Friends

Oliver Brown
— This upcoming video may not be available to view yet.

Wohoo! I’ve just “finished” the XFN site. Go take a look :) XHTML Friends

What they want me to do...

Oliver Brown
— This upcoming video may not be available to view yet.

I finally have to actually write some software for the IVDA technical committee. And get it done for Tuesday.

They need a nice web based app that will go through all the photos in a folder, let the user crop the photo to a specific aspect ratio and then move the photo into another folder depending on whether it is portrait or landscape.

Then they need another app that goes through all the photos and lets you assign a number (the couple number) to them. And for ones that don’t have a number it needs to read an XML file to get the list of all couples on the floor at the time and then display picutres of those that we have pictures for, so you can guess who it is.

The practical upshot of which is that everyone will be able to see the results at the IVDC.

On the subject the IVDC, they want me to get in as soon as I get there to helplay their network cables. And then arrive the following morning to help set up. And after all that I have to dance too!!