Climbing Mount Everest

I’ve been fascinated by Mount Everest and the mountaineers that pit themselves against it for a number of years now. Thanks to the Internet, I follow blog posts by those who have receive first hand information of the latest in Everest expeditions. One day, I too wish to attempt climbing the mountain.

The question many ask is, why? Why the fascination with climbing Mount Everest? Mallory, in an answer known as the most famous three words in mountaineering, said it best:

“Because it’s there”.

He also had a longer answer which summarizes much of the endeavors we put ourselves to:

“The first question which you will ask and which I must try to answer is this, ‘What is the use of climbing Mount Everest ?’ and my answer must at once be, ‘It is no use’.

There is not the slightest prospect of any gain whatsoever. Oh, we may learn a little about the behavior of the human body at high altitudes, and possibly medical men may turn our observation to some account for the purposes of aviation. But otherwise nothing will come of it. We shall not bring back a single bit of gold or silver, not a gem, nor any coal or iron. We shall not find a single foot of earth that can be planted with crops to raise food. It’s no use.

So, if you cannot understand that there is something in man which responds to the challenge of this mountain and goes out to meet it, that the struggle is the struggle of life itself upward and forever upward, then you won’t see why we go. What we get from this adventure is just sheer joy. And joy is, after all, the end of life. We do not live to eat and make money. We eat and make money to be able to enjoy life. That is what life means and what life is for.”

Posted in Mount Everest, Mountaineering | Leave a comment

Catching uncaught exceptions in Node.js

A common problem when writing Node.js servers is in ensuring all exceptions are handled. Node.js will helpfully die when exceptions are not caught and handled, which forces you, the author, to ensure robustness in your Node.js applications.

There is a simple way to ensure your applications are catching exceptions:

process.addListener("uncaughtException", function (err) {
    console.log("Uncaught exception: " + err);
    console.trace();
});

This is not quite ideal. You should really be logging uncaught exceptions to a log file. I’ve written node-simplelogger which makes this easy:

var simplelogger = require("simplelogger").simplelogger;
 
var logfile= "/path/to/somelog";
var logger = new simplelogger({
	filename: logfile,
	autolog: ["file"]
});
 
process.addListener("uncaughtException", function (err) {
    logger.error("Uncaught exception: " + err);
});

This will effectively pump uncaught exceptions out to a log file.

Posted in Code, Node.js | Leave a comment

Going all Jain on Hemant

The post by Hemant Mehta on Jainism is a slightly shocking read. There are a number of factual inaccuracies and drive-by innuendos.

Let’s look at the article one piece at a time.

First up – Sam Harris and Richard Dawkins are right when they say that Jainism is a gentle religion. There is no active proselytizing in the religion, there is no speech declaring fire and brimstone and the end of the world, and there is certainly no strong compulsion in forcing members wearing the faith to a certain conduct or lifestyle.

The religion is gentle, in the only sense of the word that makes sense. The call for non-violence permeates through every aspect of the religion and the net effect has been a startlingly peaceful society. The Jains have fought no wars (and thus, being able to be the sole religion able to make the claim of never having to have waged war) . They embark on charity, as do the non-religious and the adherents of many other religions, but the Jains stand distinct by providing charity for not just for fellow homo sapies but for animals as well. The Jains argue that every life is equal to every other life and therefore, one cannot inflict violence on any other creature willingly or unwillingly. They further argue that animals are living creatures capable of suffering pain and harm, much like humans, and as such, they should be not be treated violently.

Jain prayers offer forgiveness for any harm caused to the many different lifeforms in the world, and their prayers articulate and enumerate the types of lifeforms in the world. The Jains are strict vegetarians, and much of their culturally institutionalized conduct repeatedly emphasizes never invoking violence against any living creature. In fact, they celebrate an annual religious festival whereby members of the community ask for forgiveness from other members of the community for any intentional or unintentional hurts caused. During their prayers, they take due care to not sit on insects or any other small creatures and wear a cloth across their mouth to not injure any flying creature inadvertently while they pray. A symbolic gesture, perhaps, but the emphasis on non-violence runs deep through and through.

Ahimsa, as advocated by the Jains, is not just admirable non-violence, as Hemant implies, but has in fact been a shockingly strong force in recent times. It was a key factor in Gandhi’s formulation of civil disobedience[0] as a form of political activism and was the driving force behind Mandela’s sue for abolition of apartheid in South Africa[1]. Non-violence and Satyagraha brought down the biggest empire in human history, and has been used to great effect is many countries as a legitimate form of civil resistance.

Now, it’s true that Jain metaphysics hold a system of never-ending cyclical eras of time. I find it silly, just as Hemant did, but I went much further on reading up on Jain metaphysics. Jainism holds, quite unlike any other religion, that we are not alone in the universe. Jains argue that there is countless sentient life in the universe and there are countless planets in the universe, and that these beings  on other planets are capable of learning and they go through the cycle of birth and death.

Jains can argue for other sentient on other planets because the religion does not require a creator (and in fact argues strongly against a creator), and thus, has no need to make us homo sapiens  special. Fascinatingly, for me at least, the statement of sentient life in the universe is even present in the prayers. This point of view is shockingly prescient in light of ongoing SETI work, and should have at least be acknowledged as a fairly sophisticated system of thought much ahead of its time.

Secondly, the fordmakers that Hemant alludes too are not supernatural beings. To even begin arguing as such implies some lack of knowledge of the religion. The fordmakers were humans who almost reached enlightenment while living and taught tenets of the religion to the lay people (they reached true enlightenment after death, because the Jain karmic system requires death to be the final liberation). The Jains argue that countless number have reached enlightenment before and after the fordmakers, not just the 24 Hemant argues. Hemant has probably confused those who have reached enlightenment and those that preach the religion (the fordmakers).

Now, is there evidence of the fordmarkers reaching enlightenment? Sadly, there isn’t, not at the level that would make a skeptical mind accept the evidence. Is lack of evidence an argument against Jainism? Perhaps, but do keep in mind that the religion doesn’t demand that one accepts the lack of evidence on the basis of faith. In fact, the scriptures specifically require the adherent to question and never accept on the basis of faith. Again, this level of skepticism inherent in the religion is fairly unique as religions go and should be acknowledged.

Thirdly, it’s true that fasting is big in Jainism. But there are different levels of fasting. Some Jains fast for 8 days annually. Others fast one day a week. Others yet fast on alternate days. Some fast by eating only one meal a day. Truth be told, most don’t fast at all.

To argue that fasting is detrimental to health is akin to arguing that driving a car can kill you. If you drive safely and within your means, you will survive your driving excursion. If you fast within your physical limits, you will feel much better for it. Jains don’t fast if they don’t wish to. It’s not compulsory and is very much on a voluntary basis. Does excessive fasting injure health? Of course it does. Do Jains fast excessively? Hardly so. There is a clear recognition that non-violence does not only apply to others but also to the self. Injuring ones-self needlessly is an act of violence and Jains recognize that.

Jains rules on diet actually do make sense within the context of the philosophy. Many of the points Hemant brings up are good questions, and there are sufficiently coherent reasons behind them. I know because I asked about the exact questions Hemant brought up many years ago and people gave me good answers.

Animal products are generally not acceptable in Jain diet because animal products often involve causing harm to the animal. Milk was considered acceptable in India hundreds of years ago when cows were literally part of one’s family and you could be reasonable sure no harm was being done to the cow. In this day and age, one cannot consume milk with the same level of certainty and in view of this, I actually gave up milk only to realize a few weeks later that I could not survive without milk. At that point, I gave up my Jain identity and now consider myself a person who practices Jain ethics without being a Jain myself.

Potatoes and any food that grows underground is considered harmful as farming food that grows underground requires causing harm to creatures living under the earth. Now, the Jain diet is hard to live by, no doubt. But arguing that its internally inconsistent is a pretty bad argument. One only has to live in a Jain society for a few months to realize that Jains can be pretty committed to the philosophy. Yes, a number of Jains give up eating food that comes from below the ground. Not quite a problem as Hemant makes it out to be.

Finally, Jainism has an extensive metaphysical system based on karma. It is fairly distinct from the Buddhist and Hindu systems of karma, and to my mind, is certainly a more elegant system (yes, I spent few months in my teens reading up the Jain karmic system). However, I reached the conclusion that there is absolutely no evidence for karma as Jains argue for, and I had to discount the karmic hypothesis. Again, there was nothing in the scriptures forcing me to believe on the basis of faith. The converse, in fact, was true as I distinctly remember religious passages arguing for putting skepticism ahead of dogma. The intellectual honesty of the religion allowed me to reject the metaphysics but accept the ethical system.

I enjoy reading arguments for and against Jainism and its system of philosophy. But I would ask for researched arguments. To argue that it is problematic by taking a pot-shot approach and making ad-hominem arguments does not serve in moving the discussion forward in any meaningful way.

There are certainly problems in the religion (lack of evidence of karma being one of them) but discrediting it as a whole does little justice to the argument and to the arguer. After all,  one is able to find merits to the Jain ethical system and acknowledge that it does offer a unique perspective on structuring human societies. That too should be recognized in the interest of providing a balanced and intellectually honest viewpoint.

[0] Gandhi’s mother was a Jain and the Jain emphasis on non-violence took imprint on Gandhi.

[1] Mandela was imprisoned on Robben Island when he gave up non-violent resistance and took up arms.

Posted in Jainism | 1 Comment

Killing connections

When working with remote services (eg Twitter stream), it’s important to test out and handle all (if not, as many as possible) edge cases. Examples of edge cases include transient network errors, unexpected disconnections to long lived streams, temporary routing problems and the ever famous “Connection reset of by peer” errors.

If you are on a Linux machine, it’s simple enough to create network discontinuities with the following shell script:

#!/bin/sh
route add -host $1 gw 127.0.0.1

This effectively kills an existing connection and prevents new connections to the host in question to be setup.

Posted in Technology | Leave a comment

PAM authentication for fun and profit

PAM is a pluggable authentication and authorization library for *nix based systems – think Linux, FreeBSD and even Mac OS X. Logging into your machine or a remote POP3 server or even certain web based applications, and your authentication credentials will almost certainly pass through PAM.

I was writing a POP3 server in Node.js and had to authenticate user sessions via PAM. There is, of course, the chkpasswd and unix_chkpwd utilities which would work, but I didn’t want to spawn off a separate child process for authentication. Using DJB’s checkpassword utility suffers from the same problem.

In the end, I decided to write a native C++ Node.js extension that would link against libpam’s interface. Here’s the code for your reference.

It is out of the scope of this blog post to discuss how PAM works. There are many resources on the web that can give you a background on PAM:

As a rule of thumb, before testing your app, get the PAM service file right to avoid having to debug both your app AND your PAM service file. I used Fedora’s standard system-auth service file (which sits in /etc/pam.d/system-auth) which worked great out of the box.

#%PAM-1.0
auth        required      pam_env.so
auth        sufficient    pam_fprintd.so
auth        sufficient    pam_unix.so nullok try_first_pass
auth        requisite     pam_succeed_if.so uid >= 500 quiet
auth        required      pam_deny.so
 
account     required      pam_unix.so
account     sufficient    pam_localuser.so
account     sufficient    pam_succeed_if.so uid < 500 quiet
account     required      pam_permit.so
 
password    requisite     pam_cracklib.so try_first_pass retry=3 type=
password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password    required      pam_deny.so
 
session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
-session     optional      pam_systemd.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so

Here’s some simple code in C to authenticate off PAM:

#include <security/pam_appl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
struct pam_response *reply;
 
int null_conv(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) {
 
        *resp = reply;
        return PAM_SUCCESS;
 
}
 
static struct pam_conv conv = { null_conv, NULL };
 
int main(int argc, char *argv[]) {
 
        int retval;
        char *user, *pass;   
 
        if(argc == 3) {
 
                user = argv[1];
                pass = strdup(argv[2]);
 
        } else { 
 
                fprintf(stderr, "Usage: login [username] [password]\n");
                exit(1);
 
        }
 
        return authenticate("system-auth", user, pass);
 
}   
 
int authenticate(char *service, char *user, char *pass) {
 
        pam_handle_t *pamh = NULL;
        int retval = pam_start(service, user, &conv, &pamh);
 
        if (retval == PAM_SUCCESS) {
 
                reply = (struct pam_response *)malloc(sizeof(struct pam_response));
                reply[0].resp = pass;
                reply[0].resp_retcode = 0;
 
                retval = pam_authenticate(pamh, 0);
 
                if (retval == PAM_SUCCESS)
                        fprintf(stdout, "Authenticated\n");
 
                else
                        fprintf(stdout, "Not Authenticated\n");
 
                pam_end(pamh, PAM_SUCCESS);
 
                return ( retval == PAM_SUCCESS ? 0:1 );
 
        }
 
        return ( retval == PAM_SUCCESS ? 0:1 );
 
}

Compile this as follows:

gcc -g -lpam -o chkpasswd pam.c

Run it as follows:

./chkpasswd myusername mypassword

Let’s go through the code section by section.

#include <security/pam_appl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

We first include a standard set of library header files. Importantly, note that pam_appl.h needs to be included.

int main(int argc, char *argv[]) {
 
        int retval;
        char *user, *pass;   
 
        if(argc == 3) {
 
                user = argv[1];
                pass = strdup(argv[2]);
 
        } else { 
 
                fprintf(stderr, "Usage: login [username] [password]\n");
                exit(1);
 
        }
 
        return authenticate("system-auth", user, pass);
 
}

This bit is really just boilerplate code to get username and password from the user. I’ve hardcoded the service name (“system-auth”) but you should probably change it to a user-defined argument. Important bit is in the authenticate() function.

struct pam_response *reply;
 
int null_conv(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) {
 
        *resp = reply;
        return PAM_SUCCESS;
 
}
 
static struct pam_conv conv = { null_conv, NULL };
 
int authenticate(char *service, char *user, char *pass) {
 
        pam_handle_t *pamh = NULL;
        int retval = pam_start(service, user, &conv, &pamh);
 
        if (retval == PAM_SUCCESS) {
 
                reply = (struct pam_response *)malloc(sizeof(struct pam_response));
                reply[0].resp = pass;
                reply[0].resp_retcode = 0;
 
                retval = pam_authenticate(pamh, 0);
 
                if (retval == PAM_SUCCESS)
                        fprintf(stdout, "Authenticated\n");
 
                else
                        fprintf(stdout, "Not Authenticated\n");
 
                pam_end(pamh, PAM_SUCCESS);
 
                return ( retval == PAM_SUCCESS ? 0:1 );
 
        }
 
        return ( retval == PAM_SUCCESS ? 0:1 );
 
}

Here’s the important bit. You start by calling pam_start() and pass it the service name, the username, the conversation function and a handle for subsequent calls to pam.

Here’s where it gets interesting. The conversation function is used for direct communication between a PAM module and the application. The PAM module may prompt your application to ask the biometric credentials, for example. Applications must provide the conversation function. Examples on the web use misc_conv() which is a supplied function in pam_misc.h. The problem with using misc_conv() is that it will prompt the user for a password through stdin, which is not the behavior we want (we already have the password!).

So, we write our own conversation function (note that if you’re using a system that uses OpenPAM, you could easily use openpam_nullconv(). Our implementation of nullconv() effectively does nothing and returns PAM_SUCCESS. We then update the reply data structure to hold our password, and call pam_authenticate() to authenticate our credentials. Voila, it works!

Importantly, note that PAM free()’s the pointers (other then those set by pam_putenv()).

Posted in C, Code, Node.js, Technology | Leave a comment

Auto web account creation for lazy bunts

I sign up regularly on new web apps. Invariably, the sign up process requires certain standard data: email, username and password, at the very least. Typing this information in over and over again becomes tiring at some point. Expecting organizations to keep the information private and secure is asking for too much, given the past history of the web.

OpenID tried to fix this by allowing users to use existing accounts. It was successful to an end in that it was an SSO system that actually worked. Never actually took off in a big way, but it worked. Importantly, by not taking off in a big way, it showed the importance of keeping integration simple. Facebook and Twitter sign in buttons have now become the de-facto SSO for the web, in part because they are incredibly simple and with tons of documentation and libraries in place to help developers perform the integration. OpenID, Facebook, Twitter and all the SSO solutions out there solve the single identity problem when logging in, and as a nice consequence, reduce the “create account” friction.

Yet, I don’t quite use Facebook extensively and I don’t like giving applications access to my Twitter account. In addition, I don’t find it a problem to log in but rather, in creating the said account in the first place. I’d really like an even simpler solution: for my browser to fill in the relevant fields based on predefined values. For example, I’d like my username to be “ditesh” or “diteshkumar” or “ditesh.kumar”, my name to be “Ditesh” etc.

A JSON data structure representing this is easy enough to build:

{
  "name": "Ditesh",
  "password": "somepass",
  "email": "ditesh@gathani.org",
  "username": ["ditesh", "diteshkumar", "ditesh.kumar"]
}

Add more fields as you see fit. The browser extension autofills signup forms with this information. HTML5 custom data attributes can help by allowing developers to specify which fields to associate with the JSON elements, eg:

<form>
    <input type="text" name="username" id="name" data-name>
    <input type="password" name="password" id="password" data-password>
    <input type="email" name="email" id="email" data-email>
    <input type="text" name="username" id="name" data-username>
</form>

For sites that don’t use HTML5 custom data fields, the browser extension can make intelligent guesses and prefill accordingly.

Posted in Uncategorized | Leave a comment

Group Buying for the Masses

The online group-buying model is turning out to be big business. In 2010, the most popular group-buying site, GroupOn.com, made USD$713 million in worldwide revenues and in 2011, revenues are estimated to be on the scale of USD$3-4 billion. In its recent IPO filing, GroupOn states that revenues grew by 22.7 times in 2010 with an estimated 83 million subscribers across 43 countries. Given that GroupOn is only two years old and already doing spectacularly well, it is estimated that its IPO will eclipse even that of Google’s (which was the record setter for a decade, until LinkedIn’s recent IPO).

The online group-buying model, in its most common implementation, puts up daily deals for interested users to buy. However, to qualify, a target of minimum number of buyers within a set period of time must be met. Interested buyers provide their credit card details upon registering their interest to purchase the deal but the actual financial transaction only takes place upon reaching the minimum targets, at which point the buyers are charged and provided with the details on how to make good on their purchase.

Effectively, the model provides an ability for retailers to tap into the online consumer market whilst simultaneously reducing their risk on quality discounts and sales promotions as the group-buying site provides an assurance contract for buyers and sellers of the deal. The group-buying site takes a cut of the deal generally at 50% or more of the total deal value. The popular deals tend to be lifestyle focused deals although the business model works well for a large class of deals.

Group buying is related, in a form, to social networking, and hence the following digression.

Social Networking vs. Social Sites

There is a distinction between a social networking site and a social site. The former focuses on using existing relationships established “offline” to rebuild online relationships, whereas the latter uses common overlapping interests as a base to build new online relationships. Social networking sites focus primarily on private messages, chat and comments as a form of interaction, whereas social sites focus on content as a primary form of interaction between members.

The phrase “stranger networking” succinctly describes the latter and many sites have provided capabilities for strangers to network based on common interests in travel and lifestyle. Examples include CouchSurfing, Yelp, reddit etc. As such, a lifestyle social site requires two main focus areas:

  1. providing a content platform for members to share lifestyle related content
  2. providing a social commerce platform for members to buy (and sell) lifestyle products

Content Platforms

Content and review platforms have primarily used advertisement driven business models. Yelp is an excellent example of an advertisement driven lifestyle social site. Their tagline emphasizes finding great local businesses but the actual user contributed site content is far more extensive than one would imagine from their tagline. There is great coverage and exposure on every aspect of lifestyle related services and products. The extensive content drives visitors to Yelp, which drives the Unique Visitor (UV) metric, which in turn drives their ad sales. In 2010, Yelp is expected to report a revenue of USD 50 million from ad sales.

Blogging and discussion sites, on the other hand, have used the freemium business models. Examples are numerous, from reddit.com (a social discussion site) to Slashdot (the eponymous technology site) to hosted WordPress service.

Both business models have proved to work well, as long as UV and visitor retention rates remain high. As such, these business model don’t offer explicit unique selling propositions to the user but instead depend on brand loyalty, high quality content and a high degree of user interaction to remain profitable.

Commerce Platforms

Content and reviews are only one part of the equation when it comes to building lifestyle social sites. The second part of the equation is in providing a mechanism for users to buy and sell lifestyle related products. This is an area many existing social sites have failed to leverage as a business opportunity until fairly recently, when the GroupOn-flavoured group-buying business model proved to be successful.

Whilst group-buying models are not new, the genius of GroupOn’s business model was in extending the idea of “stranger networking” to its logical extreme and marrying it with existing group-buying models. GroupOn realized early on that the Internet allowed for anonymity in group-buying and structured the online group-buying model in that manner – everybody who signs up to GroupOn immediately qualifies for the deals and deal buyers remain complete strangers to each. As such, the limits of group-buying power leveraged in the real world did not exist in the GroupOn model.

In addition, by doing away with the complexity of social networking and focusing on stranger networking in its strictest sense, GroupOn allowed users the freedom to group together and buy deals purely anonymously and to the mutual satisfaction of each and every group member as well as the deal seller.

GroupOn entered the social fray quietly and grew at an unprecedented rate, establishing its dominance before anybody realized its impact on the online retail space. They have become the dominant player and have been extending their reach worldwide by buying up local operations.

Local Flavours

In Malaysia, consumers have responded positively to the introduction of local deal sites with an estimated 5,000 users signing up daily on local sites. GroupOn acquired Malaysian run Groupsmore which are expanding at a rapid rate of 3000 users per day and have sold close to 80,000 vouchers to deals with an estimated RM4 million in revenue thus far. In Singapore, GroupOn acquired Beeconomic.com. GroupOn is targeting for dominance in the South East Asian market by having local companies drive overall company strategies in the respective countries.

Another startup which has gained significant number of users is DealMates. It operates under the umbrella of the Catcha Group, is in its 4th month of operation, and has gained over 100,000 members. There are rumors that MOL is planning to launch its group-buying site.

Other then the larger sites, the smaller Malaysian players are estimated to number at 35 companies, each with an estimated 5,000 signed up users or less. As such, the current group-buying market is very fragmented as it is a nascent but rapidly developing market.

Global Flavours

Worldwide, the technology giants Facebook and Google have both realized the potential of group-buying and are leveraging their respective strengths in pushing into the market. Facebook is leveraging on its geolocation facility, Facebook Places, to drive location-based deals to its users. Facebook deals are currently available in Canada, France, Germany, Italy, Spain and the UK. There is little doubt that, in time, Facebook will use its social networking capability to further maximize deals sold within closed groups of friends, an opposite strategy that GroupOn has undertaken.

Google, on the other hand, does not have a strong social presence. It recently launched Google Offers in limited number of cities in the United States, and the exact mechanism behind Google Offers is not entirely certain at the moment. If one is to make a bet on their approach, it would be that they would put their world-class technical minds to work on the best algorithmic approach to optimize deal structure and pricing. Hence, with Google Offers, it may not be a case of the merchant setting the price and minimum targets, but Google’s algorithm setting the parameters for a deal. Depending on their implementation, they may actually win out because maximizing revenues from the deals is a classic algorithmic optimization problem, one that Google particularly excels at solving.

Opportunities

Current group-buying sites have generally focused on service and dining businesses. However, the group-buying model works well for many forms of deals – be it airline tickets, hotel rooms, computer gadgets, furniture and so on, so forth. Specifically, group buying in the area of leisure and travel have not received significant attention and as such, provide a growth area in the group-buying space as leisure travelers are always looking for great deals. Deals in leisure and travel include hotel rooms, on-ground tour packages, airline tickets, cruise tickets, entry tickets to tourists sites and places of interests and other such deals.

The savvy traveler in South East Asia looks for deals across the region, not just their country of residence. This means that travelers are looking for travel and on-ground package deals across South East Asia.

Targeted Deals

The current GroupOn targeting mechanism is weak as it does not differentiate between the interests of consumers. As such, offered deals tend to be of mass market interests and not sufficiently varied to be attractive to a larger market of consumers.

“Personalized deals” or “personalized coupons” can be tailor-made for consumers based on profile data collected through social networking profiles and thus provide the ability to deliver focused deals for consumers based on their interests. Furthermore, for repeat customers, buying patterns can be helped to tailor deals.

Secondly, most mobile platforms already understand geolocation and have the technology in place in delivering geo-targeted deals. Geo-targeted deals significantly increases deal conversion rates as the deals are not blindly sent to signed up users.

Refining the business model

There have been interesting takes on this model. Most interesting is the ability for anonymous groups of people to band together to get distributors, suppliers or retailers to provide them with better prices on specific items. If the distributor/supplier/retailer agrees to the price, the deal goes through. Again, the site facilitates payment and provides the buyers with full details on contacting their seller.

The key observation here is that the group-buying site does not get involved in the logistics of ensuring the item gets delivered, or handling refunds, or ensuring items meets the expectations of the buyer. Responsibility on ensuring the reputability of the seller belongs solely to the buyer, and in converse, the responsibility of ensuring the purchased items are correctly delivered or redeemed, belongs to the seller. The group-buying site only remains a financial and crowd sourcing facilitator.

And that’s the end of this round of a mental core dump :)

Posted in Business, Malaysia, Technology | Leave a comment

Driving Miss Daisy

I was driving home yesterday and almost got into an accident. It was a t-junction and I was driving up north the long end of t he T. As I was approaching the junction, I noticed that a car was parked on the shoulder of the road as the road curved left. It was impossible to see oncoming traffic. So I slowed down, as is my wont, and started preparing mentally to take the curve[0].

Just as I was about to take the turn, a brightly colored red car zooms out. I immediately put on the brakes – it was a close call – and wait patiently for the car to pass. Driving at high speeds in residential neighborhoods is a big no-no as it is in parking cars on road shoulders such that line-of-sight is affected. But no matter. Such behavior is common in Malaysia and I was working on an interesting problem mentally, so no reason to honk the horn or get upset with inconsiderate/not-quite-safe driving.

Here’s where it gets interesting. The car was being driven by a woman who had two kids in the car. She slows down the car, honks the horn loudly, gives me the finger, stares at me and mouths some profanity whilst driving off slowly. I let her drive off without attempting to set the record straight that she was in fact in the wrong.

I don’t agree with her reasoning in getting upset, but I can at least understand why she got upset. At the speed she was driving at, she would have gotten in a major accident. There is good chance the kids were not belted in (only 10% of backseat Malaysians belt in) and thus, there was risk of serious injury to them. That would be enough to get anybody upset, even if they were in fact in the wrong.

What I don’t understand is the lack of civility. What was the need to be profane? Especially in front of the kids. They will grow up with the impression that profanity is a normal part of being civilized. It’s not, and such cultural grounding is a dangerous handicap to have as Malaysia becomes increasing sophisticated. Bad parenting, if I may say so.

What was the correct thing for her to do? First, belt up. Second, never drive fast in residential neighborhoods. Thirdly – well – accidents can be traumatizing and having been driving a car for many years, I’ve witnessed many accidents. Here is some advice to anybody who gets into a serious accident in Malaysia:

  1. Don’t Panic. Can’t emphasize this enough. If anybody is hurt (including yourself), get help! Can’t emphasize this enough. Physical safety comes first. Make sure the other driver is not injured.
  2. Get details of the other driver and car (registration number, make, color). Write down street names. If the other driver is an ass, don’t bother talking to him/her.
  3. Call your insurance company. They will send an affiliated car-workshop company. To avoid voiding your insurance, don’t move your car (but some judgement call is required here – I generally move the car to avoid causing jams on busy roads).
  4. Wait until the chaps arrive. Ignore all workshop touts. Whistle to pass the time.
  5. They will tow your car to the police station. Make the police report. If its your fault, admit as much – you will pay a fine of RM300 and come away with an emotional and financial memory that will work as a mechanism to ensure you drive more safely in the future. The police will also take pictures of the car.
  6. Go home and have some tea. Chill for a bit and let yourself calm down.
  7. Deal only with your insurance company from this point on. Chase them to get the car done up and returned to you – they have little incentive to be fast, so you got to keep pushing them.

[0] A lot of this happened sub-consciously. My conscious brain was chewing on some math.

Posted in Malaysia, We can do better | Leave a comment

Landscapes in 1080p

Lovely view from space. Be sure to set it to 1080p.

Posted in Science, Space | Leave a comment

What’s in a CNAME?

In a bid to make payment for Unifi, I tried accessing the site at unifi.my. Chrome informed me that DNS resolution for unifi.my had failed.

I ran a quick test:

[ditesh@rhea] dig A unifi.my
 
;; QUESTION SECTION:
;unifi.my.			IN	A
 
;; AUTHORITY SECTION:
unifi.my.		10800	IN	SOA	ns1.tm.net.my. dnsadm.tmnet.com.my. 2010080309 10800 3600 604800 86400
 
[ditesh@rhea] dig CNAME unifi.my
 
;; QUESTION SECTION:
;unifi.my.			IN	CNAME
 
;; AUTHORITY SECTION:
unifi.my.		10800	IN	SOA	ns1.tm.net.my. dnsadm.tmnet.com.my. 2010080309 10800 3600 604800 86400

Unifi is Malaysia’s largest (and defacto) fiber-to-the-home provider. Putting an A or CNAME record on their domain would be nice.

Chrome fortunately anticipates this and upon successfully hitting up www.unifi.my, it automatically redirects unifi.my to the www. subdomain.

Posted in Malaysia, Technology, We can do better | Leave a comment