2012-09-15

Doraemon, Big Sister (I mean, Monchhichi) is watching you!

Oh! Our poor little Doaraemon, beware!
Big Sister (Monchhichi) is watching you!!!

積分表 公式 1-20

(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)
(19a)
(19b)
(20)

I love formula


從書櫃找到徐桂芳編譯的【積分表】,是中學時代的工具書,看看內裡的公式,令我重拾對公式的興趣,在網上找找,已有很多的 Formula Editor 和 Math Markup Language Processor,其中我發覺 CodeCogs 的 Equation Editor (link) 比較容易用,如以下公式(7)



就是只用

<img src="http://latex.codecogs.com/gif.latex?\dpi{120} \int \frac{dx}{1+x^{2}} = \tan^{-1}x" title="\dpi{120} \int \frac{dx}{1+x^{2}} = \tan^{-1}x" />

我會嘗到將書內的公式在以後的blog發放。

2012-09-13

Another severely wrong percentage figure quoted by Hong Kong newspaper

On 2012-9-12, MetroHK reports as follows (link):

護士警察自殺率達20%
失業人士常被視為自殺風險較高,但原來在職人士的自殺傾向亦不容忽視。香港大學防止自殺研究中心總監葉兆輝表示,20至59歲的在職人士中,每10萬人有7.83人自殺,顯示自殺情況值得關注,
當中護士及警察的自殺率,較整體自殺率高約20%。
根據死因裁判庭於2003至2010年的數據,每年自殺案件中,有30%為在職人士,宗數約300宗,當中70%為男性,分別有逾四成人有精神及財政問題。
葉兆輝表示,數據分析顯示護士及警察的自殺率偏高,自尋短見的警察個案中,44﹪受債務困擾;而自殺護士中,則逾半未婚。
葉兆輝估計,他們顧忌作為照料者角色,或怕影響升遷,故不願主動求助,建議他們要正視壓力,僱主要多加體恤。


From the headline, it says the suicide rate of nurses and policemen reaches 20% (which let me think 1 out of 5 of people in these group will commit suicide. However, when you further read the lines, it just says these group is just 20% HIGHER than average (the average figure is 7.83 per 100k) How comes this kind of mistakes repeatedly occurs on local newspaper?


P.S. On 2012-9-13, MetroHK makes a low profile correction as follows (link):
醫護自殺率稍偏高

港大防止自殺研究中心調查發現,在職人士的自殺傾向不能忽視,據死因庭03至10年度數據,每年所有自殺案件中約有30%為在職人士,近300宗,在職自殺人士中,護士及警察這兩個行業的自殺率較高,
較整體自殺率高約20%,中心建議市民正視壓力問題,僱主應多體恤員工。

2012-09-11

Hong Kong Miniatures


Recently I try to use Flash tool to show the album. Hope you like it.

2012-08-26

Using BoxCryptor on Netvigator uHub

One of the concern of cloud storage is the security issue.  BoxCryptor addresses this point by automatic file-based encryption.  However, its target is the local mirror of the web drive.  Recently I have installed PCCW Netvigator uHub cloud storage service.  However, as different from Google Drive, Dropbox or Microsoft Skydrive, uHub lacks the local mirror directory.  This blog describes how I overcome this problem and let BoxCryptor work with the uHub service.

After installing uHub, you will find a virtual folder under "Computer".  However, when you try to create a new BoxCryptor folder on this virtual uHub folder, you will find the "OK" button is dimmed (as in the diagram below), meaning that you cannot do this directly.


So, I first map this virtual folder to a network drive (right-click context menu as follows):


Then you can click "Connect to a web site..." 

At the internet address, you type "https://uhub.netvigator.com/webdav". I know this address because if you install uHub onto Windows XP, this address is shown on the virtual folder.  Ironically, the procedure mentioned in this blog does not work on Windows XP because Windows does not support network drive mapping with https.


Then you can input your uHub username and passwor in the dialogue below:


Afterwards, click finish as follows:


Now back to the BoxCryptor dialgoue, you can create a folder at the drive U (U is my webdav uHub drive)


Then you have two additional drivers: U the native uHub network drive, while Z is the new BoxCryptor drive:


2012-08-13

Big Calculator (Windows version)

I hate the calculator bundled with Windows, because its buttons and display are too small.


In fact, what I need is:
  • a simple calculator with 4 arithmetic operations
  • large buttons
  • large display digits
Recently I have installed Calc98 (link) and customized it to suit my above needs.



The steps is as follows:

(1) Remove the Functional Keypad by specifying the number of rows to zero:


(2) Specify a bigger Main Keyboard by specifying very large values of Width and Height:


(3) Last but not the least, download a LCD font and specify it in the main option page:







2012-04-29

Ken Burns effect using Java Applet


Months ago, I feel fascinated by the panning and zooming effect of displaying photos on video.  Later on, I know this is called Ken Burns effect, after the "inventor" (see wiki).

I want to implement similar effect on web page photo album.  However, I cannot find any free flash tools.  Then I ask myself: why not write a Java applet myself? (Inconvenient fact: I do not know anything about flash programming.)

Then I start my journey of exploring Java API on graphics.  My first version is using the java.awt.Graphic class, which is natively included in applet since day 1.

The pseudo codes are very simple as follows:
  • load the jpeg file (by the way, I do not like the lack of control of the default MediaTracker and has created a new class imageretriever using SwingWorker)
  • start a thread which periodically update the graphics
  • the thread uses the Graphics.drawImage method which supports the scaling


However, I find that the painting is not smooth (the upper left is updated first and the lower right portion is updated later - this phenomenon is more prominent for large display area.

Later on, I find this phenomenon can be overcome by the "Double Buffering" technique.  So, instead of directly calling Graphics.drawImage, the pseudo codes are changed as follows:
  • create a BufferedImage object, which is derived from getImage from the original image
  • since I find that the BufferedImage so created is not a deepCopy of the original, further scaling will affect the source, I further created another BufferedImage and use Graphics2D.drawImage to "copy" the source
  • finally use Graphics.drawImage to paint the scaled image to the applet


To my disappointment, I find that the gradual scaling on some fine-grained image has the so called staircase effect.  Therefore I further try to use the Bicubic interpolation to "blur" the zoomed image.  But the effect is not very satisfactory.

The result can be found at here.  Because the applet window is not large, the reader may find the difference is not very significant.  

2012-04-15

小燈塔



時常發光在海中提點船隻的小燈塔,大陽伯伯沒有忘記你,讓夕陽餘輝照耀你一會兒。