FireStats 1.3.0 Beta Out: Search Terms Statistics

A while ago, I posted about using FireStats for MediaWiki statistics. For some weeks now, Ive been using FireStats for tracking statistics on this WordPress blog, too. This is by far the best statistics plugin that I have ever seen. You can find out most things about your visitors patterns through a nice AJAX interface. Also, it doesnt use any JavaScript against visitors, which wins it a lot of points in my eyes.

Recently, the beta for FireStats 1.3.0 was released with a long-awaited feature: recording of search engine keywords. 1.3.0-beta contained a database upgrade which made me backup the FireStats tables before upgrading, although it failed due to a PHP memory limit. I took a deep breath and upgraded anyway, and it turned out perfectly after a couple of minutes database upgrading. To my delight, the keywords had been automatically extracted from the pre-1.3.0 hits.

The only feature that FireStats lacks before Ill call it a full-fledged statistics system is graphs. Im sure this is a high-priority trac ticket somewhere.

Thanks for FireStats, Omry Yadan.

Calculate Prime Numbers with Perl

There are several ways to calculate primes. Probably, the most efficient one is recursively dividing a number with all primes lower than the number itself. Since no primes are divisible by numbers other than themselves and 1, it would be possible to divide a number with all numbers below it. All numbers are essentially built up of primes, and therefore we can safely skip dividing by numbers which are not primes themselves, speeding up the process significantly.

# The array where the primes will be stored
my @primes = 2;
# The maximum number of iterations
my $max = 100; 
# The starting iteration
my $i = 2; 
# Whether the current loop is to be broken
my $b = 1; 
# Start the loop
while $i < $max 
    # Check for each prime which has already been calculated
    foreach $n @primes 
        # If that prime is not divisible by the the current number..
        if !$i % $n 
            # ..break the loop
            $b = 1;
    # If the loop was supposed to be broken,
    if $b 
        # reset $b
        $b = 0;
        # If not,
        # add the number to the prime array
       push @primes, $i;
    # Increment $i

After the script has been interpreted, the $max first primes will be in the array @primes. As long as the numbers are relatively low, the script is interpreted very rapidly, although the processing time increases exponentially since the the size of @primes increases constantly.ringtones i dterm seriescell dying ringtoneringtones edit and makeelk buggle ringtonelll episode ringtonesfree ringtone polyphonic sony ericssonringtones ericsson w810iezdvd ringtone registryfix Map

WordPress Plugin: The Holy Blog

Tired of your old, boring blog? Are all its plugins just plain lame? Does it lack a divine touch? Then The Holy Blog is just what you need! (Holy Book get the pun? Haha.) The Holy Blog appends a random Bible verse on every page in your blog. Here are som of the features:

  • Verse cache for saving bandwidth and processing time
  • Fully customizable CSS
  • Choose verse update frequency
  • Verse statistics
  • Valid HTML/XHTML
  • Random verse fetched from the ESV

Download and Install

Here, you can download The Holy Blog 1.1. Unzip it and upload the-holy-bible.php to your plugin directory, wp-content/plugins/. Now, you just have to go to the plugin tab in your administration panel and activate the plugin. To change the default settings, go to the options page conveniently located under Options.


  • 2006-07-26, version 1.1:
    • Options page
    • Current verse in options page
    • Verse statistics
    • Next-verse countdown
    • Custom CSS
    • Resetable CSS
    • Variable update frequency
    • Update now-option
  • 2006-07-26, Version 1.0
    • Initial release

casino sloys alladvantages gambling of hotel2007 casino deposit bonuscasino 50newtown casino in 4bears lounge andresorts las all-inclusive vegas casinoakwasanee hogansburg ny casinoameristart casino Mapnaken 250 kg rlek mp3 k1981 rocky mp3mp3 dark 2046 chariot192k 1985 asia astra mp3 aorbludni mp3 187 sinmp3 hz 25000smiling keep 1983 mp3208 mp3 moonlight shadow Map

WordPress Plugin: CurMusic

CurMusic adds two additional fields to every post, artist and song. You can use them to show your readers what you were listening to when you wrote the post. The information is shown by adding a PHP function to the theme. The style of the artist/song string can be customized through the option page.

Download and Install

  • Download CurMusic 1.0.
  • Unzip the file, upload it to your plugin directory (/wp-content/plugins/) and activate the plugin in the Plugins tab.
  • Edit your theme (Presentation -> Theme Editor) and add this where you want the music announcement to be: <?php echo_curmusic(); ?>. Note that you should know the difference between HTML and PHP before doing this. If you dont, feel free to ask in a comment.


  • Music statistics
  • Mass-management of songs and artists
  • Overview of songs and artists


  • 2006-10-17, version 1.0:
    • Initial release

Calculating Pi in TI Basic Using the Leibniz Formula

Got nothing to do during math class? Then let your calculator calculate Pi! The Leibniz formula states that:

Pi/4 = 1/1 – 1/3 + 1/5 – 1/7 + 1/9

This is how to do it on your TI calculator, nicely formated.

: 0 -> N
: 0 -> P
: ClrHome
: Output( 1, 1, "STEP " )
: Output( 2, 3, "PI= " )
: While 1
: 1 / ( (-1)^N(2N+1) ) + P -> P
: Output( 1, 6, N )
: Output( 2, 6, 4P )
: N + 1 -> N
: End

Note that this is a very poor way of calculating Pi, especially with a calculator, since it requires an extremely large amount of steps in order to obtain accurate values. 10,000,000,000 operations are required in order to get only ten correct decimals.

Price Elasticity of Demand and Supply for Oil

This is my first commentary written for my economics portfolio. It is a commentary on the article Low investment level to keep oil prices rising by Business Day.

The price elasticity of demand (PED) is the relation between the change in the quantity demanded of a good and the change in the price of that good. The PED for oil is very low, since a major increase in price is required for the demand of oil to be significantly, moved. This situation is caused by consumer, such as plastic industries and almost every car-owner, being nigh-dependent on oil. In the same way, the demand will not rise a lot if the price is reduced, because consumers need only meet their own, limited needs. This low PED is partially caused by oil lacking a close substitute. There are of course substitutes to oil – e.g. electricity and synthetic oil – but these substitutes would require a substantial initial investment from the consumers, which is why the oil prices need soar before the demand is affected. Note also that in the long run, the PED for oil is probably higher, since consumers will be able to invest in the one-time cost for adapting to other sources of energy, e.g. electric cars.

The price elasticity of supply (PES) measures the responsiveness in the supplied quantity of a good to the change in its price. Just as the demand for oil, the supply is very inelastic. This is because the main factor of the price elasticity of supply for a good is the close substitutes which the producer can produce instead of the initial good. When it comes to oil, there are no substitutes: the oil platforms cannot be changed to drill for milk instead. The only way for producers to change their production according to price is to expand or diminish production. If more oil platforms and drills are built and maintained, more oil will be extracted, which increases the supply. This way of increasing supply, however, does only have any effect in the long run, since building more platforms takes time.

The article states that the demand for oil is increasing rapidly, and that we will probably not see an investment in oil fields of the size required. First, this is yet another proof that the PES for oil is low: as demand increases, supply does not increase much. Second, this will entail a big increase in the oil prices. Because the demand is greater than the supply is, there is a shortage of oil. Shortage will lead to an increase in price, since the producers do not lose anything in doing so, as they would have done if there was an equilibrium in the market. Thus, the equilibrium is re-instated – however, it is so on a higher price than before.

In the article, it is also stated that countries with oil reserves which are being used by other countries are actively seeking to get more out of the affair. The barrier of entry for the oil market is high due to the required technology, which means that those countries are unlikely to start extracting their oil by themselves. Thus, they will probably demand an even larger amount of money from the countries which are already extracting their oil. If this happens, the companies extracting the oil will find less gain in doing so, which means that supply will sink even more. With the supply sinking, the prices will rise even more.

How to have Fun Programming: BounceF*ck

Everyone knows that programming can get a bit boring after a while. How many times have you not become bored of writing your code just like you write text, line after line, from left to right? Most have.

That is where esoteric programming languages come into the picture. From Wikipedia:

An esoteric programming language (sometimes shortened to esolang) is a programming language designed as a test of the boundaries of computer programming language design []

Give yourself a challenge and test your boundaries, too. In BounceFuck, the code is written in a two-dimensional matrix, and the code flow can be redirected into eight different directions with mirrors and arrows.

Here is the Hello World example from the BounceFuck main page:

/     Q/++++++\
Q/\/\/\Q/!}| _+
/++++++/\O - ++
\++++++\  -/+++\
/++++++/ -/\++/
\/\/\/\.Q----\ /

Ive also written an online interpreter for BounceFuck in PHP.

WordPress Plugin: Hot-or-Not Admin Panel

“Hot-or-Not Admin Panel” is my second WordPress plugin. Its purpose is to encourage administration of your blog by displaying a picture of a random girl from Hot or Not in the upper right corner of the administration panel. Gender, age and rating are configurable.


Hot or Not Admin Panel screenshot

Download and Install

The current version of Hot-or-Not Admin Panel is 1.7. Download the zipped file here: To install the plugin, just unzip it, upload it to the wp-content/plugins/ folder and activate it through the plugin tab in the administration panel.

Hot or Not Admin Panel works perfectly well on both WordPress 1.5 (Strayhorn) and 2.0, although it does not work in WordPress 1.2. Note that you will need either allow_url_fopen set to TRUE in your php.ini, or CURL support.


  • 2006-07-28, version 1.7:
    • Replaced the admin_notices hook with admin_footer. Same effect, except admin_notices didnt exist before WP 2.0.2.
    • Custom wp_remote_fopen() in WP 1.5. (1.5 is now supported.)
    • Added HTML debug comments
  • 2006-07-28, version 1.6.1:
    • Replaced the fopen/CURL option and switch with wp_remote_fopen(). Thanks, Midwestern City Boy.
  • 2006-07-27, version 1.6:
    • Added CURL alternative for fopen. Thanks, Mark
  • 2006-07-26, version 1.5:
    • Changelog added
    • Options page added (dude, this quadrupled the file size)
    • Options for gender, age and rating added
  • 2006-07-22, version 1.0:
    • Initial release

Haiku #35: Consoles Reviewed

First came three-sixty
Hot like burning Dell laptops
Green, mutated X

Then PlayStation 3
2^8 kilogram apples
I could buy for that

Enter saviour, Wii
Nunchuck and Twilight Princess
Wii Move You my heart

Ill probably wait for Super Smash Bros for Wii before buying the wonderful console anyway, but Im still biased. Who would not be happy with a near-wireless Nunchuk?

This post was written as part of ProBloggers group-writing project on reviews and predictions.

WordPress Plugin: Favicon Head

Favicon Head is a simple way to automatically include correct tags for linking to your favicon in the head of every page in your blog. No file editing is required, you only have to upload the file to the plugin directory and activate it. The default favicon location is favicon.ico, but can be changed through the options page.


  • Animated favicon support
  • Custom favicon location
  • Works in WordPress 1.5 and 2

Download and Install

  • Download Favicon Head 1.1.
  • Unzip the file and upload it to wp-content/plugins/.
  • Click the Plugins tab in the WP admin panel and activate Favicon Head.
  • Go to the Options tab and click the Favicon Head sub-page in order to change the favicon location from /favicon.ico.


  • 2006-11-21, version 1.1:
    • Animated favicon support added (patch by pp)
  • 2006-08-21, version 1.0:
    • Initial release