Trace Temasek & GIC Public Equities Investment

Sometimes when I study the market timing skills of some so-called greatest investment funds, I am very surprised that they could fail so much even by their almightiness.
I will track some suckers that Temasek and GIC have made so far from public information. GIC helps manage Singaporeans’ CPF, and is very mysterious and demonstrable in long-term strategies of equity investment.
I hope my statement holds true for a long time because I contribute 20%+ of my monthly salary to CPF.
My purpose here is trying to learn from their mistakes.


1. YASHILI: used to be very famous milk powder brand when I was young, but that’s 15 years ago. I don’t know how the management team produce their valuation, but obviously they didn’t choose to go to any big supermarket to access the publicity of this sinking brand. Now the young Chinese mostly know Mengniu, Yili, and Wahaha. You can just take the Mother, why you choose the fallen son?



2. Daphne: used to be top brand in selling female shoes in Mainland China. If you visit their big shops in Shenzhen, there have less shoppers than others, and their price range are quite high.

News 1 (2013): 大市出現恐慌性拋售,開始吸引基金入場撈貨。新加坡政府投資(GIC)於6月20日以6.143元均價買60萬股達芙妮(210),持股量首度達到5.02%(8,373萬股)之須披露水平,以昨日收市價6.19元計,市值5.1億元。

News 2 (2013):  据联交所股权资料,达芙妮(00210)在10月31日,遭新加坡主权基金GIC场内减持67.2万股 ,每股平均4.065元,好仓由 5.03% 降至 4.99%。

What are you doing ? If you have such confidence to buy many, why don’t keep buying ?


I am not sure the average cost of their 4.99% of total shares, but unless they bought them before 2006 or some where during 2008-2009 crisis, I have 90% confidence to say that this is a sucker.

3. China Southern Airlines Co Ltd: 1055. Once the famous saying is never buy airline shares. They look good in avenue but never profit much from the business. Operating margin is too low. Its profit holds tight too much with oil price, which is unpredictable. Some one in GIC just ignored this, and bought awesome amounts of 1055 recently.(wholly shit!!! Did they bet on oil price plunge ??? till Nov 28, this tick had 26% soaring. )


Map Cluster Layer Heuristics Algorithm

I am implementing an Cluster Layer with heuristics algorithm  based on Google Maps JS API with reference to MarkerCluster.

It works like this:

1. Set a maximum zoom level Max

2. If map.getZoom() > Max, remove the cluster layer, and display the original point layer

3. If map.getZoom() <= Max, remove the original point layer

If init load on minimal zoom level, query all points out, and store on client side, later use this data to Filter cluster layer markers based on map.getBounds(), i.e. map extent

If map load on between minimal zoom level and Max, query data based on map.getBounds()

4. Filter function

a. get xmin, ymin, xmax, ymax from the map bounds.

b. filter points within the map bounds to redraw Cluster Layer

Web Analytics Design

I know that Google Analytics and Piwik are great tools to perform web analytics, but either of them can meet my requirements fully.

My web app is live in the company intranet only, and no IP is allowed to expose to the internet. Hence, Google Analytics is out of choice. Piwik can work partially for my scenario, however open source technology is not supported by company directors, and some critical requirements can not be fulfilled by Piwik.

I am going to construct my own module to achieve this web analytics goal.

Management View Requirements:

  1. Users per day
  2. Which departments users from
  3. Average durations for users
  4. Most popular modules
  5. Which resource is most used
  6. Which tool is most used
  7. Search keywords

Development View Requirements:

  1. Most failed functional calls
  2. Most popular new requirements from users (A survey form)


Once user logged in, run a tracking function to store all required data, update data on user actions.

Avoid frequently query to database, store the number of functional calls in web app data, then send data to backend after user refresh page or logout.

Size of the collected data must be limited in size, and once reaching the limit, send to backend and then reset the data.

Internal functions need to be per-determined in keywords in order to reduce the size of collected data, and analysis purpose.

ArcGIS JavaScript Web Dev Experienc

I want to document all encountered bugs, tricks, and solutions  during my web development with ArcGIS JavaScript API. 1. BUG: Query.where use LIKE SQL statement not working after ArcGIS Server 10.22 Use QueryTask, set Query.where = ‘PARAMETER LIKE %VALUE%’ will cause error: {“error”:{“code”:400,”message”:”Invalid or missing input parameters.”,”details”:[]}} SOLUTION: use Query.text = VALUE,  but make sure the display name in your ArcGIS web service is the PARAMETER you need to query. 2. TRICK: handle multiple unknow Asynchronous QueryTasks  I have to indicate multiple identify tasks running status, e.g. display loading gif when identifying many layers, after all done, then hide the loading status. Or to say, I want all query tasks running as synchronous, once all done to execute my function. QueryTask is asynchronous, can use promises with dojo deferredlist. My solution is using jQuery.

var deferredlist = []; 
$.each(queryTasks, function(index,queryTask){
     var defer = function(){
      var def = $.Deferred();
        if (result){
         //show result}else{//show error
   return def.promise();
//after all done

3. SOLUTION: Get layer legend in plain Ajax from ArcGIS services You can use ArcGIS Legend widget to help you, but if you don’t like the default weird solution, here is one logic works in IE9+, Safari, and Chrome. You may need to add extra CSS to present legend nice.

var url = arcgis.mapserver.url/legend?f=json;
var layerIds = this.mapserver.layerids;
var dataType = (isIE() == true)?'jsonp':'json';
        if (data){
          var layers = data.layers;
                if(layer['layerId'] == layerId) {
                   var legends = layer.legend;
                       var label = legend.label;
                       var img = legend.url;
                       var imgSrc = url + '/'+legend.layerId+'/images/'+img;
                    $('#legend-div').append('<img src="'+imgSrc+'"/><span>'+label+'</span>') 
              //legend div to error msg
      error:function(error){ //legend div to error msg } });

4.KB: Tiled Layer, Dynamic Layer, Feature Layer, and Graphic Layer Tiled Layer is for ArcGIS map service which has pre-cached tiles in the server. Drawing on client is to request pre-generated image from server folders. Dynamic Layer is for ArcGIS map service which end with ‘/MapServer’, except cached service. Drawing is on server side per user extent query, sending image to the client to render. Feature Layer is for ArcGIS map service which end with ‘/MapServer/number’, having fours modes for quick rendering: MODE_AUTO,MODE_ONDEMAND, MODE_SELECTION, MODE_SNAPSHOT. Drawing is dynamic on the client side based on records query, and results are rendered in SVG. Graphic Layer is for general creation of customized graphic layer adding graphics to the map. You can set definitions to Dynamic Layer and Feature Layer to perform filtering function similar to SQL.

5. Search data points within selected point buffer distance
Say you already have thousands of points  retrieved from web service.
Then you need to perform a buffer on user mouse click on map, i.e. selected point. with distance 1KM.
Next you need to find out all the points within the buffer. You can use Geometry query to the ArcGIS server to get the results.
Alternatively, you can do a local search using the stored points.

After buffering done, you can get the extent of the buffer shape:  geometries[0].getExtent() from the buffer callback result.

var extent = gemoetries[0].getExtent();
var selected = point;
var result = [];
$.each(datapoints, function(value,index){
         var distance = esri.geometry.getLength(point,value);
         if(distance <= 1000){


6. Display graphic layer for different zoom level

For GraphicLayer, you can set minScale, and max Scale to let the map dynamically displaying itself when user zoom in/out.

see API:

var small = new esri.layers.GraphicsLayer({id:type,maxScale:72224});
map.addLayer(small);//when zoom in map scale smaller than 72224, this layer will not show
map.getScale()//to determine current map scale