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

<?php
// Load class include
require 'thaana_date.obj.php';

// Format date
$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 :-)

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
// Load class and initialize object
require 'thaana_conversions.obj.php';
$thaana = new Thaana_Conversions();

echo $thaana->convertEntitiesToAscii('ދިވެހި');
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 :-)

Update (11-Sep-2008): This version is now superseded by the v0.3 release.

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)

Getting back into electronics...

Electronics was my first love but it has been ages since I was hands-on with it last. Infact, I don't even remember touching a soldering iron except for doing a few bits required for work at university. Hopefully, that's all about to change.

I am making a (really) concerted effort to get (back) into some practical electronics, partly motivated by a renewed interest in robotics and partly because I have a few ideas I want to try out. I got my old stuff out a week or so ago, only to find out that I no longer have most of the essential gear I need. Consequently, it has been a demanding few days for my wallet as I stocked up on components and some absolutely essential tools - including a new multimeter and a new solder station. I've opted to build a dual-polarity variable bench-top power supply myself (which is essential for almost all work) rather than buying it as these don't come cheap.

First on my list of things to do is get myself acquainted with the TI 16-bit MSP430 series of microcontrollers and the popular ARM 32-bit microcontrollers. I know I'm going to have a fun time tinkering with these MCU's - hopefully it'd be more fun than that I had toying with the Microchip PIC devices. For now, I'm still waiting for the chips to be delivered and for my exams (which begins tomorrow) to be over...

Wish me luck! :-D


Geek at work :-P


Equipment and component stock slowly piling up...

My blog on HFM TechTalk

My blog got a mention on HFM's brand new technology show "Tech Talk" which aired last night. They talked a bit about the findings revealed in my relatively recent post titled "Fingerprinting Thaana". Thanks to Ripha and Niyaz (the creators/presenters of the programme) for the appreciative words. I am glad to know that you guys read my blog!

I think they did a good job with the programme, especially given that it was their first show and that they did it live. I wish them the best with their future shows...

Listen to the clipping from the show:

Website for Muizzu, Suoodu & Co. now live

One of the last website projects I had worked under Technova in 2007 was the website for Muizzu, Suood & Co. law firm. The website was completed and went live towards the end of the year. They were one of the easiest to deal with clients we've had and I'm pretty happy with the outcome of the project.

The MSC website was among the first to use our new slimmed-down Content Management System designed with small businesses in mind, focussing on delivering a website quickly together with basic content editing facilities. Technova will be launching a low-budget website development package based on the new system sometime soon.


Ping

Been a while since I blogged but I've been too damn occupied with Uni work lately. I'm hoping for a breather soon. Sigh...