Positive psychology: About change

One important things in Positive psychology is about ” Change”.

It first state that Change is possible, and they do put evidence that ” people do change”. And what most interest me is the saying ” Error of the average”  It seems we put some much time to study the average but we seldom focus on “the best”. The professor think “the best” is the key to help us to find a way of change.

As everyone may know “Exception proves the rule” . So won’t let the exceptions filled with to much depressions, because it do real will lead you to bad situation. We sometime should face the good side of life and make good use of “Exception proves the rule”

We may find some research talking about that ” change is not possible”, however, we should know what is the Detrimental research. Sometime, we just need to think a little more about the whole things and analysis with your own mind instead of accepting it without thinking.

The last but the most important thing is, we should studying the bets. If you find it’s hard to do the change, then please turn to study “the best” . “It seems more and more clear that what we call “normal” in psychology is really a psychopathology of the average, so undramatic and so widely spread that we don’t even notice it ordinarily.”

“Few in number though they be, we can learn a great deal about values from the direct study of these highly evolved, most mature, psychologically healthiest individual,and from the study of the peak momentson average individuals, moments in which they become transiently self-actualized” –Abraham Maslow

 

 

 

Positive Psychology :Intro Class

Today I begin the learning of the Positive Psychology which is one of the famous Harvard Open courses. The Professor show a modest impression to me. He mentioned a lot about that Positive Psychology will not have lots of ” wow”, but it does help of change.

Here I want to share some points that I learn from the Intro class. The first thing is the “the lack of stillness”. I’m not very good at silence in the daily life. I always keep on saying something even I know all that words are nonsense. I don’t know why I like to do that until today I hear this class. Silence is something that we miss from our culture. Silence can help us to feel our inner side and perceive the potential. So this could be the meaning of the old Chinese saying : speak less, do more.

The second is the “The soul grows by subtraction,not addition-Thoreau” It seems easy to do the subtraction, however, it’s not so simple to do it  in daily life.  We always have under lots of pressure from the outside world and sometime can’t have the right judgement about what is the most important thing to us.

The third is the about the ” Right questions” , there is an funny saying”  Children enter school as question marks and leave as periods.-Neil Postman” We have all went through the childhood and we have lots of questions. And we become less curiosity when we gradually grow up. But they say “ Education is the quest for information (external) and transformation(internal), and therefore must begin with a question” . So the main purpose of the education should be like “The one real object of education is to leave a man in the condition of continually asking questions.-Bishop Creighton”

The forth point I interest in is the ” studying other and ourselves” . We sometime want to know others more and forget to study our inner side. But to know oneself is the best way to know other people, because we are the same, to some extent, as a human being in this universe.

The Fifth point is about the “change”. I can’t more agree that change itself is a very difficult thing. In fact, it a totally overthrow the former one and embrace the new life. People don’t like to deny their own deed. We trying to find proper excuse about all our deed and make sense of everything that we have done. If someone want to Change, it not merely about he/she wants to change, but they have to change both cognitive as well as the emotion and pay some courage and make the different. To make different is the key point.

日常解析:曼昆的《经济学原理》微观分册 经济学十大原理 “人们如何做出决策的”

概在一年前, 我想大概了解一下金融有关的知识还是很有必要的。当时不知道是哪个书商搞活动,大老白看我情绪高涨就给我购买的经济学原理第5版的两册。当时也是懵懂地略微知道一些大概的有关信息。虽然一直在工作着,我明白自己欠缺很多东西。而随着年龄的增长,越发觉得自己的知识面狭隘得近乎可怕。

宏观经济学那本稍微薄一些,我原本是想从它下手的,这一下手就拖到了今年。上个月学习计划出来之后,我转向从《微观经济学》。一个月的时间,居然也慢慢学习完了。有时候,读书如果是为了读完书,反而还没有什么效果。前两天做的mind map,把这本书的框架都梳理了一遍。

首先读到的是经济学的十大原理,国外的人很直白,一开始就阐明了本书最重要的几个观点。而这些观点,穿插在了之后的所有章节里面。

一.人们如何做出决策
1.人们面临权衡取舍
2.某种东西的成本是为了得到它所放弃的东西/—机会成本(oppertunity cost)
3.理性人考虑边际量/–比较边际利益(marginal benefit)与边际成本(marginal cost)
4. 人们会对激励做出反应。

第一点:人们面临权衡取舍

我生活中有一个朋友,最近他问大家,说他想换个工作,让大家给点意见。至于为什么不在原来那家干了,他说是因为做太久烦了。当然,我知道,原因可能有很多。但是,目前最重要的是他要做一个决策。那么,我就试试用以上的原理来分析一下。

首先,他面临的第一个就是权衡取舍。我们要抓住问题的本质是什么。事实上,他说做烦了,只是一个表面的理由。最根本的理由从物质和精神层面上讲或许是:没有向上发展的空间、薪水少不够过上自己满意的生活、人事关系复杂难相处 等等。

首先,我们必须知道自己为了什么在做权衡取舍,我们的目标是什么。因为“做出决策就是要求我们在一个目标与另一个目标之间进行权衡取舍。”

第二点:某种东西的成本是为了得到它所放弃的东西。

这里面有个非常有趣的单词叫做机会成本。 但是“由于人们面临权衡取舍,所以做出的决策就要比较可供选择的行动方案的成本与利益。但是许多情况下,某种行动的成本并不是一目了然的。“

作为自己的决策者,我们真的知道每一种行为多带来的机会成本吗?这让我想到了以前高考填写自愿的时候。说来惭愧,当时真的不太清楚自己以后要做什么。除了跟大家读一样的书,上一样的课,参加同样的考试。仿佛只有一条路。而这一条路造就了很多《那些年》里面的沈佳宜。至于那些一再复读的同学们,耗费大量的金钱与时间,其实都是一种成本。他们的机会成本是为了读上名牌大学所花费时间和金钱。 每一个人的机会成本都是自己来衡量的,

打一个通俗的比方,公司要派你出差1美国年不得回家,工作辛苦,但是貌似可以镀一层金。但是你才交了女朋友,感情正在开始稳定准备结婚,如果离开可能会面对的是婚事的告吹。 所以我们才会常常听到有人问的问题“你是要我,还是要工作 ” “如果同时落水,救我,还是救你妈妈?“瞧,生活是最好的老师,而我们时时刻刻都在面临选择以及考虑机会成本。有人说,要是我能分成两个人就好了。可是,天下怎么会有这等美事,我们不可能是每样都占了,所以为了得到一些东西,我们就需要放弃另外的一些东西。而在权衡之中,我们才知道哪样才是对我们来说最重要的。

第三点:理性人考虑边际量。

当时在看这个的时候我还真的有点没有理解清楚。那我们来看看比较“边际利益“和“边际成本”来做出决策。我想想有没有什么通俗易懂的例子来诠释这个问题。

比如说我爸这次春节请他的同学到家里吃饭这件事情,他就充分展现了这一考虑。春节家家户户都做了很多吃的,我们家也不例外。如果饭菜很长时间没吃完,也就是浪费了没有任何价值。所以我爸非常积极热络地找他的一些同学来我们家聚会。对于他来说,朋友们来吃饭,他相当于是通过这次活动又联络了感情(边际利益)但是边际成本(饭菜)由于他做饭菜的初衷并不是请他们吃饭,于是成本几乎可以忽略不计。

第四点:人们会对激励做出反应。

最有趣的一句话就是。一位经济学家提出”人们对激励做出反应,其余内容都是对此的解释.”

日常生活中的激励有很多。大到外汇汇率涨跌、房价的涨跌、股市涨跌、物价上涨。小到你小孩吃饭的时候,你鼓励他说,快吃,吃完了可以吃个糖糖之类的。

大家都在积极地对激励做出反应,所以在分析问题的时候,激励就是一个非常关键的因素。比如说前几年股票攀升快,这个激励大家都开始买股票,而后就是炒楼盘。还有就是改革开放后南下的打工大潮。这些都是我们对各种激励做出的反应。

以上的几点看起来真的非常简单,但是如果在做决定的时候能首先清楚地考虑到以上几点。那么就会花费更少的时间来做出一个正确的选择。时间是最宝贵的东西,我只是放弃了每天看一节电视剧的时间来看书,但是书中的知识会帮我节约更多的时间。我的机会成本只是一节电视剧的时间,但是我的利益却是我懂得知识后节约的决策时间。这样算来,我的边际成本几乎为零,而我的边际利益远远大于了边际成本。因此这对我来说成为了一种激励,而这个激励让我每天都会保证拿一点时间在阅读上。

Precalculating FOV of Tiled Map

FOV(Field of View) is a very interesting graphic effect in game. With it, game designer create a asymmetric information environment for players and them get mysterious and exploration experience. There are many ways to implement it, because I will apply it on a tiled map and the view radius is not very big, I use a precalculating way. The algorithm is

1.For all cells in the view, set them as blocked cell one by one, then calculate all cells in the shadow of the blocked cell and store them. I call the result shadowmap. It can be a Array<Coord>[row][column], row and column are position of blocked cell, Array store the shadow cells’ coord.

2.Create a two dimension array visiblemap, init it as all cells is visible. Set player as the center, check the real map and visiblemap spirally,


if cell of visiblemap not visible

then continue

else

if cell in realmap is blocked cell

then look up the shadowmap and set all related cell invisible

It’s not flexible method and need a lot space to store shadowmap and visiblemap compared with classical shadow casting. However, all calculating work could be done before runtime, my further work is comparing it with classical shadow casting and find which one is fast.

Are Foxconn and Apple Evil Alliance

Once upon a time in China, one minister told his emperor the people are starving because the drought killed all crops. The puzzled emperor asked why the people don’t eat meat. It’s real history not joke, since that time Chinese use Why not eat meat? describe the person who lived too comfortably and don’t know the real situation.

Apple is in trouble because some good people care about the workers in Foxconn recently . They against Apple and Foxconn because many people suicided in Foxconn and the overtime work is too much and the salary is too low. All they said is true, in 2010 there are 11 people suicided and the suicide rate is 1.5 per 100,000,  by the way the Japanese rate in 2011 is 22.23 per 100,000. The payment is really low in Foxconn, about 51 cents per hour(actually is higher than this right now because the inflation in China), no citizens from developed country can accept this in my mind. In 2010, the annual income of Chinese farmer is about $930. Let’s assume a worker in Foxconn work 8 hours per day and 20 days per month, the annual income is $960, not too more than the farmers’ income. However, the overtime payment is much higher than normal payment, in most Chinese factories and companies(like my formal employee, a big international company) there’s no payement for overtime work. Plus the overtime payment, the total income from Foxconn is very attractive to young Chinese from countryside. Almost all workers in Foxconn from countryside, they don’t have bachelor degree and can’t be a white collar, so  they don’t have many choices. Working in Foxconn not in other worse factory is the best choice for them.

So for a normal Chinese young man in Foxconn, his goal is simple and clear, making money. Be rich is a common dream in China, beside money, they also can get new  skill and information in Foxconn, these things may lead them to a bright future. To some degree, all businessmen are evil, all they want just profit, but do the goodmen can do good thing? I don’t think so.

Auto Generated Dungeon with libgdx

Rougelike is a interesting game genre, the most important thing in Roguelike game maybe is the procedural content generation(PCG), which provide player tons of game content. From  triple A game Diablo series to the game seldom known to mass Dwarf Fortress, one similar point is they all use PCG.

My target is make a Roguelike game on Android with libgdx. This game use tile map to present game content. Luckily, the powerful libgdx support tile map. I only have to do two things on dungeon generation, generate dungeon map then use tile map present it.

1.Generate dungeon map data.

There’re a lot of resource about dungeon generation, I recommend below ones.

Random Dungeon Generator It explain the algorithm and provide simple source code(Perl) and online demo.

Unangband Dungeon Generation It has 9 parts and source code can get from Unangband.

2.Tile map

The current libgdx 0.92 only support read map data from TMX file, new version of TiledLoader can read map data from String. Because we generate the map data and don’t have TMX file, so we should build one.


TiledMap map;

public void writeTMX(String pFileName){

StringWriter writer = new StringWriter();

XmlWriter xml = new XmlWriter(writer);

//in libgdx 0.92, TileLoader only can read tmx file from FileHander, future version will support tmx string

//this implement is NOT use on Android version, just for test

FileHandle tmxFile = new FileHandle(pFileName);

try {

//map's start

xml.element("map")

.attribute("orientation", "orthogonal")

.attribute("version", "1.0")

.attribute("width", tileIds[0][0].length)

.attribute("height", tileIds[0].length)

.attribute("tilewidth", tilewide)

.attribute("tileheight", tilehigh);

//tileset

xml.element("tileset")

.attribute("name", tilesetName)

.attribute("firstgid", tilesetFirstId)

.attribute("tilewidth", tilesetTilewide)

.attribute("tileheight", tilesetTilehigh)

.element("image")

.attribute("source", tilesetSource)

.pop()

.pop();

//layer

for(int layer = 0;layer < tileIds.length;layer++){

String csv = "";

for(int row = 0;row < tileIds[layer].length;row++){

csv += toCSV(tileIds[layer][row]) + "\n\t\t\t";

}

xml.element("layer")

.attribute("name", "layer"+(layer+1))

.attribute("width", tileIds[0][0].length)

.attribute("height", tileIds[0].length)

.element("data")

.attribute("encoding", "csv")

.text(csv)

.pop()

.pop();

}

//map's end

xml.pop();

//write to a tmp file

Writer fileWriter = tmxFile.writer(false);

fileWriter.write(writer.toString());

fileWriter.close();

} catch(IOException e){

throw new RuntimeException(e);

}

map = TiledLoader.createMap(tmxFile);

}

Then use TileMapRenderer draw the tile map.

The full code of this sample you can find on Github. As I said it’s just a sample, to be a real tile dungeon generator, it still have lots of work to do like different room type, monsters and other game objects.

Reconstruct the blog

Yes, I combine three blog to one, K.G.B. is together right now. The main reason I did this is easy to manage, since now I only need care about one blog not three. All I need to do is find way to generate pages contain all posts of one author.

Resist the Temptation of Crossplatform

Porting game to different platform is boring compared with developing new game, that’s why there are so many technicals to solve this problem. Developed once, deploy everywhere. It’s really awesome for everyone want their software run on different platforms.

iPhone and Android are two big tribes in mobile industry and they are so different, obj-c and java, that make crossplatform developing very difficult. Right now the best way is Unity, but I have to say it really a bit expensive for small budget developer(like me :-) . Recently the cocos2d-x attract my attention a lot, it seems like very promising and there’re already many games released with it. But after careful consideration, I resist the temptation. Below are my reasons.

1.It’s not mature enough, for Android, there some phones they don’t support. Maybe it’s best tool for porting iPhone game developed with cocos2d-iPhone to Android, but I don’t have strong sense of security on Android.

2.Learn new technology cost a lot. cocos2d-x use c++ and the API is like cocos2d family, I know c++ but the API is stranger to me.

3.Debug is difficult on Android.

4.Native technology is the best friend of platform, always.

5.The most important things in making game is making a good game. If the game is not a game on a platform, so it’s not neither on the other. Technical complexity would attract more attention than we should paid, means less attention to the game itself.

So, libgdx is still my best friend on Android :-)

From Lhasa to Mohan

Lesley

First I should thank generous Lesley, with his permission I have this chance to travel. Lesley is a handsome Walsh with dreadlock, this hair style made him very attractive in China, which made him very uncomfortable in crowd. The different attitude to uncommon thing in west and east is one lesson Lesley learned in his journey . Hope him can find his nature and peace in the small village of Laos.

Illusion of Holy Land

Most people, especially non-Chinese have unrealistic imagination of Tibet. I think it may lead by mass media, they described Tibet as a pure holy land, all lost good things out there. I should admit, years before like other undeveloped region, old tradition is strong on this land, people have little idea of commercial society. However right now, things changed a lot on this land. Some blame technology, some blame commercial society, most blame China. My explanation is simple, time changed. Like other place in the world, time also affect this holy land. The youth of Tibetan also want big television, Nike sport gear, beautiful and useless things created by modern world. You got more, you lose more, that’s the balance.

Tibet is not barren land, if you travel along the national road you can find people everywhere. If you want a close look to famous viewpoint, you should pay for it, include Mt. Everest. They built the road and built the gate, then you should pay for the convenience they provided.

I know it’s not easy for non-Chinese go to Tibet, and also not cheap. The easier B-plan is Tibetan area out of Tibet. If you just want enjoy the beautiful nature of Tibet, Tibetan area in Sichuan province is another good choice. You can trek around  snow mountain in mountain area, hired local horse ease your burden. This area is totally same as Tibet and most important things is you can travel in this area without any official restriction.

Tashi 1 Restaurant

The best restaurant I have visited in Lhasa is Tashi 1. It’s price is very reasonable, I mean cheap and tasty food. The recommend dish is Yogurt Cake, Fried Dumplings and Bobi with 4 Fruit. You can find it on Zangyiyuan Road, near Beijing East Road.

Canggu Temple Sweet Tea House

When you walk in old town of Lhasa, you can find many tea house in it, and the best one must be the Canggu Temple Sweet Tea House. As its name said, it located near Canggu Temple. The environment is perfect for drinking tea, and the price is amazing cheap, maybe because its mainly customer is local Tibetan.

I know many non-Chinese tourist in Tibet dare not to try Yak Butter Tea. You can see the funny face when you invite them to drink the tea. Tibetan drink salty yak butter tea in the morning and have sweet butter tea in other time. I prefer the sweet one and it is also easily accepted by non-Chinese. If you want try Tibetan tea, drink sweet tea in Canggu Sweet Tea House is a good choice.

Shambala Palace 

Shambala Palace is a beautiful hostel in old town of Lhasa. Really difficult to find because it’s located in a dead end of alley, you can find the detail on their website. The hostel reconstruction from a old Tibetan building once owned by a Tibetan noble, in my words, you can see Tibetan ghost strolling in it at night. You can see Potala Palace on its roof and all decorations are from local Tibetan.

Because it’s an old building, the sound insulation is not good. Fortunately, everyone in this hotel is keeping quiet, maybe because the ghost is watching us :-)

Stone Pot Chicken

Along G318, Sichuan food is the most common food you can find. If you passed Lulang(鲁朗), you can not miss the Stone Pot Chicken. Actually, this dish is also not Tibetan food, some restaurant invent it recent years. The stone pot is from Medog(墨脱),  put Tibetan chicken, local mushroom and other vegetable in it. Believe me, it’s most delicious dish you can have along G318.

4028 Campsite

G318 start from Shanghai, end at Friendship Bridge in Tibet, full length is 5476km. 4028 Campsite is beside the 4028km milestone and is the only campsite along G318. It’s a lovely place, you can see snow mountain from it, yak and horse are the visitors. The campsite owner have a Tibetan pig named Hemei, if you touch it, it would sleep down to enjoy your touch. Another pet, a dog named Dianzang, it would use its nose to scratch you to beg food.

This site provide food, shower, toilet, wifi, charge and camp equip rent service. And they accept foreigners.

Songstam Meili

Songstam Lodges have five lodges in Yunnan Tibetan Area, Songstam Meili is the new found one located near Mt. Meili. All Songstam Lodges are five star standard hotel, the decoration is Tibetan style and staff are very nice. In every room of Songstam Meili, you can see Mt. Meili. You can’t find a better place around Mt. Meili, so why not award yourself in the tough journey?

The room rate of Songstam Meili is between  RMB900 to RMB1600, dinner is RMB 150 per person. They also provide trekking service.

American Style British Guy

In the night of Songstam Meili, there are three guests there. Me, my girlfriend and a British Guy. Except the accent, you can’t find any relationship from him with British. Maybe the reason is he leave Britain since 1997. He worked in a American chain restaurant company, most time in Hongkong, sometime fly to Shanghai for business.

He amazed to see Chinese buy luxury with bags. We made our explanation and tell him the gloomy future of China we worried. As a foreigner worked in China, and not taken English teacher as his job, he has a bright future, his Chinese colleague and friend never tell him real China, he can’t see the dark side of China. When we told him check the citizenship of his Chinese wealthy friend’s family member, who recently move his family from Australia back to China, we see the non-British face again. Chinese are clever. That’s my explanation.

It seems like almost every foreigner has one Classic Foreigner Question. Before ask the question, they always said you have the right refuse answering it. This guy has his own. After I answered it honestly, I though China is most difficult enigma on this world for foreigners, even you live there you also can’t understand it. Then a strange proud fill my heart.

Tiger Leaping Gorge Trekking

It let me dying. As a computer geek, OK, a nerd, I am very proud I spent one and half an hour from Mr. Zhang Hostel to Tiger Leaping Gorge and back. You should know the normal Chinese take two hours. We started too early, not saw the grandma drug dealer who sold weeds to foreigners. What a pity.

Lijiang and Dali

They both are old town. I prefer Lijiang, it’s small and artful, though a little artificial. Dali is different, many local people live in it, so it’s more practical. Maybe Dali is suitable for long-tern stay. But I just passed by, so Lijiang is more attractive. By the way, Lijiang is famous by its nickname Capital of One Night Stand.

Finally, we arrived Mohan, the Chinese border town to Laos. Farewell to Lesley, we back to Chengdu.

Medical Handbook

Recently, I’m reading the Medical handbook from World Challenge.

I think it’s very useful although it has lots of words that I can’t understand very well.  But in fact, it encourage me to read very carefully, in case i might meet some problem when travelling aorund the world.

When we use the medicine, we alwasy ask the advise from the doctor or go to the Pharmacy. But actually when we see those unfamiliar medical words, have no idea how it can work for our bodyBest solution is not take medicine unless it’s really necessary.

However, it’s also useful to know the prescription. And also use the medicine in a proper way, or else, it can be the poison.