Thaana date formatting for PHP 5

Here is a PHP 5 class that provides a drop-in function replacement/equivalent for the built-in PHP date() function to output formatted dates in Thaana/Dhivehi. It follows the standard method of writing Gregorian dates in Thaana by using transliterations of the English month names and using the native Dhivehi names for the week days. It accepts all the usual formatting arguments permitted by the original date() function thus allowing the same degree of formatting freedom as the original. The output returned from the function uses ASCII Thaana and, if needed, can then be converted to Unicode/UTF-8 by using the Thaana Conversions class. This class does not support Hijri dates (yet).

The class is being released under the Open Source MIT License.

Functions exposed:
format()
Returns a Dhivehi date string formatted according to the given format string using the given integer timestamp

Usage:
$thaanatoday = Thaana_Date::format('j M Y', time());

Download:
- Thaana_Date.zip (v0.2, 1.4KB)

Drop me a line if you have comments/queries. Enjoy :-)

Mass hysteria?

This whole throwing fits and going berserk business in the Makunudhoo School is becoming utterly ridiculous. It has been a month since it was first reported and apparently things have now escalated into becoming a full-on circus complete with clowns and flying elephants. More kids are apparently joining the madness by the day while the health authorities and the government at large seems to have ignored it for the most part.

The fanditha men who are being imported into the island by the worried parents to bring an end to this "supernatural" problem are probably having the time of their life. It is absolutely mad that in this day in age, people could forgo rationality and scientific understanding to attempt to solve the afflictions by letting fanditha practitioners chant and perform silly rituals around an island and go about cutting down trees in the belief that they harbour Jinns. The mentality of attributing anything even slightly mysterious or unexplainable as something within a supernatural realm is self-defeating, non-explanatory and should have been left behind in the past centuries of ignorance. I find it especially amusing that these Jinns always seem to have a knack for stirring a total ruckus in human societies by engaging in petty, retarded behaviour like taking "possession" of a person for "revenge". Then again, all non-existent imaginary constructs have their own unique quirks.

Edit (17/05/2008):
Jinns are mythical creatures lacking evidence and scientific validation. This fact should not be taken lightly because:
a) the role of such a priori beliefs in making people susceptible to and triggering hysteria has been noted in research,
b) the "treatment" being pushed by fanditha men and priests/imams involves reinforcement of those very beliefs that set it off and that has been noted to enhance the outbreaks.
c) the immediate attribution to illnesses to the supernatural delays/avoids proper medical diagnosis in favour of meaningless rituals, which is especially worrying if the illness were to be due to or a symptom of a serious medical condition.

Edit (11/05/2008):
Some interesting papers on the matter:-
- Episodic Neurological Dysfunction Due to Mass Hysteria
- Epidemic Hysteria: A review of the Published Literature
- Possession "hysteria" in a Kenya Tribe

Thaana conversions class for PHP 5 - v0.2

Here is an update to the Thaana conversions class I released in Nov 2007. This new version 0.2 release expands the varieties of conversions available and should be more than adequate for almost all uses. This version, most importantly, adds solid UTF-8 conversion functions allowing for more flexibility in PHP-based Unicode/UTF-8 Thaana handling. Further, the class is now licensed under the pretty liberal Open Source MIT License. The code still relies solely on core PHP 5 functions and does not demand any extra PHP extensions to be installed.

Functions exposed by the class:
- convertUtf8ToUnicodeIntegers()
Convert UTF-8 data to Unicode character integer representations

- convertUtf8ToAscii()
Convert UTF-8 data to Ascii

- convertEntitiesToUnicodeIntegers()
Convert HTML Unicode entitied string to Unicode Integer characters array

- convertEntitiesToUtf8
Convert HTML Unicode entities to UTF-8

- convertEntitiesToAscii()
Convert HTML Unicode entities to Dhivehi Ascii equivalents

- convertUnicodeIntegersToUtf8()
Convert Unicode Integer array to UTF

- convertUnicodeIntegersToEntities()
Convert Unicode char integers to HTML entities

- convertUnicodeIntegersToAscii()
Convert Unicode char integers to Ascii

- convertAsciiToUtf8()
Convert Ascii Thaana to UTf-8

- convertAsciiToUnicodeEntities()
Convert Ascii Thaana to Unicode HTML entities

- convertAsciiToUnicodeIntegers()
Convert Ascii Thaana to an array of Unicode integers

Usage:
<?php
$thaana 
= new Thaana_Conversions();
echo 
$thaana->convertEntitiesToAscii('&#1931;&#1960;&#1928;&#1964;&#1920;&#1960;');
echo 
$thaana->convertAsciiToUtf8('rWacje');
?>

Download:
- Thaana_Conversions.zip (v0.2, 3KB)

Drop me a line if you run into trouble with any of the functionality or have comments/queries. Enjoy :-)

Jellyfishes

Jellyfish count as one of my favourite creatures. They don't have a brain yet come equipped with interesting varieties of (err) accessories. It is supposed to have been among the earliest animals that evolved yet its descendants continue to thrive in oceans across the world even to this day. And there are just so many of them, abundant even in the Maldivian seas!

Anyway, this astonishingly beautiful-hypnotic video of various jellyfish from the Monterey Bay Aquarium just had my jaws drop open and inspired this post. Check it out! (The video is in HD. Watch it fullscreen to enjoy the finer details)