10/04/2015

远交近攻

Robb让Theon当使者是他一连串错误的开始。Robb刚被加冕的时候,面临主战实力不够,主和内部压力太大的问题,考虑到Winter is coming的背景,在大的战略上逼Tywin签立城下之盟是正确的。但是在战术上,他选择了给Cersei开了个不可能答应的条件,然后送Theon回The Icon Islands。前者可有可无,但与其让主张更软一点的Catlyne和更硬一点的Karstark两边都不满,不如选择试图和Renly、Highgarden结盟(Stannis试都不用试,但是也应该排遣使者说明自己无意染指Kings Landing,自己虽然称王,但愿意为南方诸国挡在The Wall和Riverrun之间),在军事上配合Renly,让Tywin无法兼顾Riverrun和Kindslanding;后者则是最大的失误,一是不应该派人质当使者,二是不应该对Balon居高临下地说什么Give him a crown这种屁话,相反对Balon应该比Renly更加恭敬,因为如果能说动Balon牵制Casterly Rock,作用比攻占Kinds Landing更大,能主动出击的Tywin显然比只能被动防守的Kinds Landing更为重要,毕竟北军的目的并不是统一全国。

如果真的这么做了,Balon可能会起到更好的作用,自己大本营Winterfell也不会被冲动男Reek一锅端;和Renly的联盟会在Stannis暗杀成功的时候瓦解,但Highgarden会有机会联手北方而不是Lannister,因为如果Lannister被Balon和Stark夹攻,Highgarden就不会那么明显地去选择Lannister结盟了。

总之欧洲土老冒就是不明白中国人两千年前远交近攻的智慧。

4/15/2015

I Decided to be AFK from Diablo 3... Unofficially

As the clan leader of Australian Gamers, which is the largest Diablo 3 clan in Australia, I decided to unofficially be AFK for a while. The reason was that I made a big mistake, but here's briefly what happened in the start of Season 3:

Day 1: Reached level 70 in 6 hours as always (could be 5 with a good team) and being able to do 2 player T6 at the end of the day with charge set.

Day 2: Being able to farm Greater Rift lv 40 with waste set at the end of the day.

Day 3: I thought one of the conquests was levelling a legendary gem to level 40, but actually it was 6 gems... Found out when I levelled bane of the trapped to 40 and was so frustrated and decided to be AFK since I feel like I should start to do something constructive, for example work overtime. 

Basically I'm hitting the bottle next in some conquests, for example:

- I won't be having enough time to level 6 gems to level 40, which may cost 2 or 3 nights.

- Gem of the hoarder only drops in vault in season 3 and I don't have time to farm for it, so no 50M gold conquest. It can be painful to try to look for the vault and may take 2-3 nights to complete.

- I've completed GRift 40 with IK and charge sets, but tried several times with charge/IK + earth and failed, and I don't have time to build another class (though this would be the easiest one for me it's still going to take a whole night).

- Other conquests are even harder or impossible for a single player, and I prefer solo a lot (our clan members are quite active though it's just my personal preference).

The game is still great (much better than Hearthstone and Heroes of the Storm) and it's even greater in Season 3, but I simply don't have enough time. Too bad. BTW thank you Vlad for helping manage the clan! Wish all of you the best of luck and I'll be back... Soon.

4/14/2015

IBInspectable Cannot Be Optional

Not sure if Swift 1.2 fixed this but

@IBInspectable var title_align_center: Bool?

Works in Interface Builder but the app crashes without warning. IBInspectable cannot be optional.

4/09/2015

Switching from Tab to Buffer in VIM

When I started using VIM I didn't realize that tabs were supposed to be used as different window layouts, and buffer serves the role for multiple file editing / switching between each other. Actually in the beginning tabs are not even there before v7.0 and I just opened one VIM inside a terminal tab (I was using gnome-terminal at the moment), and switch between tabs using alt+numbers, since I thought using commands like :buffers, :bn and :bp were too much for me. When VIM 7.0 was released I find it's easier to manager a lot of files and switched to it, but recently I just realized that buffers should always be the way to go, unless one thing: you need to configure it to make it works right.

So I tried vim-airline and enabled the visual on-top tab-like buffer bar, but graphic was having problem with my iTerm2, so I tried a couple of others and it seems that MBE works the best for me. I also set shift+h/l as shortcuts, since the original ones (moving to the head/tail of the current page) is not very useful to me.

map <S-h> :bprev<Return>

map <S-l> :bnext<Return>

It seems to be even easier than gt and gT, and :e is easier than :tabnew too. I find :bd is not as convenient as :q though (MBE is having some problem with it) but I can live with all files in buffer I think. Glad to learn more things when I'm getting old.

This is not Cool, Dude

Recently I've been working on some code wrote in 2013 by some dude, and I kind of feel it's funny due to the quality of the code. Yes there are some more advanced topic about how to write good code but you don't really see example of bad code everyday, for example:

[[[[self tabBarController] tabBar] items] objectAtIndex:3]

And I'm about to change the order of the tabs.

UIViewController *viewController5 = [[MoreViewController alloc] initWithNibName:@"MoreViewController" bundle:nil];

Nice variable name.

Duplicated code.

It's hard for us to totally avoid duplicated code (especially for those 2-line codes), but copy/paste the whole login code/xib into 2 places is just... not very common.

CGRectMake(0, 0, 320, 44)

It used be everywhere but not anymore, so hi old buddy! Actually you don't need to use things like UIScreen.main_width, self.view.w should be fair enough (+main_width and -w are from LCategory) in most cases. 

Why, oh why?

    if (selectedScope == 0) {

        distanceToFilterResults = filterDistance500M;

        [[QCDTaskMaster sharedInstance]setFilterDistance:filterDistance500M];

    }else if (selectedScope == 1) {

        distanceToFilterResults = filterDistance5KM;

        [[QCDTaskMaster sharedInstance]setFilterDistance:filterDistance5KM];

    }else if (selectedScope == 2) {

        distanceToFilterResults = filterDistance50KM;

        [[QCDTaskMaster sharedInstance]setFilterDistance:filterDistance50KM];

    }else if (selectedScope == 3) {

        distanceToFilterResults = filterDistanceALL;

        [[QCDTaskMaster sharedInstance]setFilterDistance:filterDistanceALL];

    }

I totally don't understand why someone would write code like this. There are more than 5 ways to make the code cleaner.

...

There are a shit load of stuff like this, and guess who's not cool? It's me 'cause I'm making fun of other people, which is totally not cool. Don't do it kids.

4/04/2015

No Surrender Option in Heroes of the Storm? OK Let's FEED!

Today I read an office blog from blizzard at http://us.battle.net/heroes/en/blog/18543837 since they "believe the game is never officially over until the core is destroyed", and linked a match video to back it up. For those who don't have to time to watch it, I'll explain what happened:

  1. This match is between blue team "Tempo Storm" and red team "BarrelBoys" on the graveyard map, which are 2 professional teams that every member of them knows how to cooperate with the other members, while in the normal match making we usually face players who don't even know how to play the game properly and refuse to take advice.
  2. In the beginning of the game, Red dominates the game, got a couple of kills without being killed, and got a 60+ skulls. However, until level 10 Red was just one level ahead, while in match making you always find yourself 2 levels behind when you're in a really bad team.
  3. Red made the first mistake by not entering mine for the 2nd golem in time, which resulted them in a position with a 30+ skulls golem. And then they made the 2nd mistake by pushing with the weak golem while all 5 Blue members were there. So they failed and the levels were even.
  4. Red made the 3rd mistake by entering mine in the 3rd time too early - at 00:30 seconds mark and spread which was bullshit. Blue easily came in with a better team formation and got a 100 golem. This kind of mistakes can only happen in professional matches because all members have to blindly follow the leader, which is not the case in match making, and it's pretty rare to make 3 big mistakes in a row TBH.
  5. Here's the real turn around. Red made the only right and final decision: a final push. They ended up killed the whole blue team and ignored the 100 golem, and won the game with only 2% health in its own core. I admit it WAS a turn around, but it's still only 1 level difference between the 2 professional teams, while in match making it's easily seen 3 or even more level difference between a good team and a really bad team.  

So this match just proved the contrast: there are not that many come backs in match making. Of course I played a lot of matches with come backs but firstly it has to be the case that everyone seems to know how to play the game, and secondly, it's not too behind. For noob vs noob it would be fine for me because I can deal with 2 or even 3 noobs in a match. For average vs good it's hard but we still have chance because I'm good myself. For noob vs good it's really painful, especially noobs always ask for strange things and dont' take any advice. In this case a surrender option is not going to help too much because noobs would like to continue anyway, but it'd still be good to have it there because sometimes there are noobs with good attitude. And finally there are cases that we are in a good team but the enemy team is elite. They may be a good team themselves with cooperation etc. and everyone in our team would surrender due to the shitty match making system.

So you see, the core of the problem is match making. Since they can't make it even for now (it has to be hard and I wouldn't expect it) they should admit it and add the surrender option. This is the problem of Blizzard: they thought they were better than the players to make decisions, but in the fact they are just some awful designers sometimes. There are a lot of mistakes made by Blizzard. For example, in Diablo 3 it's not hard to calculate the in-theory max output of a build, since the set items are already there. But they still make some numbers really off and adjust them quite randomly, e.g. they nerfed the Immortal King set from 500% damage enhance to 100%. For a game designer you should at least do some calculation and found how off it would be to put a 500% damage enhance there in the first place, but they simply didn't. And as technicals and businessman they made some awful decisions too, my favorite one was that they thought Healthstone was going to be a small game and had chosen Unity as the engine of Hearthstone, while looks like shit and produced countless graphic problems later. Even now in the early-mid 2015, the newest patch still introduces ridiculous bug like showing "ghost" cards in deck making, and even I wouldn't make this sort of stupid bugs there if I've done it with my own engine, needless to say for Blizzard because they are really good at game engines. So back to the topic, they can introduce some punishment in surrender etc. but they just simply refused to admit that they FAILED to make the game even. It's perfect fine no one would expect 100% even matches in match making, but at least you should add surrender there so that I'm not going to do something I don't want to do, but I'll have to do when I feel it's all Blizzard's fault, which is simple: feeding.

Blizzard is able to know whether I'm playing the game or not, but it can never know if I play it in a good or bad way because there are so many shit players there. So I would just attack click enemy core every 3 to 5 minutes or so and write some blogs at the same time. Anyway, what's so hard to feed? It would be even better if I just wrote complain letters to their customer service and use their human resource but that would be too harsh. It would be more effective though if that can make them realized how silly they are, but anyway I don't care.

12/20/2014

Setting up a New Mac

Some highlights about setting up a new mac without time machine (pretty sure I've written something like this years ago.

Edit sudo

sudo visudo

iTerm

Quake-like window: https://www.dropbox.com/s/ucw0hzzoy3vwt2k/Screenshot%202014-12-20%2014.46.01.png?dl=0

Add command-x as control-c: https://www.dropbox.com/s/0lfbdtwwvv1ghuk/Screenshot%202014-12-20%2014.44.52.png?dl=0

Hotkey: https://www.dropbox.com/s/x7deslelvh1z319/Screenshot%202014-12-20%2014.46.13.png?dl=0

Vim

Get vim with +clipboard: brew install vim | sudo mv /usr/bin/vim /usr/bin/oldvim

10/12/2014

Why do I Support Umbrella Movement as a Chinese

Why do I Support Umbrella Movement as a Chinese

No one is able to predict what will happen to Hong Kong after this so called Umbrella Revolution, and other than stating it is by far not an actual revolution, I would like to make four statements regarding this matter. 

1. Democracy can be bad sometimes. But dictatorship is not a good thing. 

It is probably better to replace good and bad with rich and poor, but sometimes moral plays a big role in our lives too so I have chosen a more generic wording as my conclusion. Anyway, I would not gave written the first sentence if I was writing in Chinese as that is a mostly accepted fact among the people of this fast growing country. Other than those uneducated Falungong members, it can be easily told that even with democracy, countries in South East Asia, South America, most of African countries, and Indian (yes Indian, one of the favourite examples of some Chinese government supporters  although most of them haven't really been there and studied how that giant country runs) are not really as "good" as their western mentors. People there are happy but it seems almost impossible to get rid of problems like corruption and the lack of living resource, ie they are poor. 

But in the other hand, it doesn't mean that dictatorship can be a good thing to have. It's funny that there are kind of two words to describe dictatorship in Chinese: one is "ruling alone" and is used as a negative word to refer to the old emperors and kings and modern dictators like Adolf Hitler (but not friends of the Party like the Kims, and the Party itself of course), and even the old enemy Guomin Party; and the other is "dedicated in governing", which is not surprisingly, to refer to the party itself. The latter is always used with the phrase "people's democracy" as it is stated in the Law that "China is a country that is lead by the PRC and it is dictated by people's democracy". It sounds pretty much bullshit but anyway, under the dictatorship of PRC, China has become what it is in 30 years, from a totally fucked up country that was destroyed by the same party that was under mostly Mao's control. 

Regardless the case of Singapore, the favourite example of anti-democracy of the Chinese government, China's case itself already proved that democracy is not the only way leads to being rich and civilised. Sure some Chinese people are suffering from smog and other shitty stuff, but education and medical expenses are affordable comparing with a lot of western countries, which may sound surprising to a lot of Chinese since in general it is believed that China is going really bad in these fields. It is going to be a long and possibly arguable topic about public expense in China, but anyway, denying the achievements China had doesn't make any sense. Most Chinese just live their daily life in a similar way that the people in New York and Sydney do, they are normal people like us and also getting richer. 

This sounds a bit weird. Didn't I try to state that we cannot really say dictatorship is a good thing? How come the Chinese people are still doing pretty good? The answer is simple: what is making China rich is not dictatorship. Here comes my 2nd statement: it's the culture. 

2. Culture determines how good or bad a country can be. 

When I say culture, I mean all the historical aspects of a country, or "everything that makes the people of the country as they are". It sounds like a meaningless loop but my point is that it is exactly how the world works. People give too much credit to things like democracy or the power of "being dedicated in governing" if you are from media of PRC. It doesn't really matter that much. A good theory should explain why things are like what they currently are. A better solution is able to predict future in some degree. Bad theories, in the other hand, always try to find excuse for exceptions, like how Falungong explains why there are so much corruption in Indian and how the Chinese government explain why North Korea is one of the worst countries in the world. 

Let's see this culture thing. Counties in North America and Western Europe are rich, because the people there believes equality, democracy, science, capitalism, freedom of trading, contract. They kept expanding and spread it and the whole world is under the influence of the western culture. They work not that hard but work smart. They enjoy their lives and keep a good balance between life and work. They have accumulated a huge number of fortune and intelligential properties, and set an example to all the world that how good a country can be. They made mistakes like slavery and invasion, but they corrected themselves and keep involving. Thus, democracy is the result, not the reason.

It applies to almost all the other places. In Asia there's no such thing as equality, people respect power of authority, and sometimes the force that disobey the authority. In the other hand, people also work very hard and instead of live a happy life themselves, they would do almost anything for their children, but in return the children must always respect their authority. This explains why China, Japan, and Korea have so many things in common: they are revived upon ashes and became developed (well for China, at least the big cities) in a relatively short time. It's not about democracy or dictatorship. As long as the dictator is not as bad as Mao and the Kims, these Asian countries will do a good job in economy. The real difference is that how the culture adapted. The Chinese believes their culture is still the best, so without the spirit of equality they may not be able to do a lot to the poor class, but they can gather the fortune people made together to make leap in fields like space ship or nuclear weapon, while the Japanese are more willing to accept the advantage of other culture (they accepted the Chinese culture thousand years ago anyway) and made Japan more like the western countries, while Korea is sort of sit in the middle. But they are all catching up, and made a difference with countries in South East Asia and South America.

I don't want to say too much about all the cultures but in general, democracy is always the result but not the reason of the "good" aspects of different cultures. Then why I'm still saying that I support the movement in Hong Kong, as I stated in the title?

3. Culture can be changed little by little. And the best time to change it, is now.

The brain washed Chinese may argue that it has to be at the "right time" to make a chance, like Indian changed their culture to sort of western but still has serious corruption problem. Actually, the reason of the corruption in Indian is exactly that they are not really adapted their culture. The people are still willing to live a poor and happy life, which comes from ignorance and misunderstand of how the world works, like the strong believe in some religions. The westerners have already realized that even God loves them, they still need to take care of themselves but the traditional Indians keep believing that the true meaning of live is afterlife.

The good thing about Hong Kong is that unlike the mainland, Hong Kong was colony of UK for a hundred years. It has its own problems but its culture evolved to the right direction. However, China is rising fast in the past 35 years and it keeps trying to say that dictatorship can be a good thing and even the solution of the problems caused by democracy. It's a dangerous assumption, because the reason of the rising of China, as I said, was not dictatorship. It's the hard working Chinese people. So I'm very glad to see the Hong Kong youths are standing against the dictatorship. Even they may hate the normal Chinese people like myself at this sensitive moment, it's still a good thing, because the culture they want to evolve to is able to guild them to the right path due to its nature of equality and reasoning.

4. Last but not least, it's not very hard to see this movement is not likely to lead to anywhere. But it's a good signal to the Chinese government, that they need to evolve as well. Everyone knows China cannot be growing as how it is so it needs to change at a certain time, maybe not now, but it will not be as late as 50 years later. It is politics. And it's why Umbrella Movement as a Chinese.

PS: About political correctness

I don't believe race is a matter, but I do believe cultures are quite different, which means an American born Chinese would be more similar with another American rather than a Chinese. You can't choose your race and it's totally fine since it's not important at all, and it's possible you adapt to a different culture. I don't think I'm 100% political correct, but I don't care anyway. Some people would say "you can't say cultures are good or bad, they are just different", well I'd quote something from Book of Mormon the musical:

If you don't believe what we say
Try live in here a couple of days
Watch your friends and family die
Hasa diga eebowai!

7/06/2014

当你遇到广东黑社会的时候怎么办?

技多不压身,当你遇到广东黑社会的时候怎么办?莫慌!

现在是粤语学习时间:

扑街,吹咩!(朋友,住手!)

郁我啊锁嗨!(自己人!) 

丢类劳味啊!(大哥别打我!)

调理劳务系!(交个朋友吧!)

来广东的朋友不要怕 这4句够你用一生