2016年12月14日星期三

Add an existing project to GitHub



1. Create an empty repository in GitHub

  • login your GitHub account, click the 'plus' sign on the upper right corner to create a new repository;
  • give a repository name; choose public or private; do not check the checkbox in front of 'Initialize this repository with a READEME'; then click 'Create repository' button;
  • copy the repository address: click the copy icon on the Quick setup page
2. Push the existing repository from the command line
  • open a command window in your system
  • in the command window, input:
    • git remote add origin https://github/lafeike/test.git
    • git push -u origin master 
3. Delete a repository in GitHub
  • Click to your repository 
  • Then in the main toolbar of github click on Settings
  • Scroll just a little bit down and you will find Delete this repository button
  • When you click it another pop up will appear here you need to type in the name of your repository and click on the button below which says: I understand the consequences, delete the repository

2016年12月9日星期五

遗言- 任诞

金圣叹:好快刀!

魏延: 谁敢杀我?

董卓:吾儿奉先何在?

灰太狼:我还会回来的!

瞿秋白:中国的豆腐也是很好吃的东西。世界第一!

佚名:十八年后又是一条好汉!

阿基米德:不要弄乱我画的圆圈!

2016年12月8日星期四

遗言- 明志

屈原:吾闻新沐者必弹冠,新浴者必振衣。安能以身之察察,受物之汶汶者乎?宁赴湘流,葬于江鱼之腹中。安能以皓皓之白,而蒙世俗之尘埃乎?

王国维:五十之年,只欠一死,经此世变,义无再辱。我死后当草草棺殓,即行藁葬于清华茔地。汝等不能南归,亦可暂于城内居住。汝兄不于奔丧因道路不通渠又不曾出门故也。书籍可托陈、吴二先生处理。家人自有人料理,必不致不能南归。我虽无财产分文遗汝等,然苟谨慎勤俭,亦必不至饿死也。五月初二日父字

路易十六:我虽然得死去,但绝没有犯过任何指控我的罪行;我宽恕造成我死亡的人;我还要祈求上帝,在我的鲜血抛洒之后,法国的土地上再也不要流血了。

安重根:大韩独立

子路:君子死而冠不免。

科本-柯特:与其苟延残喘,不如熊熊燃烧。

黄道周:纲常万古,节义千秋,天地知我,家人无忧。

遗言 - 尤悔


嵇康:昔袁孝尼尝从吾学广陵散,吾每靳固不与,而今绝矣。

崇祯:朕凉德藐躬,上干天咎,然皆诸臣误朕。朕死无面目见祖宗,自去冠冕,以发覆面。任贼分裂,无伤百姓一人。

白起:我固当死。长平之战,赵卒降者数十万,我诈而尽坑之,是足以死。

贺若敦:吾以舌死,汝不可不思。

董存瑞:千万不要相信河南人。

韩信:吾悔不用蒯通之计,乃为儿女子所诈,岂非天哉!

2016年12月6日星期二

遗言-慷慨


汪精卫:慷慨歌燕市,从容做楚囚。引刀成一快,不负少年头

豫让:吾可以下報智伯矣!

冉闵:天下大乱,尔曹夷狄,人面兽心,尚欲篡逆。我一時英雄,何为不可作帝王邪!

吉鸿昌:恨不抗日死,留作今日羞。国破已如此,我何惜此头?

夏明翰:砍头不要紧,只要主义真。杀了夏明翰,还有后来人。

王成:向我开炮

谭嗣同:有心杀贼,无力回天。死得其所,快哉快哉!


袁崇焕:一生事业总成空,半世功名在梦中。死后不愁无勇将,忠魂依旧守辽东。


2016年12月2日星期五

遗言- 家常

毛泽东:我很难受,快叫医生
江青:主席,我爱你!您的学生和战土来看您来了。

周作人:余今年已整80岁,死无遗恨,姑留一言,以为身后治事之指针。吾死后即付火葬或循例留骨灰,亦随便埋却。人死声消迹灭最是理想。余一生文字无足称道,唯暮年所译《希腊神话》为50年来的心愿,识者当自知之。

孙策:内事不决问张昭,外事不决问周瑜

刘备:若嗣子可辅,则辅之;如其不才,君可自为成都之主。

曹操:吾婢妾与伎人皆勤苦,使着铜雀台,善待之。馀香可分与诸夫人,不命祭。诸舍中无所为,可学作履组卖也

晁盖:若那个捉得射死我的,便教他做梁山泊主

诸葛亮:吾死之後,可任大事者:蔣公琰其宜也。公琰之後,費文偉可繼之

西门庆:我死后,你若生下一男半女,你姊妹好好待着,一处居住,休要失散了,惹人家笑话。六儿从前的事,你耽待他罢。

苏格拉底:克利顿,我还欠阿斯克勒比奥斯一只鸡,请别忘了还给他。

杨佳:你不给我一个说法,我就给你一个说法

慈禧:此后,女人不可预闻国政。此与本朝家法相违,必须严加限制。尤须严防,不得令太监擅权。明末之事,可为殷鉴!

伍尔夫:一切都离我而去,只有你的善良一直伴随着我。我不能再继续毁了你的生活,我相信,世上没有哪两个人可以像我们在一起这样幸福。


海子:我是中国政法大学哲学教研室教师,我叫查海生,我的死与任何人无关。

遗言 - 留恋

李斯:吾欲与若复牵黄犬俱出上蔡东门逐狡兔,岂可得乎!

陆机:欲闻华亭鹤唳,可复得乎!

王濛:如此人,曾不能四十.

拿破仑:法兰西,军队,约瑟芬...

杨广:好头颅,谁当斫之?

檀道济:乃坏汝万里长城!

瞿秋白:我留恋什么?我最亲爱的人,我曾经依傍着她度过了这十年的生命。我还留恋什么?这美丽的世界的欣欣向荣的儿童,“我的”女儿,以及一切幸福的孩子们。我替他们祝福。

顾城:木耳,我今天最后去看你,当马给你骑,我们都开心。可是我哭了,因为我知道这是最后一次见你,别怪你爸爸,他爱你、你妈妈,他不能没有这个家再活下去。

遗言 - 怨念

周瑜:既生瑜,何生亮?

袁术:袁术至于此乎!

岳飞:天日昭昭。

吕布:大耳儿!不记辕门射戟时耶?

耶稣:我的神!我的神!为什么离弃我?

林黛玉:宝玉、宝玉,你好……

伍子胥:抉吾眼悬吴东门之上,以观越寇之入灭吴也!

葉赫那拉•布揚古:吾子孙虽存一女子,亦必覆滿洲!

钟离昧:汉所以不击取楚,以昧在公所;若欲捕我以自媚于汉,吾今日死,公亦随手亡矣。公非长者!

遗言 - 悟道

王阳明:我心光明,夫复何求。

李叔同:悲欣交集。。。

聂绀弩:很甜,很甜。

鲁智深:平生不修善果,只爱杀人放火。忽地顿开金绳,这里扯断玉锁。咦!钱塘江上潮信来,今日方知我是我。

济公:六十年来狼藉,东壁打倒西壁。于今收拾归去,依然水连天碧。

纳博科夫:一只蝴蝶已经展翅待飞。

歌德:光,更多的光!

李贽:七十老翁何所求。

苏轼:西方不無,著力即差。

沈从文: 我对这个世界没有什么好说的。

释僧肇 : 四大元无主,五阴本来空,将头临白刃,犹似斩春风

慧能:兀兀不修善,腾腾不造恶。寂寂断见闻,荡荡心无著。吾行矣。

2016年11月26日星期六

一百个记忆碎片(10)

我们的实验室紧邻西北三环,当年却是禁区,整日悄无一人。园中野草横生,漫过了窗台。安放风洞的那些房间高大阴森,常年空闲。我们终日耗在朝南的一个大房间里,等候毕业。一个漫长的夏日,小雷突然尖声跳起来:啊,一个虫子钻我耳朵里去了。她惊慌失措地求我查看。她侧向窗户立着,我凑近端详那被阳光穿透的耳垂,束手无策。

2016年11月23日星期三

一百个记忆碎片(9)

年会最后一个环节,主持人要求所有人下场共舞。她硬拉我一起下场。我们搂着一起胡乱摇着。我不知该如何应对这突如其来的亲呢,偏头避开她的凝望,却瞥见公司老大有些尴尬地一个人站在舞池中。他也注意到了我们在看他,于是伸出手,勾了勾指头。呵,我身边这女人立即放下我,飞奔了过去,留我讪讪坐了回去。

2016年5月12日星期四

Config IIS on Windows 10 for running Classic ASP

It's a little weird that IIS 10 does not come up with ASP or ASP.Net supporting by default. So when I upgrade from IIS 7, it took me a while to find out how to config IIS for running classic ASP.

The following is the steps:

  1. Open Control Panel
  2. Click Programs
  3. Under Programs and Features, click Turn Windows features on or off
  4. Expand Internet Information Services
  5. Expand World Wide Web Services
  6. Expand Application Development Features
  7. Check ASP, then click OK button


Windows will install IIS for you now.

2016年2月3日星期三

What is the usage for virtual function in C#?



A virtual function, is basically saying look, here's the functionality that may or may not be good enough for the child class.  So if it is good enough, use this method, if not, then override me, and provide your own functionality.  We can see the difference between a virtual function and an abstract function: An abstract function can have no functionality. You're basically saying, any child class MUST give their own version of this method, however it's too general to even try to implement in the parent class.

But  what if i don't use virtual keyword in base class?  and is it compulsory to override virtual method in derived classes?  

When there is no virtual keyword in base class, You will generate compiler error CS0506  if you try to override the method with 'Override' keyword in descendent classes. But you can use 'new' keyword to replace the method in base class.

new public int Method() 
{
     ... 
}
And it is not compulsory to override virtual method in derived classes. The descendent class will use method it is inheriting from.


Then, why do we need virtual function? The key to understand the practical usage of virtual functions is to keep in mind that an object of a certain class can be assigned another object of a class derived from the first object's class. E.g.:

class Animal{
   public void eat(){...}
}
class FlyingAnimal:Animal{
   public void eat(){...}
}
Animal a = new FlyingAnimal();

The Animal class has a function eat() that generally describes how an animal should eat (e.g. put the object in mouth and swallow).

However, the FlyingAnimal class should define a new eat() method, because flying animals have a particular way of eating.

So the question that comes to mind here is: after I declared the variable a of type Animal and assigned it a new object of type FlyingAnimal, what will a.eat() do? Which of the two methods is called?

The answer here is: because a is of type Animal, it will call Animal's method. The compiler is dumb and doesn't know that you are going to assign an object of another class to the a variable.
Here is where the virtual keyword comes in action: if you declare the method as virtual void eat() {...}, you are basically telling the compiler "be careful that I am doing some clever stuff here that you cannot handle because you're not as smart". So the compiler will not attempt to link the call a.eat() to either of the two methods, but instead it tells the system to do it at runtime!

So only when the code executes, the system will look at a's content type not at its declared type and executes FlyingAnimal's method.

You may wonder: why the hell would I want to do that? Why not say right from the start ? like:

FlyingAnimal a = new FlyingAnimal() 

The reason for that is that, for example, you may have many derived classes from
 AnimalFlyingAnimalSwimmingAnimalBigAnimalWhiteDog etc. And at one point you want to define a world containing many Animals, so you say:

Animal[] happy_friends = new Animal[100];

We have a world with 100 happy animals. You initialize them at some point:

...
happy_friends[2] = new AngryFish();
happy_friends[10]= new LoudSnake();

And at the end of the day, you want everybody to eat before they go to sleep. So you want to say:

for(int i=0; i<100; i++){
   happy_friend[i].eat();
}

So as you can see, each animal has its own method of eating. Only by using virtual functions can you achieve this functionality. Otherwise, everyone would be forced to "eat" in the exact same way: as described in the most general eat function inside the Animal class.

By the way, this behaviour is actually default in common high-level languages like Java.