Tuesday, December 18, 2007

American Size of Stomach

I've been to America and got a rough idea about people's appetite there. For example, in McDonald's, a burger is about 1.5 times the size of a same one in Singapore. Yet I saw a guy swallowed two within 1 minute with one on each hand. A separate order of coke in another restaurant is 30cm tall. And I had to take away nearly the whole main course of a 20 dollar sea food order, just after finishing the soup and appetizer. This is no kidding. In doubt, try this one!

Cafe' Cartel, at Plaza Singapura. We went there for dinner on the way back from a Greek sculpture exhibition in the national museum. Five of us, two hadn't had lunch at all, another two had some light snack, in order to meet our meeting schedule. We walked in, already near half death out of starving and exhaustion.

HQ had been there before, he advocated the flagship "pork ribs", depicted in the picture below, without mentioning the doze. I ordered steak for a change of other 4 serves of pork ribs. The steak came first, normal sized 15x7 cm2 piece, plus some chips and vegetable, good for me. After another 10 minutes, the pork ribs finally showed up. Everyone's jaw dropped to the necks. They are not pork ribs, but piano boards (PB)! My steak was less than 1/5 of each PB, with the same price... To close, two of our usual big stomachs never felt full before, in a status without lunch, crashed upon this. One had to ask me to finish some leftovers, another one swept the whole, bearing the pain of standing up with a exploding belly for the rest of the day.

Wednesday, November 14, 2007

Mystery of life - INFJ

Starting job hunting recently, I realize it's really important to know myself better and identify a suitable career path I'm comfortable and passionate about. The first step, analyzing my personality -- resulted in the most rare INFJ (Introverted iNtuitive Feeling Judging) type, which is codenamed "idealist". Some quotations of this type are pasted below. I've already chosen the most suitable cuts, but still it turns out to be long. I'll try to highlight the central phrases or sentences describing what I am :-)

INFJ is a perfectionist who doubts that they are living up to their full potential. INFJs are rarely at complete peace with themselves - there's always something else they should be doing to improve themselves and the world around them. They believe in constant growth, and don't often take time to revel in their accomplishments. They have strong value systems, and need to live their lives in accordance with what they feel is right. In deference to the Feeling aspect of their personalities, INFJs are usually gentle and easy going. Conversely, they have very high expectations of themselves, and they don't believe in compromising their ideals.

They are generally "doers" as well as dreamers. This rare combination of vision and practicality often results in INFJs taking a disproportionate amount of responsibility in the various causes to which so many of them seem to be drawn.

Most INFJs are protective of their inner selves, sharing only what they choose to share when they choose to share it. INFJs hold a special place in the heart of people who they are close to, who are able to see their special gifts and depth of caring. INFJs are sometimes mistaken for extroverts because they appear outgoing and genuinely interested in people. On the contrary, INFJs are true introverts, who can only be emotionally intimate and fulfilled with a chosen few from among their long-term friends, family, or obvious "soul mates."

They know things intuitively, without being able to pinpoint why, and without detailed knowledge of the subject at hand. They are usually right, and they usually know it (欣慰啊). Uncanny gifted, INFJs may well have the clearest insights of all the types into the motivations of others, for good and for evil.

They are very sensitive to conflict, and cannot tolerate it very well. Situations which are charged with conflict may drive the normally peaceful INFJ into a state of agitation or charged anger.

In the workplace, the INFJ usually shows up in areas where they can be creative and somewhat independent. They have a natural affinity for art, and many excel in the sciences, where they make use of their intuition. In their own way, INFJs are just as much "systems builders" as are INTJs; the difference lies in that most INFJ "systems" are founded on human beings and human values, rather than information and technology.

Life is not necessarily easy for the INFJ, but they are capable of great depth of feeling and personal achievement. (我最喜欢的句子,有前途啊,小伙 :-D)

INFJs generally have the following traits:
* Intuitively understand people and situations
* Idealistic
* Highly principled
* Complex and deep
* Natural leaders
* Sensitive and compassionate towards people
* Service-oriented
* Future-oriented
* Value deep, authentic relationships
* Reserved about expressing their true selves
* Dislike dealing with details unless they enhance or promote their vision
* Constantly seeking meaning and purpose in everything
* Creative and visionary
* Work logically and rationally
* Usually have good communication skills, especially written
* Take their commitments very seriously
* Have very high expectations for themselves and others (both a strength and weakness)
* Good listeners

Weakness:
* Tendency to hold back part of themselves
* Not good with money or practical day-to-day life necessities (怪不得INFJ薪资低,好在I don't really care...)
* Extreme dislike of conflict and criticism

I now have a clearer mind of the type of place I can be really happy to work for, which holds a larger vision and moral goal (to transform IT technology to everyday life convenience) rather than merely "making money", has good public image, encourages and values personal contribution, provides certain degree of independence. Seeking...

As a friend, I encourage you to take the test at http://www.humanmetrics.com/cgi-win/JTypes2.asp and follow this link http://www.personalitypage.com/home.html to find a comprehensive description of your personality type, both to know yourself and let others know you better.

One's personality can change over time, either due to the past experience or personal effort for a more preferable one. However, the one we posses now holds explanations to a lot of whys, and help us to understand, accept and proud of what we are. It's a sound and good starting base for future directions of our personal development.

Sunday, November 04, 2007

Thank you my dear friend

I'm so moved to see this on your site. Thank you for remembering.


Here's another photo of good memory back in 2003:

Blog migration

I just finished importing posts from my other blog 电脑怪猫 here to my main blog. The previous separation of techniques related stuff to the other blog was due to blogger's lacking of labeling support.

Monday, October 22, 2007

ISE support for Trimaran, A How-to

The tool is about to finish, and will be released to the public shortly. With the finish of it, my time as a Ph.D student is also approaching its end. What I have to do next is writing up the thesis and going outside to the big wild world. I hope other researchers in the field of custom architectures can benefit from my papers and this tool. Doing open-source is always one of my dreams, and this tool is something I've done towards that way...

Here is a link for the document in edit (requiring a google account):
http://docs.google.com/Doc?id=dg7t3rmx_24hdznjn

The software will be released with a set of benchmarks after thorough test (now partially).

Sunday, September 02, 2007

Poor students in SoC

The whole school of computing has just moved to a new site. Despite of some small inconveniences of the new location (such as transportation, freezing and irregularly shaped office, no cellphone signal coverage, etc), one rule has been posed in every research lab - "NO FOOD OR DRINK ALLOWED". This is because instead of using plastic floor, light colored carpet is now covering every inch of the lab turf. I'm not sure whether the policy maker has also noticed the fact that, dark muddy footprints are already everywhere during the raining season, if so, maybe we will be informed to use our bare feet. On the contrary, I have never seen any food spread or drink spilling in the old lab. But ok then, Singapore has had plenty of places not allowing food/drinks (bus, mrt), just plus one place we're working for more than 8 hours per day, there is no big deal, really. This is not the end, though.

A few days ago, the head of the department disseminated an email clarifying this new policy, he said, he wants to use it to push students to the pantry where they can eat/drink and at the same time talk about their research with one another more. That is good. However, when we headed to the pantry, we all stuck at the entrance:

Tuesday, July 24, 2007

Face off by Alva

就一个字,我只说一次。


Monday, July 23, 2007

East coast outing

眼间来新加坡已经5年了。在筹划5年庆的同时,大家也忍不住先出来活动一把。小绿说从来没有去过东海岸,虽然上班在同一个地铁站下……东海岸我们来了。

下午准时出发,迟到半个小时到达Bedok地铁站,顺利和Staul、小绿会合,加上我,埃瓦和WT,刚好5个人,不能打Taxi。出去后先问路,一群aunty商量了半天,告诉我们对面坐31路。车子蜿蜒的开了10多站,下车后在一个好心的aunty带领下辗转到达久违的东海岸边。

话说东海岸是专门供人们运动休闲的,狭长的海岸线边上,依次排列着沙滩,人行道,自行车/旱冰道和树林草地。单排轮旱冰,自行车和跑步游泳是这里的主要运动休闲方式。此外,岸边还可以烧烤,搭帐篷或者租房间过夜,还有很多著名的海鲜餐厅。总之呢,除了沙滩太小,海水不蓝,确实是周末的好去处。暂时介绍这些。

我们的主要活动:骑车。附加活动:Staul带的Frisbee。小绿本来要溜旱冰,不过胆小爬摔,就没有勉强他。骑车,2个小时8块钱,结束时送2瓶水。埃瓦开始时就要要了2瓶,结束时租车的人忘记了又给了2瓶,结果全部放到我的书包里面,那个重啊。我们沿着海岸线向东一直骑,这一骑才知道,原来东海岸是很长的一片,大概20分钟还没有到头,也就是说至少4、5公里了(在新加坡4、5公里的份量还是很足的)。回程后稍作休息,开始frisbee。我负责照相,结论:埃瓦动作千篇一律,Staul动作最帅。玩了一会儿,天色渐暗,在饥寒交迫中一行人艰难的爬到“无招牌”吃饭。对了,前面还骑车路过发现一片可以玩冲浪的地方,冲浪板加上空中迅速拉动的绳索,很是刺激。还有可爱的小孩若干,包括埃瓦。和从大到小各种狗狗。写不动了,太晚了。。。

Sunday, July 15, 2007

Shifting

是一年搬家时,每年7月,狂风不止,阴雨绵绵,正直搬家的好日子。正所谓每年一搬,年年都住新房子,心情怎能不好。不过呢,新的是我们,倒不一定是房子。吃够了上上次搬家时候用的出租车队的苦,这次请了搬家公司的小货车以及司机小胖,另外高价雇佣了PhD肌肉男民工若干,浩浩荡荡开往心中的那片净土——油池。这次的新家是真的新,看图说话。

Saturday, July 07, 2007

New life

去到新的地方,遇到新的人,开始新的生活,一定会感觉轻松惬意吧。就和自己刚到这边的时候一样,空气是清新的,阳光是透明的,音乐是轻快的,步伐是跳跃的。把过去的烦恼都抛掉了,每天给你打电话都想和你分享新的体验,多希望你在身边,一起经历这些。Jeff的歌中说“有了爱,一颗心从此好安定”。那么多年来,如果说有什么没有变,或者说有什么变得越来越坚定了,就是想要和你一同分享生命中喜悦的心情吧。马上要启程了,别忘了和我说身边的事情,给我看照片,好好吃饭,早点困告,一切都会好的。

THE GIFT OF THE MAGI

by O. Henry

One dollar and eighty-seven cents. That was all. And sixty cents of it was in pennies. Pennies saved one and two at a time by bulldozing the grocer and the vegetable man and the butcher until one's cheeks burned with the silent imputation of parsimony that such close dealing implied. Three times Della counted it. One dollar and eighty- seven cents. And the next day would be Christmas.

There was clearly nothing to do but flop down on the shabby little couch and howl. So Della did it. Which instigates the moral reflection that life is made up of sobs, sniffles, and smiles, with sniffles predominating.

While the mistress of the home is gradually subsiding from the first stage to the second, take a look at the home. A furnished flat at $8 per week. It did not exactly beggar description, but it certainly had that word on the lookout for the mendicancy squad.

In the vestibule below was a letter-box into which no letter would go, and an electric button from which no mortal finger could coax a ring. Also appertaining thereunto was a card bearing the name "Mr. James Dillingham Young."

The "Dillingham" had been flung to the breeze during a former period of prosperity when its possessor was being paid $30 per week. Now, when the income was shrunk to $20, though, they were thinking seriously of contracting to a modest and unassuming D. But whenever Mr. James Dillingham Young came home and reached his flat above he was called "Jim" and greatly hugged by Mrs. James Dillingham Young, already introduced to you as Della. Which is all very good.

Della finished her cry and attended to her cheeks with the powder rag. She stood by the window and looked out dully at a gray cat walking a gray fence in a gray backyard. Tomorrow would be Christmas Day, and she had only $1.87 with which to buy Jim a present. She had been saving every penny she could for months, with this result. Twenty dollars a week doesn't go far. Expenses had been greater than she had calculated. They always are. Only $1.87 to buy a present for Jim. Her Jim. Many a happy hour she had spent planning for something nice for him. Something fine and rare and sterling--something just a little bit near to being worthy of the honor of being owned by Jim.

There was a pier-glass between the windows of the room. Perhaps you have seen a pier-glass in an $8 flat. A very thin and very agile person may, by observing his reflection in a rapid sequence of longitudinal strips, obtain a fairly accurate conception of his looks. Della, being slender, had mastered the art.

Suddenly she whirled from the window and stood before the glass. her eyes were shining brilliantly, but her face had lost its color within twenty seconds. Rapidly she pulled down her hair and let it fall to its full length.

Now, there were two possessions of the James Dillingham Youngs in which they both took a mighty pride. One was Jim's gold watch that had been his father's and his grandfather's. The other was Della's hair. Had the queen of Sheba lived in the flat across the airshaft, Della would have let her hair hang out the window some day to dry just to depreciate Her Majesty's jewels and gifts. Had King Solomon been the janitor, with all his treasures piled up in the basement, Jim would have pulled out his watch every time he passed, just to see him pluck at his beard from envy.

So now Della's beautiful hair fell about her rippling and shining like a cascade of brown waters. It reached below her knee and made itself almost a garment for her. And then she did it up again nervously and quickly. Once she faltered for a minute and stood still while a tear or two splashed on the worn red carpet.

On went her old brown jacket; on went her old brown hat. With a whirl of skirts and with the brilliant sparkle still in her eyes, she fluttered out the door and down the stairs to the street.

Where she stopped the sign read: "Mne. Sofronie. Hair Goods of All Kinds." One flight up Della ran, and collected herself, panting. Madame, large, too white, chilly, hardly looked the "Sofronie."

"Will you buy my hair?" asked Della.

"I buy hair," said Madame. "Take yer hat off and let's have a sight at the looks of it."

Down rippled the brown cascade.

"Twenty dollars," said Madame, lifting the mass with a practised hand.

"Give it to me quick," said Della.

Oh, and the next two hours tripped by on rosy wings. Forget the hashed metaphor. She was ransacking the stores for Jim's present.

She found it at last. It surely had been made for Jim and no one else. There was no other like it in any of the stores, and she had turned all of them inside out. It was a platinum fob chain simple and chaste in design, properly proclaiming its value by substance alone and not by meretricious ornamentation--as all good things should do. It was even worthy of The Watch. As soon as she saw it she knew that it must be Jim's. It was like him. Quietness and value--the description applied to both. Twenty-one dollars they took from her for it, and she hurried home with the 87 cents. With that chain on his watch Jim might be properly anxious about the time in any company. Grand as the watch was, he sometimes looked at it on the sly on account of the old leather strap that he used in place of a chain.

When Della reached home her intoxication gave way a little to prudence and reason. She got out her curling irons and lighted the gas and went to work repairing the ravages made by generosity added to love. Which is always a tremendous task, dear friends--a mammoth task.

Within forty minutes her head was covered with tiny, close-lying curls that made her look wonderfully like a truant schoolboy. She looked at her reflection in the mirror long, carefully, and critically.

"If Jim doesn't kill me," she said to herself, "before he takes a second look at me, he'll say I look like a Coney Island chorus girl. But what could I do--oh! what could I do with a dollar and eighty- seven cents?"

At 7 o'clock the coffee was made and the frying-pan was on the back of the stove hot and ready to cook the chops.

Jim was never late. Della doubled the fob chain in her hand and sat on the corner of the table near the door that he always entered. Then she heard his step on the stair away down on the first flight, and she turned white for just a moment. She had a habit for saying little silent prayer about the simplest everyday things, and now she whispered: "Please God, make him think I am still pretty."

The door opened and Jim stepped in and closed it. He looked thin and very serious. Poor fellow, he was only twenty-two--and to be burdened with a family! He needed a new overcoat and he was without gloves.

Jim stopped inside the door, as immovable as a setter at the scent of quail. His eyes were fixed upon Della, and there was an expression in them that she could not read, and it terrified her. It was not anger, nor surprise, nor disapproval, nor horror, nor any of the sentiments that she had been prepared for. He simply stared at her fixedly with that peculiar expression on his face.

Della wriggled off the table and went for him.

"Jim, darling," she cried, "don't look at me that way. I had my hair cut off and sold because I couldn't have lived through Christmas without giving you a present. It'll grow out again--you won't mind, will you? I just had to do it. My hair grows awfully fast. Say `Merry Christmas!' Jim, and let's be happy. You don't know what a nice-- what a beautiful, nice gift I've got for you."

"You've cut off your hair?" asked Jim, laboriously, as if he had not arrived at that patent fact yet even after the hardest mental labor.

"Cut it off and sold it," said Della. "Don't you like me just as well, anyhow? I'm me without my hair, ain't I?"

Jim looked about the room curiously.

"You say your hair is gone?" he said, with an air almost of idiocy.

"You needn't look for it," said Della. "It's sold, I tell you--sold and gone, too. It's Christmas Eve, boy. Be good to me, for it went for you. Maybe the hairs of my head were numbered," she went on with sudden serious sweetness, "but nobody could ever count my love for you. Shall I put the chops on, Jim?"

Out of his trance Jim seemed quickly to wake. He enfolded his Della. For ten seconds let us regard with discreet scrutiny some inconsequential object in the other direction. Eight dollars a week or a million a year--what is the difference? A mathematician or a wit would give you the wrong answer. The magi brought valuable gifts, but that was not among them. This dark assertion will be illuminated later on.

Jim drew a package from his overcoat pocket and threw it upon the table.

"Don't make any mistake, Dell," he said, "about me. I don't think there's anything in the way of a haircut or a shave or a shampoo that could make me like my girl any less. But if you'll unwrap that package you may see why you had me going a while at first."

White fingers and nimble tore at the string and paper. And then an ecstatic scream of joy; and then, alas! a quick feminine change to hysterical tears and wails, necessitating the immediate employment of all the comforting powers of the lord of the flat.

For there lay The Combs--the set of combs, side and back, that Della had worshipped long in a Broadway window. Beautiful combs, pure tortoise shell, with jewelled rims--just the shade to wear in the beautiful vanished hair. They were expensive combs, she knew, and her heart had simply craved and yearned over them without the least hope of possession. And now, they were hers, but the tresses that should have adorned the coveted adornments were gone.

But she hugged them to her bosom, and at length she was able to look up with dim eyes and a smile and say: "My hair grows so fast, Jim!"

And them Della leaped up like a little singed cat and cried, "Oh, oh!"

Jim had not yet seen his beautiful present. She held it out to him eagerly upon her open palm. The dull precious metal seemed to flash with a reflection of her bright and ardent spirit.

"Isn't it a dandy, Jim? I hunted all over town to find it. You'll have to look at the time a hundred times a day now. Give me your watch. I want to see how it looks on it."

Instead of obeying, Jim tumbled down on the couch and put his hands under the back of his head and smiled.

"Dell," said he, "let's put our Christmas presents away and keep 'em a while. They're too nice to use just at present. I sold the watch to get the money to buy your combs. And now suppose you put the chops on."

The magi, as you know, were wise men--wonderfully wise men--who brought gifts to the Babe in the manger. They invented the art of giving Christmas presents. Being wise, their gifts were no doubt wise ones, possibly bearing the privilege of exchange in case of duplication. And here I have lamely related to you the uneventful chronicle of two foolish children in a flat who most unwisely sacrificed for each other the greatest treasures of their house. But in a last word to the wise of these days let it be said that of all who give gifts these two were the wisest. O all who give and receive gifts, such as they are wisest. Everywhere they are wisest. They are the magi.

Tuesday, June 26, 2007

Moving

日新加坡房价大涨,又逢开学在即,在这个节骨眼上找便宜又舒服的房子真是很困难的事情,何况要找一套。听超人说原来他和曾经的室友找房的几次经历,开始都想找一套继续做室友,但后来由于种种原因无奈只能分开的事情,那个时候我对自己说,这次一定要成功,不会丢下谁的。可事情后来的发展却难以左右。

首先,胖墩禁不住便宜的单人床位诱惑叛逃了,这样尴尬地剩下4个人,因为有人需要单间,所以仍然必须是3个卧室的。就在地毯式的搜索各大网站未果而搬家的时间一天天临近的时候,我们的中介女士带来了便宜好房的希望,虽然离学校远了点,1个小时车程,不过想想以前父母在郊区上班,每天早起送我上学之后去做班车,远不止1小时,加上去看了以后觉得周围生活方便,新房子新家具,唯一的一点不便也就忍了。新房的出现是因为房东不满现在的租户总是拖欠房租,想另寻租户。看房那天见到房东太太,用Alva的话说是一个PP却很有礼貌的女士,虽然这个月的租金还没有收到,不过她还没有把这个意愿告诉房客,就连我们去看房都是装成她的搬运工去的,看过之后还送我们回到地铁站。房子还是很满意的,谈了价钱,增添家具的等等问题,虽然没有签合约,不过也算是半定下来了。这样过了两天,今天晚上瓜头却突然和我说她女朋友也要搬家,自然是和他搬到一起住,但她觉得新的地方离上班地方太远。了解了一下,9站地铁的距离,当然,也可以乘一站地铁,再坐公司的班车去,而那个地方,离我们的学校比新的地方还要远蛮多。言下之意,他就要退出我们维之不易的fellowship,跟随女友而去了。这样做未免有些不够朋友,可也算是男人的优点吧。

Fellowship,或许在各种矛盾面前确实有点脆弱吧,就连超人的魅力都没有办法维持住的,我也不必去计较太多。写出来,觉得怪怪的心情好多了。

后记:胖墩的新家3间房已经住了7、8个人,听说就连客厅里面都住人。爱安静的他后来又搬了一次,现在应该还不错吧。瓜头也不顺利,每天上放学一个多小时,后来住得不爽又搬一次,自己和女朋友都很远。事情就是这样的,这就是生活。

Monday, June 11, 2007

Happy wedding!

MM和Gengpu同学马上就要marry了。除了表达偶衷心的祝愿,还自告奋勇的当了次御用摄影师。同行的还有经验丰富的老年摄影师“耗子”,及影坛新星“光头”。如此华丽的阵容,令同在景点(植物园和圣淘沙)拍婚纱照的其他队伍望而生畏,都尽量和我们拉开距离,避免相形见绌的尴尬。拍摄圆满成功之际,放出此次豪华团队的照片,也算是做个广告,为今后进军专业摄影界做点准备。

主角们,手持自制反光板(poster),表情时而可爱时而呆滞。

本人,扮相极具艺术气质的头号摄影师,以浓密的胡须著称当代马克思。

耗子,老年摄影师,经验丰富,精神恍惚,乘车去目的地时带我坐过2个站头,之后想超近路却误入私人住宅区,差点被狗咬死。

光头,摄影爱好者,以性感的光头从某刚认识的MM那里迅速骗取了专业级的D200相机。虽然学习摄影只有短短2天,而且是网络远程教学,不过在此行中表现出的搞笑和创意,消除了耗子和我差点被狗咬死的阴影。

Thursday, June 07, 2007

What happened to google search?

Google search is acting really weired recently. First off, my homepage disappeared from the search results by using keywords "Pan Yu homepage" (without the quote marks), which used to be the second results on the first page, but now totally disappeared (I haven't found within the first 10+ pages). Instead, lots of other web pages which neither contain consecutive "Pan Yu" nor are homepages of any sort are listed. At the beginning, I was wondering whether this is caused by the "personalized search" just launched, though I don't remember enabling it. I logged out my google account, searched again, nothing changed. Then I asked my labmate Edward to try the same thing for his homepage. This time, more counter-intuitive thing happened. When he typed "edward sim", his homepage appeared at the end of the first result page, however, trying "edward sim homepage" returned irrelevant stuff as what happened to me.

I know google has integrated news results to the normal search results a moment ago, but apparently what listed for our homepage search are not news. Google is acquiring a lot of companies and participating lots of other services outside the search world. While it used to move cautiously, it is more aggressive nowadays. I'm a little worried about google because it used to be based on pure technologies and people are really admire the objectiveness and spirit behind this. Growing into an empire that dominate the web may not be bad, since a lot of innovations and good services really benefit everybody and change the world. But except all those services and the so called google operating system, I really hope the heart of google can always be the same, being dependable and reliable, moving solid moves.

Wednesday, June 06, 2007

Web 2.0 services, my online office

Blogging is surely one of the pioneers of Web2.0, and also the first one I started to participate. In fact, the concept of wiki was before blogging, and I also started to search in wikipedia before writing my blogs, but I've never contributed anything to wiki except for "using" it. Below is a sketch of Web2.0 services I'm using currently:
Half of them are google services. In fact, from day one google launched gmail, the light of personal online office had turned on based on the large storage available for each account. Google had acquired a lot of Web2.0 companies and integrated their services under a universal account for each gmail user. An era of online office has come, just open your arms and brace it!

Monday, June 04, 2007

An international face...

始说是刘德华(香港人),被班主任起名Andy;胖的时候说像夏添(高中同学,圆圆脸);后来留了点小胡子变成尼古拉斯凯奇(美国人)和周总理(从前的人);胡子刮了变成木村拓哉(日本人);在任何国家的入关口都会被拦下来检查因为有胡子像中东人;在自己国家出关时又被当成日本人;还有人说眼睛颜色浅像越南人。天哪,从小到大,我的变化有那么大吗?像某个明星还可以沾沾自喜一下,可是到出入关的时候就咯儿屁了,难道那些人从来不看电影吗?

Wednesday, May 30, 2007

A bug

A stupid bug in my program:

vector <> content;
vector <> cp_array; // content pointer array

Constructing content and cp_array at the same time, using cp_array[x] = &content[y]. Later I found some pointers in cp_array didn't point to the correct content element. I doubted the logic of my program first, and then looked for all pointer assignments, but all seemed to be correct. After step by step debugging and printing intermediate array values (damn, it's hard to debug stl using gdb even though none optimizations were switched on), I found the content cp_array pointed to changed after a content.push_back(a), it is the push_back operation that caused content to reallocate memory and then what cp_array pointed to was nullified because the address of content vector was changed.

What I've learned: Do not use pointers on dynamically allocatable content, use indices instead.

Monday, April 09, 2007

Local idioms

HH came to Singapore for a business trip some time ago, and asked a few of us to hang around a bit. While on the taxi, he raised a question about a word he saw a lot on/beside the road -- "ERP" which stands for the business he works in (Enterprise Resource Planning) but certainly was out of context. The taxi driver laughed while we frowned. "It tells you need to pay for driving on that road. It says, Everyday Robbing People!". We all fainted... To continue the stunning effect, he further asked "You know what GST is? You pay more when you buy things, then the Government Say Thank you!".

footnote:
ERP - Electronic Road Pricing
GST - Goods and Service Tax

Wednesday, March 28, 2007

Get fonts right in pdf formated papers

I was struggling with font problem in my paper these days, and finally got done with it. I use winedt/MikTex companions under windows XP since 3-4 years ago. And PowerPoint for the figures, since I can directly print to pdf-printer (feature of acrobat) to get pdf figures nowadays. All these tools works efficiently. However, they didn't comply with ACM's strict requirement of fonts in publications, which restricts to the use of "type 1" and "embedded" fonts ONLY. Now, I have two problems. First one, I always have "truetype" font in my figures, since I don't have any "type 1" font installed on my windows. Second one, there are several "type 1" fonts cannot be embedded, such as "times", "courier" and etc.

================================================================

For the first problem, I need to install and use the "type 1" font corresponding to the "truetype" font I used in PowerPoint, so that the pdf figures generated contain "type 1". The free way of getting "type 1" font is to convert from existing truetype font (under \WINDOWS\Fonts). There are two ways of doing this:

First, use fft2pt1 (truetype to type 1 converter) to convert the truetype font (from a .fft file to a .pfb file and a .afm file), then use afm2pfm to convert the .afm to a .pfm file that windows recognizes, and finally drag the .pfm file to \WINDOWS\Fonts folder to get it installed. Note that if you're NOT using windows XP or 2000, you need to install Adobe Type Manager (ATM) to install the type 1 font. For now, if you're lucky, you can see and use the type 1 font in the PowerPoint font box (I cannot for some reason I don't know).

The second way to do this is to use FontLab (a commercial software) to generate the type 1 font. Just open the .ttf font, go to File->Font Info to give it a different font name (first page), go to File->Generate font, and choose to generate the "type 1 binary file (*.pfb)". Then install the font by dragging the .pfm file to \WINDOWS\Fonts folder. I managed to see the font in PowerPoint using this second method.

In PowerPoint, substitute all the fonts with the type 1 fonts you generated. When printing to the pdf printer, make sure to set the options of pdf printer to embed all the fonts (for my case, under "conversion settings->fonts->embedding" and add all the fonts to the "always embed" list). When the pdf file is produced, open it with acrobat, press CTRL+D to see the fonts. Most likely, you'll have all the fonts embedded.

An exception may occur if you use a non-English version of PowerPoint. For me, Chinese version. The default font is Sim-Sun. Some times, even all the places you can touch is set to non Sim-Sun font, it will still be included in the pdf file. In this case, open a new PowerPoint file, copy and paste you figure part by part to the new file. Produce a pdf file and check the font to see where Sim-Sun is introduced, and then try to modify or remove them. For me, I found starting spaces (by accident) introduces Sim-Sun, so I removed them.

==================================================================

For the second problem, the cannot-be-embedded fonts are from the text compiled with pdflatex, which are assumed (by whom?) to be available on all systems (but not true), and referred as Base14 fonts.

To embed them, the simplest way is to install the latest version of MikTex (2.5) and ensure the pdfeTex version is above 1.20. By default, Base14 fonts are embedded. If you're using Tex system under Linux, similarly you need to ensure the pdfeTex (or pdfTex, or pdflatex) is above version 1.20. And then edit "/web2c/updmap.cfg" to ensure the following options is set to true: pdftexDownloadBase14, dvipdfmDownloadBase14. Finally, run updmap as root to update the configuration.

Another way of doing this is save your pdf document with the not-yet-embedded fonts as a PS file, using "save as..." in acrobat. Then use the command "ps2pdf14 -dPDFSETTINGS=/prepress -dEmbedAllFonts=true mydoc.ps" to generate the pdf file with fonts embedded.

I compared the results of the above two approaches, i.e., the direct pdflatex generating approach and the pdf->ps->pdf approach. It seems to me that the former approach is better in the following aspects. It includes less redundant fonts, so the file size is smaller. The graphs looks more original, and scrolls faster especially when complex patterns are used (pdf->ps->pdf approach converts 2 times, and may introduce some distortions and more fragments to the vector graph, thus show up slowly).

We're done.

Monday, March 19, 2007

Tips

Do not try to compile a large program not compatible with your current version of gcc, instead, compile a version of gcc compatible with the program, and then use the gcc to compile it. (however, newest gcc does not even compile the old versions. In this case, compile a not-that-old version which compiles the old version to compile the old version. What a mess!)

Installing Fedora Core 6 on VMWare 5.5

Since the up-to-date VMWare still doesn't support FC linux officially, you need to pay some effort installing and configuring FC6. I assume the readers have successful installation experience of other linux under VMware before, so only key points related to FC6 installation will be addressed.

1. Create a VM:
Open VM's "New Virtual Machine Wizard", make sure you choose the following options: "Custom" -> New - Workstation 5 -> "Other Linux with 2.6.x kernel" -> ... -> LSI Logic (for SCSI Adaptor) -> ... -> SCSI (recommended).

The above options will make sure FC6 installation wizard find your virtual disk properly.

2. Install VMWare Tools:
Make sure you have kernel-devel corresponding your running kernel installed, which provides the kernel headers needed by VMWare Tools. By default, you need to download and install kernel-devel by yourself. Note that the version of kernel-devel must match your running kernel exactly (for example, "2.6.18-1.2798.fc6xen.i686" does not match with "2.6.18-1.2798.fc6.i686), so if you cannot find a kernel-devel matches the kernel, you need to install a kernel that matches the kernel-devel. I don't recommend using yum to update the kernel and kernel-devel, because they don't always match (and you may not be able to find a co-existing pair). So we go the traditional rpm way.

To check your current running kernel, use "uname -r".

To download kernel-devel, goto "http://fedora.redhat.com/download/mirrors.html", find a mirror site close to your place, and download the rpm package of kernel-devel. For example, I would go to "ftp://ftp.oss.eznetsols.org/linux/fedora/6/i386/os/Fedora/RPMS/" in Singapore, and download "kernel-devel-2.6.18-1.2798.fc6.i686.rpm", and install it by "rpm -ivh kernel-devel-2.6.18-1.2798.fc6.i686.rpm".

You may need to download and install the kernel matches the kernel-devel as well. Similarly, download kernel-2.6.18-1.2798.fc6.i686.rpm and install it. Then reboot your linux. Stroke "enter" at boot up to choose the newly installed kernel. Or you can modify the grub configuration file "/etc/grub.conf", change the "default=" parameter (0 for the first kernel, 1 for the second kernel) for the new kernel.

Now you can locate the kernel headers under, for example, /usr/src/kernels/2.6.18-1.2798.fc6-i686/include.

Then mount your VMWare Tools iso, and run "vmware-install.pl". Key in the above kernel headers when asked. You should be able to install it successfully now.

3. Configure resolution of your X.
Edit "/etc/X11/xorg.conf" with root. Add the following section at the beginning of the file.

Section "Monitor"
Identifier "vmware"
HorizSync 1.0 - 10000.0
VertRefresh 1.0 - 10000.0
EndSection

Add a line "DefaultDepth 24" after "Mornitor "vmware"" line in "Screen" section (assuming you have a OK graphic card). Then change the "Modes" line under Depth 24 to your desired resolution. For example "Modes 1280x800". Then startX.

Reference
http://www.thoughtpolice.co.uk/vmware/howto/fedora-core-6-vmware-tools-install.html
http://www.linuxquestions.org/questions/showthread.php?t=503651
http://www.lowlevel.cz/log/pivot/entry.php?id=80

Saturday, March 17, 2007

My Must-have Firefox Addons

As a IT guy, switching among different OS and migrating from systems to systems (e.g., my desktop and a few of my laptops) is not uncommon. Whenever this happens, the first thing I would make sure is the up-to-date Firefox is installed with the following must-have addons:
  1. Del.icio.us Bookmarks: for online bookmarking service, sharing bookmark links with others or myself (so that i don't need to synchronize the bookmarks from 3, 4 computers I use).
  2. GUtil: grants me instant access to various google services I'm using (i.e., gmail, reader, docs, calendar, blogger, album) with button click.
  3. ScrapBook: great substitution for "save page as..." function, which allows you to capture (and capture certain parts), organize, comment and edit on interesting web pages. The only problem is that it's not an online thing, and you need to export/import among different systems you have.
  4. Google Toolbar for Firefox: this is actually with Firefox package, but I remind you to click on the "G" icon with the downward arrow, you will find it's not only for googling (i.g., I need Webster for English words that doesn't recognize me).
  5. Session Manager: resume the tabs I was reading last time after restarting Firefox.
  6. FireFTP: for lazy guys.

Friday, March 16, 2007

如何在3.10OE-A下使用USB连接电脑玩ISO游戏

信我们每个人都有一个巨大的ISO游戏库,而现在最大的棒子也只有4GB,而且价格不菲。所以有人提出了用USB连接电 脑,直接读取电脑上存放的ISO来游戏的概念。这篇文章就是介绍怎样在3.10OE-A系统下面实现用USB->ISO来玩游戏的。DH可能自带这 样的功能,由于我自己已经不用DH了,还希望达人补全。最后说明一下,使用自治软件,特别是写入固件(第2步)有可能损坏你的PSP系统,想要尝试的人必须有视死如归的精神,坏了我不承担任何责任,这也是自治软件社群的潜规则了。

本文参考了以下网页,特此感谢
http://psp3d.com/member-news/133 ... wares-released.html
http://www.hoodong.com/entrygroupview.do?doc_id=200000813384
http://forums.afterdawn.com/thread_view.cfm/454995

首先准备以下工具:
工具1. [USB Mod v4b For 3.10 OE-A]: 含有PSP端插件的工具包,用来与PC通信,以及切换USB->ISO状态还是普通ISO状态。
工具2. [usbhostfs_PC_Win_1.5]: PC端的USB通信服务器程序。
工具3. [libusb-win32-device-bin-0.1.10.1]: PSP设备驱动信息提取程序。
工具4. 如果是TA-082主板降级的机器,还需要[TA082_USB_Fix]来修复固件里面的错误信息,这样工具3才能提取正确的信息。


下面是具体步骤:
1. 解压工具1,把MS_ROOT/seplugins里usbhostfs.prx,buzzusbvsh.prx和buzzusb.txt复制到"psp 根目录/seplugins"。如果"PSP根目录/seplugins"下没有game.txt和vsh.txt,那这两个文件也复制过来。如果已经存 在,则把工具1中2个txt文件的内容复制追加到已存在的2个txt文件中。
2. 关闭psp,按住R键开机进入恢复模式。在plugin选项中激活(enable)所有与usbhostfs和buzzusbvsh的插件。退出 plugin选项,选择Advanced->toggle USB (flash0),之后把工具1中Flash0/kn/vshctrl.prx和systemctrl.prx复制到PSP的kn目录(先备份),覆盖原 文件。退出 恢复模式。重启以后就能通过长按"口"键切换普通ISO模式(原来的模式)和USB->ISO模式了。不过现在USB->ISO模式里还不会 出现PC端的游戏,所以我们还需要安装PC端的服务器程序。

3. 解压工具2,复制PC上的游戏psp文件到解压后目录的ISO文件夹中(其实只要保证游戏iso文件在usbhostsf.exe程序所在目录的ISO子 文件夹中就可以了)。复制cygusb0.dll和cygwin1.dll至 C:\windows\system32中。这样运行usbhostsf.exe,服务器端就算是设置好了。不过现在PSP的驱动程序还没有安装(不是平 常识别为存储设备的那个驱动),所以还不能连接。
4. 接下来需要用工具3提取并安装PSP驱动程序。先启动PSP,这时windows会跳出检测到新硬件的对话框,暂时不必理会。解压工具3,运行bin\ inf-wizard.exe,选择next,会出现一个已连接USB设备的列表。通过开关psp来确定哪一项是psp对应的设备(需要back再 next来刷新列表),之后选择此设备,next, next,把导出文件以默认文件名"your_file.inf"存至工具2的driver目录中。最后,关闭再打开psp,根据windows新硬件向 导,选择工具2的driver目录来安装刚才导出的psp驱动了。安装完毕后,再接入psp的时候就不会跳出新硬件的对话框了。
5. 所有准备完毕。最后,运行usbhostfs.exe(工具2),出现一个dos窗口。连接并打开psp,长按"口"键切换到USB->ISO模 式,如果dos窗口中显示"connected to device",那么恭喜你,你可以运行在PC上的iso游戏了。

6. 如果你用的是TA-082主 板的psp,psp的驱动信息并不能被正确的提取。这 时需要使用工具4来修复psp的固件,之后再提取驱动信息。解压工具4,把MS_ROOT里面内容复制到psp根目录(确保043.bin在psp根目 录)。在psp里运行UsbHostfs-Fix程序,全部显示successful之后重启psp。之后跳到步骤4制作驱动。后面相同。

=============================================================

问题1:安装工具2之后,我怎么辨别切换到了USB->ISO模式还是普通ISO模式?
回 答: 按住"口"键之后,psp上面读盘的指示灯会闪烁一会儿,这个说明正在切换模式。之后记忆棒中的游戏图标可能并没有刷新,需要进入“游戏存档”,然后退 出,之后就刷新了。如果刷新之后显示的是原来棒子里面的游戏,就是出于普通ISO模式,如果显示了硬盘上面的iso游戏,就是进入了USB-> ISO模式。如果什么游戏都没有显示,那是处于USB->ISO模式,这个时候,如果usbhostsf.exe的dos窗口中显示 "connected to device",那么是因为iso游戏放置的文件夹没有设对;如果dos窗口没有显示,就是psp驱动的问题了。

=============================================================

你可以用google搜索,或者到http://www.cngba.com/thread-16648557-1-1.html下载
以下工具(须注册为cngba会员):
USB_Mod_v4b_For_3.10_OE-A_For_PSP.zip
usbhostfs_PC_Win_1.5.rar
libusb-win32-device-bin-0.1.10.1.rar
TA082_USB_Fix.rar