2018年8月

TL;DR:
By default I use margin everywhere, except when I have a border or background and want to increase the space inside that visible box.

To me the biggest difference between padding and margin is that vertical margins auto-collapse, and padding doesn't. Consider two elements one above the other each with padding of 1em. This padding is considered to be part of the element, and is always preserved. So you will end up with the content of the first element, followed by the padding of the first element, followed by the padding of the second, followed by the content of the second element. Thus content of the two elements will end up being 2em apart.

Now replace that padding with 1em margin. Margins are considered to be outside of the element, and margins of adjacent items will overlap. So in this example you will end up with the content of the first element followed by 1em of combined margin followed by the content of the second element. So the content of the two elements is only 1em apart.

This can be really useful when you know that you want say 1em of spacing around an element, regardless of what element it is next to.

The other two big differences is that padding is included in the click region and background color/image, but not the margin.

第二个解释:
Margin is on the outside of block elements while padding is on the inside.

  • Use margin to separate the block from things outside it
  • Use padding to move the contents away from the edges of the block.

作用域的英文是: scope。函数作用域:function scope;块级作用域:block scope

OK,ES5 只有全局作用域和函数作用域,没有块级作用域。那么,ES6有了一个新的关键字:let,这个关键字的核心是限定了变量仅在块级作用域里起作用。

- 阅读剩余部分 -

2019年8月12日更新
这个问题,又翻出来思考了。
信息聚合这个事,现在国内太多了,真的太多了,都是因为今日头条的成功,所以聚合类的新闻和资讯网站不要太多了。但这样复制头条的经验确实是走不通了。
问题出在哪里,确实还就是信息太多了,要service化,要提供服务,才能真正形成自己的护城河,会积攒忠实粉丝,仅仅提供信息,确实走不远。
但饭呢,也是一口一口吃,不是一开始就能知道市场需要什么样的服务的,需要摸索。
所以还是有点可惜,生物医药这一块的招聘,市场也确实不大,而且仅仅提供信息,也确实不行。但还是感觉有点缺少行动力了。

所以行动力还是最重要的,在做的过程中,积攒经验,改进方法,调整方向,逐步走上良性发展的轨道,罗马不是一天建成的。


我有好几个关于找工作方面的域名,例如biomedhr.comjobserver.iobioxjobs.com等。现在到了要续费的阶段了,我考虑很久,决定不续费了。

怎么说呢,一开始,还是非常兴致勃勃,后来由于各种原因,导致开发失败。
先说一下这些导致开发失败的技术方面的原因吧:

  • 爬虫问题:爬取Nature杂志网站的招聘信息的时候,也就1000多个页面,但总是各种报错,一会IP被封,一会网络问题,一会HTML解析问题,反正总是问题
  • Java技术栈问题:张哥用Javabiomedhr.com写了一个小网站,但后来我实在受不了Java,就放弃了,大家之间还是观念差距太大
  • RESTful API问题:自己尝试用nodejsjobserver.io,结果一方面没数据,二方面RESTful API总是写不好

那么,这些技术问题导致开发失败,算是好事还是坏事呢?

- 阅读剩余部分 -

Golang不支持函数重载。

Why does Go not support overloading of methods and operators?

Method dispatch is simplified if it doesn't need to do type matching as well. Experience with other languages told us that having a variety of methods with the same name but different signatures was occasionally useful but that it could also be confusing and fragile in practice. Matching only by name and requiring consistency in the types was a major simplifying decision in Go's type system.

Regarding operator overloading, it seems more a convenience than an absolute requirement. Again, things are simpler without it.

- 阅读剩余部分 -