Archive for August, 2005

My Cat

Because “Weblogs are things with cat pictures in them.”

Cat

Advertising in games

So ja, it’s been reported that the games SWAT 4 (via the latest patch) and the latest Splinter Cell games both have ‘live’ advertising, which download as you play and display stuff, basically no better than banners, on posters, vending machines, billboards, etc. within the games.

Both of these games seem to have been ‘enhanced’ by what seems to be a recently launched ’service’, Massive Incorporated, specifically set up to place advertising within games.

Personally, I have a few problems with this. Firstly, I’ve already payed around R400 for my game. Now as I see it, things like advertising are usuallly used to subsidise either free services (eg: banner ads on many websites), or relatively cheap services (eg: ads on TV and radio). Now why the hell do publishers feel the need to milk even MORE money beyond the R400 a copy they are selling?

Secondly, there is NO opt-out. If you want to play the R400 game you just bought, you have to agree with the fact that you will be downloading these ads and wasting bandwidth on every map/level change, that they will be defacing your game, and you will be sending the advertisers ‘usage statistics’ - how long you looked at each ad, what angle you looked at it from, how far away you were from it, etc. As I read elsewhere (forgotten the URL at the moment), it’s pretty scary that this is the ‘first generation’ of this technology - I can only imagine the kinds of things they’ll track about your playing habbits in the future.

And finally, it’s just plain intrusive. I like seeing often humerous made-up posters where they’re needed - which is normally seldom in most games. I don’t want to see darn Coke ads in my games. Also, I’m sure publishers and advertisers will start pushing developers to include even more and more advertising billboards/posters/vending machines/etc in their levels, until one day you’re sneaking/running/driving/strolling/handing/rolling around some kind of psycho colourful flashing whacked hall of nothing but lame-ass banners and shit. Piss off with that stuff, please.

Aaaanyway, you may have guessed this idea doesn’t appeal to me at all. Unfortunately once the trend is started and the standards are set by a few games, things will only go downhill.

What’s also scary is that both SWAT and Splinter Cell are Unreal engine games :(. At the moment though, neither Epic or Midway have signed on with Massive Inc. it seems.

Quick Firefox thingey

I only noticed this rather recently.. But you can set up Firefox’s ‘Homepage’ option to open multiple tabs when you open the browser.

Just enter the URLs you want to open by default, seperated by the pipe (’|') character. The same effect can be achieved by opening all the tabs you want, then use the ‘Use Current Page(s)’ button.

So you can now open Google and 200 random websites you probably won’t even look at anyway! Personally, it irritated the hell out of me, but maybe someone would find it useful…

Gregarius RSS Aggregator

Thanks to a link mithrandi posted in IRC, I’ve discovered this rather useful tool.

Gregarius is a web-based RSS/RDF/ATOM feed aggregator (oops, I didn’t copy/paste that from their homepage :P) which you can install on your own server, and manage as you like.

Setup was a breeze, I just checked out the latest version from their Subversion repo, copied the files over to /var/www, and created a MySQL database. First visit to your Gregarius URL prompts for database access settings, and creates the tables and everything for you.

It has an extremely clean interface, I suspect in fact that it’s highly influenced by WordPress (their “devlog” using WordPress further convinces me), but that’s beside the point. It’s extremely easy to manage categories, add feeds (it automatically fetches a “favicon.ico” file if one’s available as well), etc. I got my whole installation and 10 feeds all setup within around 10 minutes.

It presents the feed items nicely enough, sorted by date, with links to the full versions, as well as descriptions/summaries. It also keeps track of items’s you’ve left unread, making it easy to come back to them later. Another helpful feature is the ability to search within the feeds it’s downloaded and stored, allowing you to pull up any item at any time, I’ve already found this quite useful.

All-in-all, a pretty great little package. It sure beats Thunderbird’s RSS reader hands down. If you subscribe to any feeds, have the ability to host it (just PHP and MySQL required), and 10 minutes to set it up, throw away your existing RSS readers and get your own Gregarius aggregaror up and running :).

Dump an array of data to CSV with PHP

Ok, so this is such an insanely simple thing to do. I once tried looking for a PHP class or package which could write Excel .xls files from data in an array. Well, I found a really ugly class which simply saved a .csv file as .xls. Anyway, I ended up writing my own 4-line function for that:

function arrayToCSV($data)
{
	$csv = implode(',', array_keys($data[0])) . '\r\n';
	for ($i = 0; $i < count($data); $i++)
		$csv .= implode(',', $data[$i]) . '\r\n';
	return $csv;
}

You’ll have to do your own validation for empty arrays and things elsewhere. It returns a string with each record from the array on it’s own line, seperated by commas. $data is expected in a format something like this:

$data[] = array('name' => 'Bob', 'age' => 12);
$data[] = array('name' => 'Jack', 'age' => 15);

Which looks something like this: print_r($data):

Array
(
    [0] => Array
        (
            [name] => Bob
            [age] => 12
        )
    [1] => Array
        (
            [name] => Jack
            [age] => 15
        )
)

If you’re using ADODB, you can use this little function to convert the recordset to a suitable array (there are some built-in functions to convery recordsets to arrays, but they all end up giving you pretty useless data).

function rsToArray($rs)
{
	$arr = array();
	while (!$rs->EOF)
	{
		$arr[] = $rs->GetRowAssoc(False);
		$rs->MoveNext();
	}
	return $arr;
}