Moment.js Dhivehi locale merged

The ever so useful and powerful Javascript Date library moment.js merged my Dhivehi locale pull request in the 2.11.0 release. Sure to be handy when developing Dhivehi websites!

moment.js 2.11.0 release changelog

Hope for a united human race

For all we've come to understand, of us and the universe, we've not come to understand empathy and compassion. For all we've been able to achieve, of curing disease and going to distant Moons, we've not been able to achieve peace and a healthy life for all. Of all the delusions we entertain, mine is the hope for a united human race.

Dhist launched!

During the Kickstart Hackathon 2015, Musannif and I spent a little while making a simple tool, which Musannif named "Dhist", to let you write, store and share Dhivehi text in Thaana using the web browser on the majority of the varieties of devices. It was written mostly to scratch our own itch but we welcome feedback and feature addition requests. Please share and use!

Check out Dhist

Science Emmenah is 1!

"Science Emmenah" turned 1 today! It has been a year of hard work - writing posts in Dhivehi, writing for the "Science Dhaskuramaa" radio show, holding a few public events and finishing drafts of a few science books. I can't be thankful enough for the wonderful people - especially Aadhu, Hisham and Adam - who joined Musannif and I in our quest and eagerly spent countless hours getting various things done.

I hope our candle burns brighter and lights more candles in the year ahead. And thank you all for the support and encouragement!

9 years with magnetic implant!

Today marks 9th anniversary of me getting a tiny magnet implanted into my middle finger. I had it implanted as part of a new type of human-machine interface concept and prototype I developed during my Master's Degree at the University of Reading (UK). I originally had a second one in my ring finger too, but had it removed a few years ago due to an impact injury to the implant site swelling up my finger. The current implant is entirely useless for the task I originally had it implanted for, as the magnet has lost its magnetism and is additionally covered by a layer of fibrous tissue due to another impact injury.

I dearly miss the unique sensations and sensory awareness the magnetic implant once gave me. :-(

Integrating JTK with tinyMCE 4.x

Integrating my Javascript Thaana Keyboard library to handle Thaana entry within tinyMCE for a full-featured rich-text Thaana editor is very straightforward. You just need the following config in the tinyMCE initialization.

setup: function (editor) {
      editor.on('keypress', function (e) {
          thaanaKeyboard.value = '';


My strategy for the lowest unique bid auction @

So, I won a SMS-based “lowest unique bid auction” type game run by that had offered a nice quadcopter drone with gimbals and a GoPro camera. Saddeningly, some are unhappy with the outcome and have resorted to squaring accusations of cheating and insinuated that I had used illegal means towards winning. Some have even launched smear campaigns against both and myself via mass SMS and the Maldivian Facebook and Twitter spheres. Here, I’d like to clear up a few things…

My interest and approach to the game:

I am not someone who participates in raffles, lotteries (“naseebu numbaru”) and other types of competitions that are based on pure chance because the probabilities of winning one are so low and there is nothing one can do to increase their odds. I came across the advertisement on Facebook a day or so after it was launched and read up on what a “unique bid auction” is as it was the first time I had heard of the term. The realization that it wasn’t a game of pure-luck, the mathematical analyses mentioned on the Wikipedia page and the game theory-centric approaches discussed in the research papers I had found, piqued my curiosity and interest enough for me to decide to take a shot at it. I’ve wanted a drone for a while and having a good chance of getting one as reward for geeking out on an interesting mathematical/computer science problem had me hooked!

It is worth noting that a lowest unique bid auction is very similar to a raffle if the only information you are given is that your bid amount is the current winner – in which case you are down to making blind guesses and hoping you luck out. Some lowest unique bid auctions also run on the rule that submitting a new bid that is not unique while already holding the winning lowest unique bid switches you to the non-winning position – in which case participants tend to not risk exploring other possible bid values for fear of loosing some advantage they might have at some point. Hence, the exact implementation and the information provided during the game by the organisation running it matter a lot.

Information provided by

The game run by was offering several bits of information that slightly swayed the odds for players.

  1. +/- < 1 range where the current winning bid was placed
    They provided this bit of information on their website for the current winning bid until the last few days of the game. +/- 1 is a very small range where the total SMS value to the player is RF 100/- to cover the entire range. One could send out submissions to cover this entire range and have a good chance of ending up with a winning bid. If you were to log this information frequently (like I did), then you can build up a map of the number line where gaps become apparent.

  2. Replies indicating whether the bid was > or < than current winning bid
    This is very helpful in quickly tracking down a range where the current winning bid is and was especially helpful once the website stopped showing the range of the current winning bid. For example, if you sent a submission of 10 and got a reply that it was lower than the current winning, then you could either step through incremental submissions, with a step resolution of your choosing, until you are told that your bid is larger than the current winning bid (or hit a winning lowest unique bid in the process).

  3. Replies indicating that you have a unique bid but not the lowest
    This is somewhat handy because you know you’ve struck a unique bid that can come back to your advantage if you or someone else knocks out the current winning bid by duplicating it. The strategy then may move to sounding out the winning bid using the process described in (b).

  4. Replies that your submission is rejected because you are the current winner
    I discovered this by accident but it was pretty useful. If you are the current winner and make a submission that is not unique then you not given a rejection reply but given the same message as (b) instead. However, if you make a submission that is unique, the system replies with the rejection message. This allows you to keep submitting and noting down bids that have a chance of being unique when used later if you lose the current winning spot.

  5. Duplicate bids
    They displayed this bit of dynamically updated information on their website until the end of the game and is a helpful guide for what bid amounts to avoid submitting to save your SMS expenses. If you were to log this information frequently (like I did), then you can build a list of bid amounts to not ever submit and use your budget more efficiently.


All that information gives a good insight into the landscape of the game at any given time. But you do need a few other observations and assumptions to maximise your chances.

  1. The duration of game
    The competition ran for about a month (?) which gave plenty of time for even a few active participants to quickly use up more bid amount ranges (more time, more submissions).

  2. Number of people participating
    This is pretty important because, in combination with point (i), more people participating means a larger number of submissions and higher probability of a larger bid amount range being filled. However, given that Maldives is only ~300,000 people, of which a small subset will take part in the game, and this being the first such game by which probably would lead to many people being unaware or unwilling to take part, meant that the probability of the bid amount range having gaps was high - which is a good thing.

  3. Amount willing to spend
    It gets tricky here because the more the participants are willing to spend, the larger the bid amount range that will get covered. This then increases the cost of participation and winning. Having a good guess of what others might be willing to spend and setting your budget appropriately helps come up with a strategy that gives you a good chance of winning. For example, if you are willing to spend RF 100, and someone else is willing to spend just 1 RF more than you, the other person has a much better chance even with simple strategies. I opted for a budget of RF 3000.


There is no perfect play (a strategy that guarantees a win) in unique bid auction games but there are a few approaches you can take to increase your odds.

  1. Cover a continuous part-range of expected values
    This is a very good approach if you have a large enough budget. This approach involves sending all possible bid values starting from whatever max value you think will give you a good chance of winning as informed by assumptions (ii) and (iii) down to 0.01. This strategy means you will have to spend quite a bit upfront but means that other players have to send a whole lot of submissions to nullify your submissions and any gaps they leave will leave you a winner.

  2. Cover a large range with stepped values or random-ish values
    This approach is more budget efficient than (i) and involves making submissions by stepping through your values (e.g. 0.2, 0.4, 0.6 or 0.5, 1.0, 1.5 etc) or with random values that cover a broad spectrum of the possible values as informed by assumptions (ii) and (iii). If you loose the winning spot when someone uses up a gap you left, you can easily track it down and invalidate theirs by duplicating the bid.

  3. Mix of (1) and (2)
    It is possible to mix (1) and (2) for a double pronged approach that is even more budget efficient but at the cost of having to keep up with active play in the game till the end. This approach also carries much higher risk. I decided to use this method because it would cost me less and be a more fun computational challenge.

I used the logged information from (a) and (d) to optimize the bid submissions I made.


Playing to win makes this game unplayable if you are sending SMS by manually typing it in, especially during the frenzy of the end of the game where other participants are all actively sending tens or hundreds of submissions. This is especially true for the strategies (1) and (2). You can gain a speed advantage by using tools to aid you. You can send out a large number of SMSes for this purpose using freely available SMS software hooked to your phone and MS Excel to list or generate the numbers or, if you are a programmer, write a few lines of code to automate most or the whole process.

Comment on the accusations:

One of the main accusations that is being levied is that I am friends with and colluded with Apo, one of the guys running, to rig the whole thing in my favour. Apo is an acquaintance, one of the many talented developers that I have had the fortune of meeting from the relatively small group of software developers in Maldives. He is not someone I hang around with at all or talk to often. I can’t imagine any reason that he or the other guys behind would have for rigging the competition in my favour.

The other accusation is that I used illegal means, somehow accessing or hacking the auction systems, to gain some advantage not had by others. There’s little I can offer than my word that I did not do any such thing but I heartily join the calls for an investigation by the relevant authorities to ensure there was no fraud or scam or illegal activity by any and all participants of the game.

It maybe worth noting that quite a few people complaining on the Facebook page and elsewhere, seem to have very little understanding of how a lowest unique bid auction works. It is complex and involved and there are common scenarios where a winner and a winning amount changing wildly can happen, especially under heavy submission traffic, and is hardly indicative of foul play.


In the end, I am not sure if it was all the reading and my imagined-clever strategy and system that helped me win or was just pure luck - I like to think my work helped - but I am sure I played fair and spent a lot for my effort. Judging by the hate and threats some people are spewing, I am better off never participating in these things in Maldives. Thanks for the lovely prize! :-)