Tag Cloud

Of the growing number of 2.0 related stuff that is appear now-a-days, the tag clouds is an interesting one in that takes a standard list and tranforms it into other visual depictions.

I decide to have go at generating a simple cloud tag, I all ready had a list of news categories and the number of post in each one so I thought it wouldn’t be a step too far.
After quick Google to determine the best methods of displying the information, I decide that i would use a simple font size alteration based on the count of the category.

First tasks to decide on the number of levels I want to have in my cloud. I decided on 3 as this would allow enough differences for the total number I was dealing with.

So now we needed to split out the levels so when needed the highest possible count for 1 category and to divide by the number of levels we are using, this will give us the range of each level.

highest_category_total/number_of_levels = range

Now using the same information that we see in a standard list:
Topic1 = 3
Topic2 = 15
Topic3 = 8

Using a simple section of code to determine the level that each category falls into.

This example shows how it works

(highest_category_total/number_of_levels = range)
Range = 15 / 3

Level1 = 1-5 ( highest_category_total – Range *3)
Level2 = 6-10 ( highest_category_total – Range*2)
Level3 = 11-15 ( highest_category_total – Range)

therefore :
topic1 fails into level1
topic2 fails into level3
topic3 fails into level2


Sadly I’m not playing with bleach this week but having some fun with AJAX, to avoid boring you with details, lets sum it up by saying:
It allows the creation of interactives websites without the need for the users browser reloading.Although we have quite a few new application that use this functionality, I haven’t really seen much in the way of AJAX games.

I have been meaning to look into how it functions and pratical uses for it, plus i’m intreged by it. Damn my overly curious mind.

So taking my first step into the AJAX world I created a very basic RPG kind of game here. OK so it’s pretty poor but you can see that the page doesn’t refresh with each action and unlike the classic text base adventure games the directions are clickable.I should also point out that to use a AJAX website you must have IE 5+ with ActiveX enabled or Netscape 7.1+ (Firefox) / Opera 8 both with javascript enabled. Of course no JavaScripting would be the same without having to add code to identify and handle the different types of browser, which is a pain but the you don’t want to exclude certain types of users from your website, so you need to cater for various types of browser you may encounter.