Tuesday, June 22, 2010

Blackberry spacer whitespace generator

I thought android was bad, but Blackberry is 10 times worst. I spent an entire day doing a simple UI. Its not even easy considering the useless API documents. Anyhow I came up with a whitespace method (in place of padding)

private BitmapField whitespace(final int width, final int height) {

Bitmap img = Bitmap.getBitmapResource("transparent.png");
return new BitmapField(img) {
public int getPreferredWidth() {
return width;
}
public int getPreferredHeight() {
return height;
}
protected void layout(int arg0, int height) {
super.layout(getPreferredWidth(), getPreferredHeight());
setExtent(getPreferredWidth(), getPreferredHeight());
}
};
}

Sunday, June 20, 2010

validation javascript

function validate(form) {

var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

if (document.getElementById("txtName").value == "") {
alert("Please input a valid name.");
return false;
}

if(reg.test(document.getElementById("txtEmail").value) == false) {
alert("Please input a valid email.");
return false;
}

if (!document.getElementById("chkAgree").checked) {
alert("You have not agreed to the terms and conditions.");
return false;
}

return true;
}

<form method="post" action="" onsubmit="return validate(this)">

5 Reasons why GoThere.sg is overrated

So Aditya and I was talking over lunch about mapping services and how Singaporeans (in general) do not use Google Maps. Rather, they (Singaporeans) are appalled by Street View when they first see it. Aditya went on and said, oh Singaporeans uses GoThere.sg but not Google Maps. I was like. Why? This does not makes sense. Aditya say, "its better". In what ways? I asked. Aditya said, it is "localized, e.g. you can search for chicken rice on it and they have their own maps which don't resemble Google maps." That phrase basically sparked a 30 minute intensive research by myself and the results in this post as follows:

So here are five reasons why it is overated:

1. Its buggy?
On first entry and just doing nothing but essentially "dragging".. I got an instant error "stack overflow". Most likely something is wrong with their Arrays.


2. It is a variation of Google Maps
Yes on first glance it looks different. But you can't trick the expert (look at what I found, the street view is completely the same). I digged a little deeper and found that creating gothere.sg is relatively simple. its basically KML. You can find out a little more about KML here: http://code.google.com/apis/kml/documentation/whatiskml.html



3. It does not find directions
I tried and tried and tried.. many combinations ranging from SMU to Boon Lay and Orchard road. I may have been typing the wrong keywords, but hey if the system can't even give proper instructions on how to find directions, how are you going to expect people to use it? Google is simple on this, two text boxes at the start of the page and you are all set.



4. I can't get directions to Johor
I love going into Johor, in fact most if not all Singaporeans drive/get driven there at some point in their life. Why limit their market to Singapore? I know, bowling pin strategy. But if you are already ripping the maps off Google, why don't you just rip the rest off?


5. Lacks contextual information
I must say, Google maps on the PC is still rather bad on this, but its moving in strongly in this area with the mobile phones. So for instance, an example of a missing contextual information is "time". When it calculates ERP, does it take into factor the time of the day and give you the cheapest route base on price? When it estimates time of arrival, does it takes into account weather and traffic? I may be better off sticking to my radio if they don't have such things.


-----------------------------------------------
All in all i felt that GoThere.sg has got some potential (not a lot). Why?

1. Low barriers to entry, from my experience. I am sure I can replicate this in less than a month with a team of four programmers.
2. It is hard to scale and replicate this 'success' overseas. Face it, try coming to the USA and you will be swarmed with Google Maps. Almost certain a flop if it comes to the US of A.
3. Crowded space, Google is moving strongly in this area. So is Microsoft and Apple. So the golden question is, will it be a take over target of Google or any of the Giants in future? My answer is - no. The Singapore market is too small for any of the giants to bother. Also, most importantly, there is nothing truly novel about their approach. Everything they have done was already done in Google Maps (transit fare calculation etc).
4. In fact the very nature of their existence is due to the existence of Google. So if Google (one day) decides that all companies that uses Google Maps will have to pay for it. They are going to be in trouble.

BUT..

5. It is the first company (other than streetdirectory) to create such things, created perfectly in time to fill that void that the company left. It uses a different map (but actually it is just google's map) and mashed everything up together. Honestly, it does save you time e.g. you don't have to find parking information elsewhere. But the question is this: "what is your value proposition?" Any body can just come in and create a mashup in no time, how much time can you save?

To summarize it all: Mr Lesmana, i am not still not sold by gothere.sg, i can also search for chicken rice on Google maps (you pretty much get the exact same results) also they are USING google maps, not their own map.

Saturday, June 12, 2010

Flex Mouse Cursor on Non Buttons

<mx:Image source="image1.jpg" useHandCursor="true" buttonMode="true" />