Category Archives: Tech Zone

Small facts about MS Office

– Docx equation editor does not automatically italize characters you if are entering with a non-Romanized input method, even if the characters you enter are alphabets.

– Excel .MMULT function requires the two inputs to have the same dimension. You can use it to multiply two 1-dimensional arrays or two 2-dimensional ones, but multiplying a 1D array with a 2D one will fail with an “unable to get the MMult property of the worksheet function class” error. The practical meaning of this is that if one of your input is just a vector, you still need to declare it as a 2D array.

Windows 10

Windows 10終於有內建多重桌面,感覺亦較一致。Start menu其實係縮小版嘅start screen。Cortana暫時無料到。

It has always bewilders me that Windows do not have built-in multi-desktop functionality. Now Windows 10 is finally going to have one.

Overall Windows 10 feel a lot more consistent throughout then Windows 8, which feels like a forced blend between a screen-friendly interface and traditional mouse-based Windows. For example, A lot more settings are now available in the Win8-styled “PC settings”, though the good-old Control Panel is still here. My guess is the latter will be gone in the release version.

Start menu is back…sort of. Microsoft essentially scaled-down the Windows 8 start screen to get a hybrid between the old and the new.

Cortana is pretty much just a shortcut to Bing at the moment, not much to see.

Powerline Network Adapters Hands-On

Most people have probably faced the problem of not being able to provide good Wi-Fi coverage for every room at home, and this problem is particularly severe in Hong Kong due to the use of concrete walls. In the past one would consider wiring the rooms with Ethernet cables or installing Wi-Fi extenders.  Today I am going to review a third option: powerline network adapters. They work by sending signal through electricity wirings, and units plugged into sockets under the same meter and will automatically form a network. To get internet access, simply connect one of the adapters to your broadband router with an Ethernet cable. Furthermore, there are Wi-Fi-broadcasting models that allow you to extend Wi-Fi coverage.

This hands-on features kits from two Chinese brands: a budget model from Tenda and a mid-range model from TP-Link. Budget models differ from higher-end ones in two major ways: First, budget models usually have maximum theoretically speed of 200Mbps, whereas higher-end ones have speeds up to 600Mbps. Since these numbers are theoretically limits, practical speed will only be a fraction of that, as my test results will show below. Second, high-end models sometimes have a pass-through socket that could be a life-saver if your room is in short of wall sockets.

Test models: Tenda P200/P201 kit (~HK$460) and TP-Link TL-WPA4230P Kit (~HK$650). Each kit comes with one cable-only unit and one Wi-Fi-broadcasting unit.

Test environment: Hong Kong Broadband 100M connection. Test conducted with speedtest.net with a Fujitsu Q584 tablet.

Basic installation: Easy. Both kits work immediately once I plug the included units into wall sockets.

Advanced Installation: you can build a network where devices roam between different Wi-Fi sources depending on their strength by setting the same SSID, encryption mode and password for all Wi-Fi access points on the network. The TP-Link unit has a button for automatically cloning my original Wi-Fi router’s settings via WPS, whereas for the Tenda unit I need to manually change settings via a browser. In practice I have never found WPS particularly easy to use, and it took several tries before the TP-Link unit was able to clone settings successfully. Furthermore, for unknown reasons I could not access the TP-Link’s settings panel the way the manual describe.

Speed: My HKBN connection has an average speed of around 60Mbps. Plugging the powerline units directly into wall sockets, I got the same speed with the TP-Link unit, whereas for the Tenda unit I only got 30Mbps at best. The results were the same regardless of whether I use an Ethernet cable or Wi-Fi, so the bottleneck is the Tenda unit itself. Speed drops dramatically if you plug the units into an extension cord—the average speed was only 3Mbps in my test.

Conclusion: Powerline network adapters present a very convenient way to extend your home network. Base on my test results, I would recommend spending the extra money to get the higher-end models due to the large speed difference.

識電腦硬件都知道,現時固態硬碟(SSD)價格平到一個地步其本上唔值得用普通硬碟開機。但係好多機構係唔明依點,覺得舊電腦慢就買新電腦,要最快嘅CPU最大容量嘅硬碟,偏偏就唔肯花錢買SSD。用唔夠幾耐,部機個普通硬碟用到慢晒,又再花錢買新機,完全係浪費金錢…

Those who are familiar with computer hardware knows that Solid State Drives are so cheap these days, there is really no reason to boot your computer with a traditional hard drive. Many organizations do not understand this point, and keep replace old computers with new ones that pair the newest CPU with a traditional hard drive. All too often, the new computer slows to a crawl and becomes a target for replacement itself.

 

PHP mysqli extension missing

I encountered this problem today and eventually I realize it was the comment on the line before the mysql dll’s that was causing the problem.

This is what you should have in php.ini by default for PHP 5.5.16:

;extension=php_exif.dll       Must be after mbstring as it depends on it
;extension=php_mysql.dll
;extension=php_mysqli.dll

Besides removing the semi-colons, you also need to delete the line of comment that came after php_exif.dll. This leaves you with

extension=php_exif.dll      
extension=php_mysql.dll
extension=php_mysqli.dll

This solves the problem in my case.

今個星期來得美國開會,當然要試試微軟新出的 Surface Pro 3。簡短的用後感:

– 比 Surface Pro 2輕了 100 克,拿上手明顯感覺得到,算是達至「很輕」的級數。
– 3: 2的比例和 iPad相似,很好用。 12 寸的大小很適合上課或工作用,隨身攜帶則太大了。
– 新的Type Cover很穩固,打字時一點也不會震動。
– 新的數位筆非常、非常的好用:邊位準確度高、筆觸自然流暢。想不到有這樣的一天,但我不得不說,今天N-Trig的筆比 Wacom還好。

 

Facebook收購Whatsapp

其實上星期就已經想談談Facebook收購Whatsapp,因為從教學角度看這實在是一個很好的案例。

首先,到底190億美元的收購價有多高?以Whatsapp一年一人一美元的收費模式,未計營運成本都要190億人年才能回本。就算有將來有十多億用家,這價錢還是需要數十年後才有賺。

我們也可以從另一個各度,看看科技業的兩大巨無霸—Apple與Google—在2013財政年度到底用了多了錢於收購上:Apple以14.07億買下最少七間公司,Google則以14.48億買下18間。這也就是說,Facebook在Whatsapp一間公司上所用的收購資金,比Apple加Google全年合起來還要多六倍。

Facebook願意以天價買下Whatsapp,當然是看中其4億5千萬活躍用戶。事實上,在發展一日千里的網絡,Facebook已經「out」了。只要觀察一下身邊的年輕人,就會發現他們對Whatsapp的投入程度遠超Facebook。去年從中大經濟系畢業的梁永行同學,畢文論文收集了同系同學用Whatsapp等即時短訊軟件的習慣。他除了證明各短件的新增用戶數目和現有用戶數目是有著正關聯—這是經濟學中所謂的「Network Effect」—還發現Whatsapp的增長放緩速度是一眾軟件中最少的。不過綜觀歷史,即時短訊軟件此起彼落似乎才是常態:ICQ、MSN不也曾紅極一時?

另一點值得留意的是,190億中有150億都是股票。有讀過企業財務的同學可能有學過,企業在自身估值高時會特別願意以股本作併購,因為每一股都代替了大量的現金資產。而以現時Facebook的110倍市盈率,相較Google的30倍以至Apple與Microsoft的13倍,肯定算是高了。如果大家相信Facebook估值過高,那它願意以同樣過高的價錢收購Whatsapp就不是那麼希奇了。

Apparent Theft at Mt. Gox Shakes Bitcoin World

Economists have for a while been asking whether Bitcoin is a good store of value, for reasons ranging from demand to ease of entry. Now a bigger problem emerged: security. The Mt. Gox closedown is the biggest incident so far, but it is far from the first (see https://bitcointalk.org/index.php?topic=83794.0#post_toc_17).

Even without the transaction malleability issue, I see one of the biggest attractiveness of Bitcoin—access to your money unfettered by government control—instinctively as a two-edged sword. If you want no one to monitor your actual identity, then no one is monitoring whoever-took-your-money’s either. As such, I really do not see why people would trust their private keys with service providers, but storing them privately is just as safe as putting your money under your mattress either.

 

Preserving Constants in a Stata Collapse Operation

Let’s say you have a variable that you know is constant within each group, what is the best way to preserve it during a collapse operation in Stata? You might think taking the first value (firstnm) must be the fastest, since it theoretically only requires 1 step per group. If that is the case, you are in for a surprise—Stata is actually better in calculating the mean.

Here are the simulation results for 100 groups of 1000 randomly generated observations, averaged over 30 runs:

collapse mean 0.0443
collapse median 0.1062
collapse min 0.0844
collapse max 0.0657
collapse count 0.0456
collapse firstnm 0.0473
collapse lastnm 0.0464

The measurements are reported in seconds. The relative speed is quite stable to variations in number of groups and observations. Base on my analysis of the underlying algorthims collapse uses, the reason why firstnm is so slow is that an order-preserving sort has to be performed on the data, and order-preserving sorts are slow relative to non-preserving ones. To confirm this is true, I ran the test with just one group of 100k observations:

collapse mean 0.0614
collapse firstnm 0.0508

And as expected, firstnm is now faster. The calculation of mean also slows down more than that of firstnm as the number of groups decrease.

Base on my simulations, calculation of mean is faster when there are as little as 3 groups, so mean is the way to go in most cases.