Jump to page content

Random musings

A collection of my random musings, ideas and general randomnity. None of which has to make a word of sense if they don’t want to. Plus, don’t mistake the infrequency of updates for an indication that I am not completely insane. I am, don’t worry.

Return to the random content page

Site popularity scoring

(the far-too-much-effort area)

‹13th November 2005›

How to calculate the popularity of your site based on the links made to your site from other sites:

Add up all the numbers. If you were bored enough to try this then you are also probably the type to play Hula Hoops games. Incidentally, why does entering link:your-site-here.tld into Google return mostly pages from your own site and omit lots of other sites that link to you? Of course your own site links to itself, that’s the whole definition of a freakin’ Web site in the first place. It wouldn’t work very well if it did otherwise.

Techno Irish bagpipes

(the timeless-pondering area)

‹18th January 2005›

Who is Bagpipes? Bagpipes, whoever it is or they are, were responsible for the funky little tune Techno Irish, AKA Techno Irish Bagpipes – the one Adam quotes me describing as not really techno, not Irish and not strictly even bagpipes. The Celtic style is predominantly Scottish not Irish, it is only techno by the US definition (a blanket term for pretty much anything electronic with a dance beat; European, genuine techno is a lot harder) and the bagpipes are a typically poor synthesised version (bagpipes do not seem to lend themselves to being synthesised). Of course, none of the aformentioned stops it from being quite a catchy track.

The real reason for posting a pondering about Techno Irish Bagpipes was just to have a page on the Web that states what the original tune is (occasionally, Google doesn’t know). I don’t know who did the electronic remix, but the tune is Busindre Reel; the copy I have of that is by Hevia. Anyone who likes Highland pipes will probably prefer Hevia’s version with the more authentic strains of real bagpipes. Fans of cheesy trance will of course love Techno Irish Bagpipes.

Weighted mean average

(the has-to-be-already-invented area)

‹18th December 2004›

Sometimes, keeping a full overall mean average of a continually-increasing set of data is impractical, as it requires a list of every value recorded from which to calculate the mean, and one might only want to store a single value on record. Overall averages are also not necessarily helpful as older values of data may become increasingly less significant over time.

One very simple way to maintain a current average is to simply average each new value with the previous average; this way, only one value need ever be stored. This is how the Gorillas Deluxe league table works for handling mean accuracy. The problem here is the overall mean is very heavily weighted (at 50%) towards each new value, such that past values are effectively of very little significance.

One potential solution I have thought of is a weighted current average. To find the new current average from the previous average and the next value, use the formula:

average = (weight · next_value) + ((1 - weight) · previous_average)

The weight is any value in the range (0, 1). For example, a weight of 25% on the new value would give:

average = (0.25 · next_value) + (0.75 · previous_average)

The new average will be weighted 25% in favour of the new value and 75% in favour of the old value. The only problem I foresee is that at the very beginning this might cause problems; the second ever value will also be weighted only 25% against the first, which seems a bit silly seeing as at that stage there have only ever been two values and the weighting may as well be 50/50.

Magickal Pascal strings

(the lunatic area)

‹19 September 2004›

C strings are null terminated, but their length is unspecified and cannot easily be determined. Pascal strings are preceded by a length byte, but that limits a string to 255 bytes. What if you could have multiple length bytes? The longer the string, the more length bytes are used as necessary. Thus, to read the length of a magickal Pascal string:

  1. Set length to 0, index to 0;
  2. Read byte at index, and add it to length;
  3. If byte < 255, return length, else shift length up by 8 bits, increment index, and go to step 2

Some examples:

String length: Length bytes:
0 00
32 20
254 FE
255 FF 00
256 FF 01
32766 FF FE
32767 FF FF 00
32768 FF FF 01

You will note that to have a string of length 255 characters, you need a terminating null length byte as FF signifies a continue as well as a value of 255. This applies to all lengths where the last length byte needs to be 255.

Really random bits

You know you have been around Mac OS 9 too long when…

OK, there should be more than this, but evidently I’ve not been around Mac OS 9 long enough yet ;)

[18/11/2004] Hm, I’ve never eaten a bus ticket before…