Random Hex

I needed some PHP code to randomly generate me a hex value for use as a color in a webpage. Here’s what I came up with (WARNING: Some colors are UGLY!)

function random_hex() {
	$color = '';
	for ($c = 0; $c < 6; $c++) {
		$i = rand(0, 15);
		switch ($i) {
			case 10 :
				$i = 'A';
				break;
			case 11 :
				$i = 'B';
				break;
			case 12 :
				$i = 'C';
				break;
			case 13 :
				$i = 'D';
				break;
			case 14 :
				$i = 'E';
				break;
			case 15 :
				$i = 'F';
				break;
			default :
				$i = $i;
				break;
		}
		$color .= $i;
	}
	$color = '#' . $color;
	return $color;
}

Flickr Playing Along

Those crazy kids over at Flickr are playing along with all the gossip going around about them being bought out – check out the logo that they have up as of right now. Even better – the file is called ‘gossipgossipgossip.gif’ – I love it!

Comments Disabled

Well, I’ve had enough of dealing with blog-comment-spam for now, so I’ve decided to disable comments until I can come up with a satisfactory solution. I have 123 blog posts that I’m going to have go through by hand – AGAIN – to remove spam from. I don’t have time for this, but I refuse to be a PageRank monkey for these losers by leaving their links up and accessible on my site.

It really saddens me to have to do this, and I think it reflects very poorly on the current state of the internet. Damn the idiots who are blog-comment-spamming, damn them to hell and back. People like you are making the internet a worse place to be. We’d all be much happier if you would go away and die in a hole somewhere.

XooMLe Download Finally Available!

After a very long wait, a downloadable version of XooMLe is now available!

This means that you can now download XooMLe and install it on your own PHP-enabled server so that you can use it locally for integrating Google search results (and cache and spelling suggestion power) into your web-based applications.

In the near future, a ‘XooMLe In Action’ page will also be added to the site, showcasing some of the ways that people are making use of XooMLe and Google.

Namespace Modification

I’ve modified the namespace being used by XooMLe because it was conflicting with some XSLs and making them not work. The top-level namespace now looks like this;

xmlns:xoomle="https://beaulebens.com/xoomle/docs/"

Please let me know if this causes any problems for anyone.