Hi, ok if you don’t know what a sprite is then this post might get confusing quite quickly.  I’d suggest having a quick read up and find out what they are.  Simply put, the technique of using a CSS Sprite is so that you can reduce the number of HTTP requests browsers make to your server by only showing a portion of a larger image by changing the background-position (so that only the bit you want to see is showing through the object).  Another use for them (and this is the one we’ll be using here) is for convenience.

A pie chart of increasing values 0-100% could be stored as 20 separate independent images, named pie-[00-100].gif.  This however is inefficient for both the browser, the server, and the user.  The user will have to wait for the image to download if they haven’t already seen it (and hence cached it).  In my example I have 20 pie charts of increasing values in one image.  The background-position css property will dynamically change via server-side code to show only one of the 20 available pie charts.

Here’s the finished article:

pie-finalresultHere’s how it was done…

Continue reading »

 

In quick succession to my earlier blog post about Hit Counters Don’t Need To Be Boring, I’m writing another post about how that same algorithm can be used to measure voting on stories or popular items as well.

This thought process all started when browsing through reddit earlier today and noticed a post that described a voting algorithm that allowed for old very popular stories to come below newer less popular stories due to a decay.  The huge problem with this algorithm though was that the date the story was created influenced how far down in the list it would go. Continue reading »

 

One design aspect I have with athe.la is to provide a ranking of albums and artists given the number of hits the pages have had.  This got me thinking of all the different ways that hit counters could work.

There are 3 sections to this post:

1) Counting Visits – how visits to the page can be counted from unique and non-unique visitors
2) Current Hit Counters – what kind of hit counters are in use today and what are their downsides
3) Buzz Hit Counter – why my new method for counting hits has all the upsides of current hit counters and has no downsides! Continue reading »

© 2011 athe.la blog Suffusion theme by Sayontan Sinha