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

小燈塔



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

2011-12-09

酒店ballroom華麗的燈飾

多多冷氣也不夠!

2011-11-17

Shared Stapled Units of HKT

PCCW is now launching IPO of the HKT Trust (Stock Code 6823). While the media coverage is mainly on the prospective yield of the new stock, I find, however, that not many people realize that the stock is offered as Shared Stapled Units (股份合訂單位). In other words, each unit comprises three components:

(a) A unit in the HKT Trust

(b) A beneficial interest of the specially indentified Ordinary Share in the HKT Limited

(c) A specifically identified Preferential Share in the HKT Limited which is "Stapled" to the Unit.


In fact, this complicated arrangement makes me feel dizzy.

In the prospectus, there is a dedicated section to stipulate why this complicated arrangement is adopted.

(a) The Trust structure can ensure an explicit profit distribution policy

(b) The Ordinary share can confer proper rights from the actual company (HKT Limited)

(c) The Preference share can confer proper rights in case of the winding up of HKT Limited or HKT Trust.


On the other hand, the following are the disadvantages:

(a) It is a novel and unprecedented structure in the HKT market

(b) There are administrative costs associated with the HKT Trust

(c) As the duration of the HKT Trust is a fixed period (80 years less one day), the procedures related to the terminating of HKT Trust is necessary.


Frankly speaking, after reading, I still have no clues why this complicated arrangement is necessary. (My slogan is 'Simple is Beautiful.) I understand that so far, the IPO has not aroused great interest from general investors. I am not sure whether or not they stay alert on the previous great financial skills (tricks) encountered.


2011-10-23

非常不滿區議會選舉選區劃分

又是區議會選舉的日子,家住將軍澳區,一直以來都不滿政府把將軍澳選區歸屬於西貢區!

將軍澳的都市化,和西貢的鄉郊狀態根本格格不入,但西貢區倚著地域廣闊,我不覺得有把幾十萬將軍澳居民的需要放在眼內,君不見西貢區區議會網頁在介紹西貢區地區特色有沒有提到一DD將軍澳區?

算喇,但連選管會在選區劃分也一塔糊塗,政府只是用簡單的居民人數分佈來劃分選區:

(Source)

但是,實際分界就有可能將一條街分成兩區,但又將兩個不相連的屋苑歸納於同一選區。大家可看看以下慘不忍睹的選區分界圖(部分):

原網址

這種盲婚啞嫁的小區設計,我不見得小區會有甚麼共同話題,以至競選區譏員的政綱都要提升到立法會的層次才找到最大公因數。

我住的是私人屋苑,相鄰亦是其他的私人屋苑,無奈何我住的是私人屋苑無端端被配到其他我政府屋苑,所以沒有候選人會以我的屋苑問題為政綱,可悲!

所以我正考慮投白票!

2011-08-13

Thandie Newton: Embracing otherness, embracing myself

Thandie Newton (wiki) delivered the captioned topic at TED (Video Link)

The transcript, which I like very very much, is posted as follows:

Embracing otherness, embracing myself

Embracing otherness. When I first heard this theme, I thought, well embracing otherness is embracing myself. And the journey to that place of understanding and acceptance has been an interesting one for me, and it's given me an insight into the whole notion of self, which I think is worth sharing with you today.

We each have a self, but I don't think that we're born with one. You know how newborn babies believe they're part of everything; they're not separate. Well that fundamental sense of oneness is lost on us very quickly. It's like that initial stage is over -- oneness: infancy, unformed, primitive. It's no longer valid or real. What is real is separateness. And at some point in early babyhood, the idea of self starts to form. Our little portion of oneness is given a name, is told all kinds of things about itself. And these details, opinions and ideas become facts, which go towards building ourselves, our identity. And that self becomes the vehicle for navigating our social world. But the self is a projection based on other people's projections. Is it who we really are? Or who we really want to be, or should be?

So this whole interaction with self and identity was a very difficult one for me growing up. The self that I attempted to take out into the world was rejected over and over again. And my panic at not having a self that fit, and the confusion that came from my self being rejected, created anxiety, shame and hopelessness, which kind of defined me for a long time. But in retrospect, the destruction of my self was so repetitive, that I started to see a pattern. The self changed, got affected, broken destroyed, but another one would evolve -- sometimes stronger, sometimes hateful, sometimes not wanting to be there at all. The self was not constant. And how many times would my self have to die before I realized that it was never alive in the first place?

I grew up on the coast of England in the '70s. My dad is white from Cornwall, and my mom is black from Zimbabwe. Even the idea of us as a family was challenging to most people. But nature had its wicked way, and brown babies were born. But from about the age of five, I was aware that I didn't fit. I was the black atheist kid in the all-white catholic school run by nuns. I was an anomaly. And my self was rooting around for definition and trying to plug in. Because the self likes to fit, to see itself replicated, to belong. That confirms its existence and its importance. And it is important. It has an extremely important function. Without it, we literally can't interface with others. We can't hatch plans and climb that stairway of popularity, of success. But my skin color wasn't right. My hair wasn't right. My history wasn't right. My self became defined by otherness, which meant that, in that social world, I didn't really exist. And I was other before being anything else -- even before being a girl. I was a noticeable nobody.

Another world was opening up around this time: performance and dancing. That nagging dread of self-hood didn't exist when I was dancing. I'd literally lose myself. And I was a really good dancer. I would put all my emotional expression into my dancing. I could be in the movement in a way that I wasn't able to be in my real life, in myself.

And at 16, I stumbled across another opportunity, and I earned my first acting role in a film. I can hardly find the words to describe the peace I felt when I was acting. My dysfunctional self could actually plug in to another self not my own. And it felt so good. It was the first time that I existed inside a fully-functioning self -- one that I controlled, that I steered, that I gave life to. But the shooting day would end, and I'd return to my gnarly, awkward self.

By 19, I was a fully-fledged movie actor, but still searching for definition. I applied to read anthropology at university. Dr. Phyllis Lee gave me my interview, and she asked me, "How would you define race?" Well, I thought I had the answer to that one. And I said, "Skin color." "So biology, genetics?" she said. "Because, Thandie, that's not accurate. Because there's actually more genetic difference between a black Kenyan and a black Ugandan than there is between a black Kenyan and, say, a white Norwegian. Because we all stem from Africa. So in Africa, there's been more time to create genetic diversity." In other words, race has no basis in biological or scientific fact. On the one hand, result. Right? On the other hand, my definition of self just lost a huge chunk of its credibility. But what was credible, what is biological and scientific fact, is that we all stem from Africa -- in fact, from a woman called Mitochondrial Eve who lived a 160,000 years ago. And race is an illegitimate concept which our selves have created based on fear and ignorance.

Strangely, these revelations didn't cure my low self-esteem, that feeling of otherness. My desire to disappear was still very powerful. I had a degree from Cambridge; I had a thriving career; but my self was a car crash, and I wound up with bulimia and on a therapist's couch. And of course I did. I still believed my self was all I was. I still valued self-worth above all other worth. And what was there to suggest otherwise? We've created entire value systems and a physical reality to support the worth of self. Look at the industry for self-image and the jobs it creates, the revenue it turns over. We'd be right in assuming that the self is an actual living thing. But it's not; it's a projection, which our clever brains create in order to cheat ourselves from the reality of death.

But there is something that can give the self ultimate and infinite connection -- and that thing is oneness, our essence. The self's struggle for authenticity and definition will never end unless it's connected to its creator -- to you and to me. And that can happen with awareness -- awareness of the reality of oneness and the projection of self-hood. For a start, we can think about all the times when we do lose ourselves. It happens when I dance, when I'm acting. I'm earthed in my essence, and my self is suspended. In those moments, I'm connected to everything -- the ground, the air, the sounds, the energy from the audience. All my senses are alert and alive in much the same way as an infant might feel -- that feeling of oneness.

And when I'm acting a role, I inhabit another self, and I give it life for awhile. Because when the self is suspended so is divisiveness and judgment. And I've played everything from a vengeful ghost in the time of slavery to Secretary of State in 2004. And no matter how other these selves might be, they're all related in me. And I honestly believe the key to my success as an actor and my progress as a person has been the very lack of self that used to make me feel so anxious and insecure. I always wondered why I could feel others' pain so deeply, why I could recognize the somebody in the nobody. It's because I didn't have a self to get in the way. I thought I lacked substance, and the fact that I could feel others' meant that I had nothing of myself to feel. The thing that was a source of shame was actually a source of enlightenment.

And when I realized and really understood that my self is a projection and that it has a function, a funny thing happened. I stopped giving it so much authority. I give it its due. I take it to therapy. I've become very familiar with its dysfunctional behavior. But I'm not ashamed of my self. In fact, I respect my self and its function. And over time and with practice, I've tried to live more and more from my essence. And if you can do that, incredible things happen.

I was in Congo in February, dancing and celebrating with women who've survived the destruction of their selves in literally unthinkable ways -- destroyed because other brutalized, psychopathic selves all over that beautiful land are fueling our selves' addiction to iPods, Pads, and bling, which further disconnect ourselves from ever feeling their pain, their suffering, their death. Because, hey, if we're all living in ourselves and mistaking it for life, then we're devaluing and desensitizing life. And in that disconnected state, yeah, we can build factory farms with no windows, destroy marine life and use rape as a weapon of war. So here's a note to self: The cracks have started to show in our constructed world, and oceans will continue to surge through the cracks, and oil and blood, rivers of it.

Crucially, we haven't been figuring out how to live in oneness with the Earth and every other living thing. We've just been insanely trying to figure out how to live with each other -- billions of each other. Only we're not living with each other; our crazy selves are living with each other and perpetuating an epidemic of disconnection.

Let's live with each other and take it a breath at a time. If we can get under that heavy self, light a torch of awareness, and find our essence, our connection to the infinite and every other living thing. We knew it from the day we were born. Let's not be freaked out by our bountiful nothingness. It's more a reality than the ones ourselves have created. Imagine what kind of existence we can have if we honor inevitable death of self, appreciate the privilege of life and marvel at what comes next. Simple awareness is where it begins.

Thank you for listening.

- End -

2011-07-19

Poor man's Outlook

I need to access my company's Exchange server at home. However, my home PC has not a valid Outlook license.

It is a pity some the open source email projects only endorse open protocol and do not bother to implement the proprietary Microsoft email protocol MAPI.

So far, I have resorted to command email client supporting POP3/SMTP to remotely access my company emails (not IMAP support yet).

Because of the limitation of POP3/SMTP, my email access at home is not working as a sychronized copy of my company email store.

For example,
  1. Using POP3, I must configure the email client to "keep the emails after downloading". Otherwise, when I check in my company email again, I will find some of my emails are removed from the inbox.

  2. However, I cannot delete any junk email or processed emails at home and keep my company inbox growing after long out-of-office period. Worst still, my company has set up an inbox rules that limit my email activities after the inbox has reached a certain size (an unreasonably low figure)

  3. If I need to send emails out at home, I must "cc" myself so that my company email has a replicate copy. This even makes my company inbox bigger and bigger.

  4. I cannot use the other Outlook "advanced" features, like Out-of-Office assistant

To solve problem (2), I now use Magic Mail Monitor to directly remove junk or processes emails at my company inbox.

To solve problem (4), I use MFCMAPI

But since my home PC has no Outlook, I need to download "Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1" first so that MFCMAPI can allow me to create a new Exchange profile. Please refer to the thread at serverfault.com