[Solved]Lag issue with meteor and stuck at loading

Meteor is the web framework that I have been learning for past few weeks. It is powerful and easy to learn but some functions are still under-developed hence some bugs.

When playing with the Todo List example, I discovered a bug in the example. The example has a function to display a “loading text” in item panel when the user selects a new list and the corresponding items are being loaded from database. However, if the user switches between the lists very fast and selects the next list before the current list is loaded, the item panel will be forever stuck at loading. This may not be a issue when running on a local server but it would be much more serious if the Internet connection to server is slow.

I am not entirely sure of the cause of this problem but it has to do with how DOM elements are updated when the variables get changed. For some reason, if the Meteor.subscribe() method does not return before the next execution, the DOM elements will not be updated.

I solved this issue by using a session variable, which is altered when new list is selected. In this way, a selection of new list will always trigger the change in session variable and hence update DOM accordingly. Below is the relevant code modified by me:

This technique is related to meteor’s reactivity, here is the reference on Reactivity for meteor.

On Google again, with DuckDuckGo

A few days ago I posted a blog about how important Google really is, as a search engine. Apparently I was not the first one to discover that Google is not that great after all.

It turns out that there is this search engine called DuckDuckGo that existed for several years. I read it on Hacker News and here is a link about it.

Basically, it offers instant answers to the queries instead of links to other websites, although the instant answers are from other websites. Google apparently has similar features now so that is not really the most important feature of the search engine.

This search engine put much more emphasis on user’s privacy. It does not track search records, or IP addresses, it also has no user account system. Hence, it became quite popular for privacy-conscious people.

Anyway, I learnt something today and hope it goes well for this DuckDuckGo. However, I prefer to stick to Google for the exact opposite reason: It has my data. I believe in the customized searching experience in Google based on my profile, although it often means I need to see ads that are “relevant” to me.

On Whatsapp and the less known Tencent QQ

Recently the news on WhatsApp being bought by Facebook is all over the place, it seems to be a big deal. As a user of WhatsApp for about 2 years or so, I went ahead and posted about “how shocking” I was when I learnt that the messaging “giant” had been bought by the SNS “giant”.

However, when I really think back on WhatsApp and its exact features, something else came to my mind. It is the messaging application that I have been using since about primary 6 back in China – Tencent QQ. And surprisingly, or rather not, I realized that it is technically much more older than WhatsApp but with all the functions that WhatsApp provides.

QQ has all the basic chat functions, it also has a group chat function(QQ群) since 2000, which supports up to 500 users in the group, and within the group, you can send text, voice messages, pictures or even files to all the members. It appears that QQ group would be older and more capable than WhatsApp in terms of group chat functions.

In the beginning, QQ only runs on computers. However, that was the era when phones did not have coloured screen. By the time Nokia phones with its Symbian OS became popular in China, QQ has been able to run on Symbian OS. And when iOS and Android came out, respective QQ apps were also developed by Tencent to run on these platforms. So QQ also beats Whatsapp in terms of cross-platform compatibility.

So what is the exact reason that causes Whatsapp to be much more well-known(outside China) than QQ? Why people(outside China) did not use QQ before WhatsApp came out? I tried to come up with a few possible reasons:

Possible reason 1: Tencent’s Marketing strategy. We can safely assume that the Chinese market by itself is big enough for Tencent and it would not want to devote manpower and resources to market it outside China. (We can see that Tencent is now putting efforts to market its WeChat outside China and it is largely successful)

Possible reason 2: General impression and stereotypes on Chinese products. This could also be related to the general stereotypes that people have about Chinese products, i.e. unreliable, potentially linked to communist ideas. So even if Tencent did try to promote QQ outside China, it could have  failed because people just do not trust Chinese products.

Possible reason 3: The time factor. Maybe QQ was just not developed too early, not at the correct time to be successful. This happened to Microsoft when it tried to sell the idea of tablet way back before iPad. It could be that the need for instant messaging on mobile devices just came about in recent years. WhatsApp seized this this opportunity and cater to people’s need at the correct time.

Possible reason 4: WhatsApp is more focused and links to phone number: WhatsApp is only a messaging app, it does not come with other functions like QQ games, QQ pet or QQ show(a virtual avatar that you can modify like a Barbie doll). WhatsApp is also linked directly to the phone number so that it can get all the phone contacts on WhatsApp and act as a replacement for SMS for people with internet connection. This makes WhatsApp more professional as a messaging app. People can just enjoy messaging like sending normal SMS without distractions. After all, we are comparing them as messaging applications.

Possible reason 5: Ads. Ads is one significant feature of QQ, it appears almost everywhere unless you pay some kind of membership fee. This is arguably the preferred method of many apps nowadays, however, for WhatsApp , we see no ads at all and instead of paying the yearly subscription fee, somehow I can use it for free for over a year with my account automatically renewed.

That is all that I could come up with at this moment.  And I am not sure if they are sufficient to provide an explanation. Anyway, back to WhatsApp and Facebook time!

Add-on: On the topic of growth and expanding market internationally, here is a relevant answer from Quora.

How important is Google as a search engine, really?

When viewed in an inertial reference frame, an object either is at rest or moves at a constant velocity, unless acted upon by an external force.

– Newton’s First law

There is some issue with my connection to Google today. And surprisingly(or rather not surprisingly) there seems to be no problem in connecting to Bing. (And actually it is faster than I expected for displaying search result.)

This makes me think about the importance of Google, as a search engine. For all this time, I have been using Google as my default search engine, without wondering why it is default in the first place. Then I realized that the only reason I am not using other search engines like Bing or Yahoo right now is that I am used to Google. I am totally unsure of how Google is better than other search engines. In fact, I know that other search engines have their advantages over Google, for example, Bing gives the answer for gcd function in search whereas Google does not. How exactly does this “default” habit help Google to be the No.1 search engine?

In times of break-down like this, I would not hesitate to switch to an alternative search engine. Afterall, the information that I am looking for is on sites such as Quora, Facebook or Wikipedia, not on Google. It is just a tool for me to get to the destination that I wanted, and when one tool breaks down, why not just take another tool, knowing that it would work equally well?

Perhaps that is reason why Google is spend resources on Android, Google+, YouTube and more recently Google Glass. Being the default search engine now does not guarantee the default search engine forever, in fact, it is hardly the case. What is really needed is an ecosystem that make people depend on Google, not just in terms of searching. People are using Google’s different services, like Gmail and Google Calender because of the benefit of this whole integrated data and user experience.

The irony is that Google is so slow right now that I have to use Bing to get this image

The irony is that Google is so slow right now that I have to use Bing to get this image

In the end, I feel that Google, as a search engine, may not always be the default for people. When it fails at times, people may consider changing it. However, if the ecosystem of Google, the whole package of services, become the default for people, it will be much harder for people to switch. Even if some major disruption happens, people may still want to stick to Google, where they store all their data.

Data really means a lot. For me, all the data I stored in Google may be sufficient to create an identity for me.