This is a Javascript demo of Merkle-Hellman Knapsack Cryptosystem. You can click all the “Generate” buttons from top to bottom, or specify your own private keys / modulo / multiplier. The length of the key is set to 16 bit.
Continue reading “Merkle-Hellman Knapsack Demo”
Spaces between Chinese and English Text
When typesetting with both Chinese and English (or other western languages), we may feel that they are squeezed too close together. In fact, a space is desired between Chinese and English texts. E.g., we prefer 中文 English 混合 over 中文English混合. This issue has been much resolved in Word or XeTeX (cctspace can be used for CJK in LaTeX to add tilde before and space after English texts), but on webpages, in Adobe Illustrator / InDesign and many other software, the manual adjustment can be tiresome. So I wrote a simple script to solve this issue. It automatically adds spaces between Chinese and English characters, remove spaces before and after Chinese punctuations as well as consecutive spaces. Hope this small tool can be useful to you.
Continue reading “Spaces between Chinese and English Text”
Trap of Yellow Light
China recently enacted a new regulation prohibiting drivers to pass the line during yellow light, which in my opinion totally defies the purpose of the light. Now I dread driving in China even more. I translated this piece into Chinese, just to add to the discussion. If you are interested to see the translated article, please switch to CHINESE.
Vacation in Cancun
The Decline and Fall of MSN as I See It
“We will retire Messenger in all countries worldwide in the first quarter of 2013 (with the exception of mainland China where Messenger will continue to be available).” says Skype’s Tony Bates.[1]
I am agog. I am aghast. Will MSN be gone at last? Well maybe I should not act too surprised at any move of Microsoft now as we’ve seen too much recently – a subversive Metro UI so disconnected with traditional Windows desktop leaving users scrambling around for programs in the start menu, or the dark-as-hell Visual Studio 2012 making any working day a gloomy one (and shouting to you with ALL CAPITAL menus). Still, MSN is different.
Rope cut in random
A Glimpse of Rio
Below are some photos from this rip to Rio. Great city. I’m too lazy to write this one again in English, so please just check the photos.
Seaside and Lagoa lake on an overcast day.
Pythagoras Tree
What kind of food scale do we really want?
Least Error Cartesian Meshing
This is actually the Project Euler problem of last week – I know it’s not good to post the answer of new problems here, but this is indeed a very intriguing problem. In short, the problem is as follows: Given a unit circle within radius of 1, we try to represent it by non-uniform mesh. N lines are inserted into the square [-1, 1] x [-1, 1]. Cells are colored red if they overlap with the unit circle, black otherwise. Find the way to make the red area minimum. Here is my solution on N = 16. Continue reading “Least Error Cartesian Meshing”