Long Luo's Life Notes

每一天都是奇迹

By Bertrand Russell

By means of modern psychology, many educational problems which were formerly tackled (very unsuccessfully) by sheer moral discipline are now solved by more indirect but also more scientific methods. There is, perhaps, a tendency, especially among the less well-informed devotees of psychoanalysis, to think that there is no longer any need of stoic self-command. I do not hold this view, and in the present essay I wish to consider some of the situations which make it necessary, and some of the methods by which it can be created in young people; also some of the dangers to be avoided in creating it.

借着现代心理学的方法,许多过去(极不成功地)靠着纯粹道德法则去对付的教育问题,现在能以更为间接、但也更为科学的方法解决了。现在可能有一种倾向,特别是在那些孤陋寡闻的心理分析倡导者中间,那就是认为不再需要任何斯多葛式的自制了。我并不持这种看法,在本文中我就要考虑一下自制必要性的几种情况,在年轻人中养成自制的一些方法及培养自制能力时应避免的危险。

Let us begin at once with the most difficult and most essential of the problems that call for stoicism: I mean, Death. There are various ways of attempting to cope with the fear of death. We may try to ignore it; we may never mention it, and always try to turn our thoughts in another direction when we find ourselves dwelling on it. This is the method of the butterfly people in Wells’s Time Machine. Or we may adopt the exactly opposite course, and meditate continually concerning the brevity of human life, in the hope that familiarity will breed contempt; this was the course adopted by Charles V in his cloister after his abdication. There was a Fellow of a Cambridge College who even went so far as to sleep with his coffin in the room, and who used to go out on to the College lawns with a spade to cut worms in two, saying as he did so: ‘Yah! you haven’t got me yet.’ There is a third course, which has been very widely adopted, and that is, to persuade oneself and others that death is not death, but the gateway to a new and better life. These three methods, mingled in varying proportions, cover most people’s accommodations to the uncomfortable fact that we die.

我们先从面对斯多葛主义最困难和最本质的问题,即死亡问题开始讨论。试图克服对于死亡的恐惧有种种方式。我们可以鄙视它,可以不提起它,而且当发现自己在这个问题上受到困扰时,尽力将思想转到另外的方向上去。这是威尔斯在《时间机器》中所说的轻薄之士的方法。而我们可以采用正相反的方式,即不断冥想人类生命之短促,以期望从这种领会中产生对人生轻蔑之情感;这正是查理五世退位后在其修道院里采用的方法。剑桥大学的一位同学更为极端,竟与房间里的棺木同寝,还常常走到学校的草地上,用锄具将小虫铲成两半,同时说:“哈,你还没有抓住我。”还有第三种更为人们广泛采用的方法,就是说服自己和他人,去相信死亡并非毁灭,而是进入新的更加美好生活的途径。上述这三种方法,以各种不同的比例混搅在一起,成为在多数人用来对付死亡这一令人不快之事的办法。

阅读全文 »

By Bertrand Russell

I

Like most of my generation, I was brought up on the saying “Satan finds some mischief still for idle hands to do.” Being a highly virtuous child, I believed all that I was told and acquired a conscience which has kept me working hard down to the present moment. But although my conscience has controlled my actions, my opinions have undergone a revolution. I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached. Every one knows the story of the traveler in Naples who saw twelve beggars lying in the sun (it was before the days of Mussolini), and offered a lira to the laziest of them. Eleven of them jumped up to claim it, so he gave it to the twelfth. This traveler was on the right lines. But in countries which do not enjoy Mediterranean sunshine idleness is more difficult, and a great public propaganda will be required to inaugurate it. I hope that after reading the following pages the leaders of the Y. M. C. A. will start a campaign to induce good young men to do nothing. If so, I shall not have lived in vain.

像大多数同代人那样,我受过这句谚语的教诲:“恶魔总捉弄懒汉”。作为一个循规蹈矩的孩子,我深信所受的一切教诲,并具有一种促使我勤恳工作至今的良心。这种良心虽然支配着我的行动,但我的观念与过去却有天壤之别。我想在当今世界上工作过于繁重,工作即美德这一信念导致了极大的危害,现代工业国家需要宣扬的东西与历来所宣扬的截然不同。大家都知道一个到那不勒斯旅行的人的故事,当他看到12个乞丐躺着晒太阳时(这是发生在墨索里尼时代之前),想施舍一个里拉给其中最懒的一个。当场 11 个名丐一跃而起求对,于是,他把里拉给了第 12 个。这位旅行者所作所为当然无可厚非。在那些享用不到地中海阳光的国家,悠闲非同小可,需要大加广泛宣传方能开此先河。我希望基督教青年会的领袖们读了以下篇章后,开展一场运动,劝导善良的年轻人无所事事。倘若如此,我总算不会虚度此生。

Before advancing my own arguments for laziness, I must dispose of one which I cannot accept. Whenever a person who already has enough to live on proposes to engage in some everyday kind of job, such as school-teaching or typing, he or she is told that such conduct takes the bread out of other people’s mouths, and is, therefore, wicked. If this argument were valid, it would only be necessary for us all to be idle in order that we should all have our mouths full of bread. What people who say such things forget is that what a man earns he usually spends, and in spending he gives employment. As long as a man spends his income he puts just as much bread into people’s mouths in spending as he takes out of other people’s mouths in earning. The real villain, from this point of view, is the man who saves. If he merely puts his savings in a stocking, like the proverbial French peasant, it is obvious that they do not give employment. If he invests his savings the matter is less obvious, and different cases arise.

在陈述我的懒惰主张之前,我必需排除一种无法接受的看法。当一个人已经可以维持生活所需,他仍筹划着从事某项日常的工作,如教员或打字员,人们就会告诉他(她):这样做等于从他人口中夺走饮食,因而是不义之举。如果这一论点可以成立,那我们只消游手好闲就可能饱食终日了。这样说的人忘记了一个事实:一个人所赚来的通常供他花费,而其消费之行为又为别人提供了就业机会。只要一个人不断将其收入用于消费,那他为别人提供糊口之食的数量就与他从别人口里夺得的数量一般多。如此看来,真正的罪人是节俭者。就像众所周知的法国农民那样,假如他把节约下来的钱放进袜筒里,显而易见这钱并不提供就业的可能;如果他这钱用来投资,情况就不会如此简单,结果也将完全不同。

阅读全文 »

By Bertrand Russell

Francis Bacon, a man who rose to eminence by betraying his friends, asserted, no doubt as one of the ripe lessons of experience, that ‘knowledge is power’. But this is not true of all knowledge. Sir Thomas Browne wished to know what song the sirens sang, but if he had ascertained this it would not have enabled him to rise from being a magistrate to being High Sheriff of his county. The sort of knowledge that Bacon had in mind was that which we call scientific. In emphasising the importance of science, he was belatedly carrying on the tradition of the Arabs and the early Middle Ages, according to which knowledge consisted mainly as astrology, alchemy, and pharmacology, all of which were branches of science. A learned man was one who, having mastered these studies, had acquired magical powers. In the early eleventh century, Pope Silvester II, for no reason except that he read books, was universally believed to be a magician in league with the devil. Prospero, who in Shakespeare’s time was a mere phantasy, represented what had been for centuries the generally received conception of a learned man, so far at least as his powers of sorcery were concerned. Bacon believed—rightly, as we now know—that science could provide a more powerful magician’s wand than any that had been dreamed of by the necromancers of former ages.

英国一位靠出卖朋友而声名大噪的人——弗兰西斯·培根曾说:“知识就是力量。”这无疑是一句成熟的经验总结。托马斯·布朗爵士曾想弄清希腊神话中的海妖究竟唱什么歌,然而即使他确实清楚了,也不能帮他从一个地方长官提升为国家的高级行政长官。培根心目中的知识是指我们所说的科学知识。在强调科学的重要性时,他陈腐地承继阿拉伯和中世纪早期的传统,把知识看作主要由占星学、炼金术和药物学组成,这些都是科学的分支。一位精通这些学科的学者就是获得魔术般力量的人。11 世纪初,教皇西尔维斯特二世除了读些书外,并没有别的理由,就被普遍地看作是一个与魔鬼结盟的魔术师。普罗斯帕罗,在莎士比亚的时代只是一个虚构的人物,但几个世纪以来却代表着人们普遍接受的学者的概念,至今就其法力而言是人们所关注的。培根相信——正确地说,就如现在我们所知道的——科学能够提供比从前巫师任何幻梦还更有力的魔术师的魔杖。

The renaissance, which was at its height in England at the time of Bacon, involved a revolt against the utilitarian conception of knowledge. The Greeks had acquired a familiarity with Homer, as we do with music hall songs, because they enjoyed him, and without feeling that they were engaged in the pursuit of learning. But the men of the sixteenth century could not begin to understand him without first absorbing a very considerable amount of linguistic erudition. They admired the Greeks, and did not wish to be shut out from their pleasures; they therefore copied them, both in reading the classics and in other less avowable ways. Learning, in the renaissance, was part of the joie de vivre, just as much as drinking or love-making. And this was true not only of literature, but also of sterner studies. Everyone knows the story of Hobbes’s first contact with Euclid: opening the book, by chance, at the theorem of Pythagoras, he exclaimed, ‘By God, this is impossible’, and proceeded to read the proofs backwards until, reaching the axioms, he became convinced. No one can doubt that this was for him a voluptuous moment, unsullied by the thought of the utility of geometry in measuring fields.

培根在世时,英国的文艺复兴达到高峰,它包含一种对功利主义的知识概念的反抗。希腊人之熟悉荷马,有如我们熟悉音乐厅的歌曲,由于他们欣赏荷马,而不觉得是在忙于追求学问。但16世纪的人若不首先具备相当的语言学知识,就不能着手研究荷马。他们敬佩希腊人,并且又不愿意置身在他们的欢乐之外;因此在读那些古典著作时,他们总在仿效希腊人。在文艺复兴时,学习是生活乐趣的一部分,如同饮酒或性爱一佯。不仅对文学是这样,对那些较严肃的学科来说也是如此。人们都知道霍布斯首次接触欧几里德几何学的故事:一次他偶然翻开书,读到毕达哥拉斯定理,他大声叫道:“上帝,这是不可能的。”于是回头继续读它的证明,直至读到公理时,他才信服了。没有人会怀疑,对霍布斯来说,这一时刻如同耽迷酒色,然而想到几何学在测量土地中的效用,这种情绪被纯化了。

It is true that the renaissance found a practical use for the ancient languages in connection with theology. One of the earliest results of the new feeling for classical Latin was the discrediting of the forged decretals and the donation of Constantine. The inaccuracies which were discovered in the Vulgate and the Septuagint made Greek and Hebrew a necessary part of the controversial equipment of Protestant divines. The republican maxims of Greece and Rome were invoked to justify the resistance of Puritans to the Stuarts and of Jesuits to monarchs who had thrown off allegiance to the Pope. But all this was an effect, rather than a cause, of the revival of classical learning, which had been in full swing in Italy for nearly a century before Luther. The main motive of the renaissance was mental delight, the restoration of a certain richness and freedom in art and speculation which had been lost while ignorance and superstition kept the mind’s eye in blinkers.

确实,文艺复兴发现了古典语言与神学相关的实际用途。新感受到的古典拉丁文的最初成果之一,就是不再相信编造的教皇教条和康士坦丁的捐赠。在拉丁文圣经和希腊译文圣经之间出现的偏差,使得希腊文和希伯来文成为新教神学家准备争论的一个必要组成部分。希腊与罗马的共和主义被用来证明清教徒与斯图亚特王朝、耶稣会会员与那些不再忠顺于教皇的君主之间的对抗是合理的。但所有这一切都是路德以前在意大利将近一个世纪自由发展的古典学术之复兴的结果,而不是其原由。文艺复兴的主要动机是精神上的欢愉,是复兴在艺术和思维中曾经出现过、但后来由于无知和迷信蒙住了我们的心灵而失落的那种丰富而自由的精神。

阅读全文 »

By Long Luo

今天重新刷了下手机,结果之前的备份都是2个月前的,刷完机我就想了下,我手机必备App是哪些呢?

列出了下面这张必备App清单:

新闻

  1. ZAKER: 查看新闻,根据你的爱好订阅文章
  2. 新浪微博:作为微博的重度用户,微博的媒体属性很强,大于其社交属性。我的不少朋友已经告别微博了,但是我还是喜欢微博。与其在微信上与熟悉的人聊天,不如在微博上和陌生人交流。
  3. 网易新闻:交互做的很好,163评论常有亮点。

SNS·社交

  1. QQ: 不用说。超级App,超好的用户体验,本土化,非常强大。
  2. 微信:不用说。腾讯系的很多产品都极大的提高了我们的工作效率和生活效率,一定要用好他们。
  3. 微博:我用微博主要是学习和了解别人的很多观点,还能够结交很多朋友。
  4. LINE:主要是微博和微信的熟人太多,有些东西不好在朋友圈里吐槽,但LINE没有一个熟人,所以可以很方便的在朋友圈里吐槽发泄:-)
  5. LinkedIn:工作商务类的,也有很多干货。

阅读·电子书

  1. 知乎日报:打发碎片时间,同时了解很多各行各业的知识。
  2. 知乎:重度知乎用户,可以看到更大的世界,拓展你的思维界限。
  3. 多看阅读:电子书,在阅读体验我个人觉得是最好的,书的资源很多而且也不是很贵。

理财

  1. 支付宝:不用说。
  2. 招行手机App:主要用的都是招行卡。
  3. 招行信用卡:平常能刷信用卡的地方绝对使用信用卡。

消费·购物

  1. 手机淘宝:Shopping
  2. 京东:买书,购物等
  3. 美团:看电影,吃饭,订餐等O2O

股票证券类

  1. 广发证券:目前炒股的账户在广发。
  2. 自选股:腾讯系出品的一款炒股软件,美中不足的是交易不支持广发证券。
  3. 东方财富:炒股和市场行情。

交通出行

  1. 百度地图:国内最好的地图产品,对于我重度地图爱好者是真爱。
  2. Google地图:在国内被百度地图秒杀,但国外的话就是Google地图了。
  3. 爱帮公交:公交地铁线路图,还可以离线查询。
  4. 12306:火车出行必备

电子邮件

  1. QQ邮箱:很好用的一个电子邮件客户端,同时对Gmail的支持性很好。
  2. 邮箱大师:网易出品的一个邮箱客户端,这2个都可以。

时间管理·便签

  1. FitMemo: 非常轻量级的一款便签类,美中不足的是好久没有更新了,不支持云同步功能。
  2. Any.Do:支持多平台同步,非常好的时间管理App,用了就知道。
阅读全文 »

By Long Luo

上次在迅雷面试的时候,遇到了一个算法题,题目是:

有一个很长很长的字符串,全部都是由大写字母组成,要求求出其中每个字母在这个字符串中出现的次数。 不允许使用STL中的方法。

当时拿到这个题目,我首先想到了以下几个方法:

  1. 穷举法,一个个比较,最后算出每个字母出现的次数,这种方法可行,但不轻巧与优雅。
  2. 每个字符与’A’想减,会得到一个,统计下这个值出现次数,和方法1类似。(事后回顾这个已经很接近了,但是还是没能完美解决。)

其实这个题目,事后回顾起来,是比较简单的,但遗憾的是,当时未能在规定时间内解答出来,导致未能通过面试,拿到Offer,在此将这个题目记录下来。

重新认真解答这个题目。

How?

其实这个题目有一个很简单的解决方法,新建一个数组,大小为26,将字符串中每个字符都与'A'相减,得到的就是每个字母在数组中的元素下标值,我们最后得到的这个数组就是每个字母在这个字符串中出现的次数。

根据以上分析,可以写出如下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.algorithm.alphabetSort;

/**
* 有一个很长的字符串,其中都是一些字母,求其中每个字母出现的次数(大小写区分)。
*
* @author luolong
* @date: 2015-04-12 00:54:17
*
*/
public class AlphabetSort {
private static String str = "AWQEYIOAHDHDKKLDLAHFHJALAFHANNAFGJCXCKBZCQIEOPADHAZBZVCFGCSHDJCKCLDMDHFAKAIIAYQO";

private static int[] outArray = new int[26];

public static void main(String[] args) {
AlphabetSortString(str);
printSortArray(outArray);
}

public static void AlphabetSortString(String str) {
char cTemp;

for (int i = 0; i < str.length(); i++) {
cTemp = str.charAt(i);

outArray[cTemp - 'A']++;
}
}

private static void printSortArray(int[] arr) {
for (int i = 0; i < arr.length; i++) {
char c = (char) ('A' + i);
System.out.print("" + c + "=" + arr[i] + " ");
}
}

}

引申与扩展一

如果字符串不仅仅是大写字母,而是大小写字母都存在的情况下,那应该如何写呢?

其实也很简单,如下所示:

1
2
3
4
5
6
7
8
9
10
11
12
13
if (cTemp >= 'A' && cTemp <= 'Z') {
/**
* 大写字母
*/
outArray[cTemp - 'A']++;
} else if (cTemp >= 'a' && cTemp <= 'z') {
/**
* 小写字母
*/
outArray[cTemp - 'a' + 26]++;
} else {

}
阅读全文 »
0%