Skip to content

Instantly share code, notes, and snippets.

View crb912's full-sized avatar
🎯
Focusing

RayCao crb912

🎯
Focusing
  • Programming, Python/C++/Golang.
  • Shanghai
View GitHub Profile
@crb912
crb912 / notes.md
Last active December 30, 2021 15:09

孔子东游,见两小儿辩斗,问其故。 一儿曰:“我以日始出时去人近,而日中时远也。” 一儿以日初出远,而日中时近也。 一儿曰:“日初出大如车盖,及日中则如盘盂,此不为远者小而近者大乎?” 一儿曰:“日初出沧沧凉凉,及其日中如探汤,此不为近者热而远者凉乎?” 孔子不能决也。两小儿笑曰:“孰为汝多知乎?”

这个《两小儿辩日》小故事中国人家喻户晓,也是传统文化里为数不多有趣对白。我们的文化里谈论真理的内容少之又少,因此我要旧事重提。它是个关于真理问题的讨论,虽然只是出自两个孩童。姑且让我卖弄一下浅显的地理知识,解释一下其中的道理。

受过科学教育的人应该能想明白,第二个小孩子的看法是接近正确的。早上太阳远,是斜射地面,所以凉快;地球自转到了中午,更接近直射。但他的看法也只是接近正确,要真说起来也是错误的。因为热还是凉快主要取决于是阳光对地面的直射和斜射,不在于日地距离的远近。早上和中午的那点距离影响完全是可以忽略不计的。比如,2月份是近日点,按他的道理应该2月份很热,然而北半球却很冷;7月份是远日点,北半球却很热。刚好与他的说法完全相反,说明太阳和地球的距离对温度的影响不是那么显著。

@crb912
crb912 / quotes.md
Last active October 19, 2021 13:12
我的收藏

生活目的

The important thing, once you have enough to eat and a nice house, is what you can do for others, what you can contribute to the enterprise as a whole. -- Donald Knuth
一旦足以吃饭穿暖, 一个不错的房子. 就该去思考能为别人做些什么,对社会和企业能做出什么样的贡献.

Don't follow the crowd, follow your own way. Do what you love.
不要随大流,走自己的路。做你热爱的事。

To live is the rarest thing in the world. Most people exist, that is all. - Oscar Wilde
生活是世界上最稀有的事物。大多数人存在,仅此而已。- 奥斯卡·王尔德

@crb912
crb912 / mottos
Created November 26, 2018 14:00
Mottos in computer science
“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill
“最开始的90%的代码使用了程序员90%的时间,剩下的10%的代码也需要90%的开发时间”——Tom Cargill(这不就是中国谚语——“行百步半九十”)
“In order to understand recursion, one must first understand recursion.” – Author Unknown
“要知道什么是‘递归’,你首先需要知道‘递归’”
“I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone.” – Bjarne Stroustrup
“我总是希望电脑能和电话一样好用,现在我的这个愿望成真了,因为我已经不知道怎么使用我的电话了”– Bjarne Stroustrup
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” -C.A.R. Hoare
@crb912
crb912 / study_cpp.md
Created November 26, 2018 13:05
Cpp knowledge
@crb912
crb912 / study_python.md
Last active September 24, 2019 04:53
Python knowledge you must know

1. Getting Started

  • [styleguide: Google Python Style Guide][1]
  • [PEP 257 -- Docstring Conventions][2]

2. Common

  • [Encoding and Decoding Strings ][c1]
  • [Python的函数参数传递:传值?引用?][c2]
  • [When to use assert? 何时使用assert][c3]
  • [What does the “yield” keyword do?][c4]
  • [完全理解Python迭代对象、迭代器、生成器][c5]