Skip to content

Commit

Permalink
add ?raw=true to all image refs.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolai committed Apr 13, 2019
1 parent 3003938 commit b5d9e04
Show file tree
Hide file tree
Showing 60 changed files with 216 additions and 169 deletions.
2 changes: 1 addition & 1 deletion 00.cover.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"source": [
"本书的版权协议为 [CC-BY-NC-ND license](https://creativecommons.org/licenses/by-nc-nd/3.0/deed.zh)。\n",
"\n",
"![CC-BY-NC-ND](images/CC-BY-NC-ND.png?raw=true \"CC-BY-NC-ND\")\n",
"![CC-BY-NC-ND](images/CC-BY-NC-ND.png?raw=true)\n",
"\n",
"-----\n",
"**脚注**\n",
Expand Down
30 changes: 15 additions & 15 deletions 02.proof-of-work.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -116,39 +116,39 @@
"\n",
"(2) 点击右上角的 “Fork 按钮”,将该仓库 Fork 到你的 Github 账户中\n",
"\n",
"![](images/github-fork.png)\n",
"![](images/github-fork.png?raw=true)\n",
"\n",
"(3) 创建一个新分支,可以取名为 `from-<your_username>`,比如,`by git.basic.tutorial`;\n",
"\n",
"![](images/github-new-branch.png)\n",
"![](images/github-new-branch.png?raw=true)\n",
"\n",
"(4) 在新分支下进行修改某个文件,而后提交 —— 提交前不要嫌麻烦,一定要在 Comment 中写清楚修改说明:\n",
"\n",
"![](images/github-commit.png)\n",
"![](images/github-commit.png?raw=true)\n",
"\n",
"以上示例图片中是修改了 README.md 文件 —— 事实上,你应该提交的是的确有必要的校对。\n",
"\n",
"另外,**请注意**:在创建分支之前,要将你的 Fork 更新到最新版。具体操作方法见下一节《如何在 Github 网站上将自己的 Fork 与原仓库同步》。\n",
"\n",
"(5) 在页面顶部选择 Pull request 标签:\n",
"\n",
"![](images/github-pull-request.png)\n",
"![](images/github-pull-request.png?raw=true)\n",
"\n",
"而后点击 `Compare & pull request` 按钮 —— 如果看不到这个按钮,那就点击下面刚刚修改文件的链接,如上图中的 “Update README.md”(这是你刚刚提交修改时所填写的标题)。\n",
"\n",
"![](images/github-open-pull-request.png)\n",
"![](images/github-open-pull-request.png?raw=true)\n",
"\n",
"确认无误之后,点击 `Create pull request` 按钮。\n",
"\n",
"![](images/github-create-pull-request.png)\n",
"![](images/github-create-pull-request.png?raw=true)\n",
"\n",
"(6) 随后,Github 用户 [@xiaolai](https://github.com/xiaolai) —— 就是我,即,the-craft-of-selfteaching 这个仓库的所有者,会被通知有人提交了 Pull request,我会看到:\n",
"\n",
"![](images/github-confirm-merge.png)\n",
"![](images/github-confirm-merge.png?raw=true)\n",
"\n",
"在我确认这个 Pull request 修改是正确的、可接受的之后,我就会按 `Merge pull request` 按钮 —— 如此这般,一个修正就由你我共同完成了。\n",
"\n",
"![](images/github-merged-pull-request.png)\n",
"![](images/github-merged-pull-request.png?raw=true)\n",
"\n",
"\n",
"**注意**\n",
Expand Down Expand Up @@ -176,31 +176,31 @@
"source": [
"(1) 在你的 Fork 页面中如下图所示,点击 `Compare` 链接:\n",
"\n",
"![](images/sync-fork-1.png)\n",
"![](images/sync-fork-1.png?raw=true)\n",
"\n",
"(2) 将 `base repository` 更改成当前自己的 Fork,在图示中即为 `gitbasictutorial/the-craft-of-selfteaching`:\n",
"\n",
"![](images/sync-fork-2.png)\n",
"![](images/sync-fork-2.png?raw=true)\n",
"\n",
"(3) 这时候,页面会显示 `There isn't anything to compare.`,因为你在比较 “自己” 和 “自己”。点击 `compare across forks` 链接:\n",
"\n",
"![](images/sync-fork-3.png)\n",
"![](images/sync-fork-3.png?raw=true)\n",
"\n",
"(4) 将 `head repository` 更改成 Upstream Repository(即,上游仓库),在图示中即为 `selfteaching/the-craft-of-selfteaching`:\n",
"\n",
"![](images/sync-fork-4.png)\n",
"![](images/sync-fork-4.png?raw=true)\n",
"\n",
"(5) 稍等片刻,你会看到比较结果;而后你可以创建一个 Pull request —— 这是一个由你自己向你自己的 Fork 仓库提交的 Pull request:\n",
"\n",
"![](images/sync-fork-5.png)\n",
"![](images/sync-fork-5.png?raw=true)\n",
"\n",
"(6) 而后你在 `Pull requests` 标签页里会看到你刚刚提交的 Pull request:\n",
"\n",
"![](images/sync-fork-6.png)\n",
"![](images/sync-fork-6.png?raw=true)\n",
"\n",
"(7) 同意并合并之后的结果是,你的 Fork 与上游仓库同步完成了:\n",
"\n",
"![](images/sync-fork-7.png)\n",
"![](images/sync-fork-7.png?raw=true)\n",
"\n",
"当然,有时会出现一些你无法解决的问题,那么,还有一个最后的方法:\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion Part.1.C.must.learn.sth.only.by.reading.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"\n",
"还有,英语在科学研究领域早已成为 “主导语言”(Dominant Language)也是不争的事实。不过,英语成为主导语言的结果,就是英语本身被不断 “强奸”,外来语越来越多,“Long time no see” 被辞典收录就是很好的例子。事实上,英语本身就是个大杂烩……\n",
"\n",
"![Joseph M. Williams’ research visualized (top 10,000 words).](images/Joseph-M-Williams-research-visualized.png)<a href='https://medium.com/@andreas_simons/the-english-language-is-a-lot-more-french-than-we-thought-heres-why-4db2db3542b3'></a>\n",
"![Joseph M. Williams’ research visualized (top 10,000 words).](images/Joseph-M-Williams-research-visualized.png?raw=true)<a href='https://medium.com/@andreas_simons/the-english-language-is-a-lot-more-french-than-we-thought-heres-why-4db2db3542b3'></a>\n",
"\n",
"读书越多越明白读书少会被忽悠…… 很多人真的会大头捣蒜一般地认同 “不是什么东西都可以从书本里学到的……”\n",
"\n",
Expand Down
10 changes: 5 additions & 5 deletions Part.1.E.1.entrance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"\n",
"在大学任职期间,乔治・布尔写了两本教科书,一本讲微分方程,另外一本讲差分方程,而前者,[A TREATISE ON DIFFERENTIAL EQUATIONS](https://archive.org/details/atreatiseondiff06boolgoog/page/n7),直到今天,依然难以超越。\n",
"\n",
"![george-boole-1864](images/george-boole-in-1864.png)\n",
"![george-boole-1864](images/george-boole-in-1864.png?raw=true)\n",
"\n",
"乔治・布尔于 1864 年因肺炎去世。\n",
"\n",
Expand All @@ -63,7 +63,7 @@
"\n",
"2015 年,乔治・布尔诞辰 200 周年,Google 设计了[专门的 Logo](https://www.google.com/doodles/george-booles-200th-birthday) 纪念这位为人类作出巨大贡献的自学奇才。\n",
"\n",
"![george-boole-google-doodle-2015](images/george-boole-google-doodle-2015.gif)\n",
"![george-boole-google-doodle-2015](images/george-boole-google-doodle-2015.gif?raw=true)\n",
"\n",
"Google Doodle 的寄语是这样的:\n",
"\n",
Expand Down Expand Up @@ -216,7 +216,7 @@
"\n",
"**注意**:它们全部是小写。因为布尔值只有两个,所以布尔运算结果只有几种而已,如下图所示:\n",
"\n",
"![](images/boolean-operators.png)\n",
"![](images/boolean-operators.png?raw=true)\n",
"\n",
"先别管以下代码中 `print()` 这个函数的工作原理,现在只需要关注其中布尔运算的结果:"
]
Expand Down Expand Up @@ -258,7 +258,7 @@
"source": [
"千万不要误以为布尔运算是*理科生*才必须会、才能用得上的东西…… 文理艺分科是中国的特殊分类方式,真挺害人的。比如,设计师们在计算机上创作图像的时候,也要频繁使用*或与非*的布尔运算操作才能完成各种图案的拼接…… 抽空看看这个网页:[Boolean Operations used by Sketch App](https://sketchapp.com/docs/shapes/boolean-operations/) —— 这类设计软件,到最后是每个人都用得上的东西呢。另,难道艺术生不需要学习文科或者理科?—— 事实上,他们也有文化课……\n",
"\n",
"![](images/[email protected])\n",
"![](images/[email protected]?raw=true)\n",
"\n"
]
},
Expand Down Expand Up @@ -697,7 +697,7 @@
"\n",
"在很多其他的语言中,比如,JavaScript,用大括号 `{}` 作为语句块标示 —— 这是 Python 比较特殊的地方,它组织语句块的方式如下图所示:\n",
"\n",
"![](images/python-leading-space.png)\n",
"![](images/python-leading-space.png?raw=true)\n",
"\n",
">**注意**:在同一个文件里,不建议混合使用 Tab 和 Space;要么全用空格,要么全用制表符。"
]
Expand Down
2 changes: 1 addition & 1 deletion Part.1.E.3.controlflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
"\n",
"`continue` 语句将忽略其后的语句开始下次循环,而 `break` 语句将从此结束当前循环,开始执行循环之后的语句:\n",
"\n",
"![](images/continue-break.png)\n"
"![](images/continue-break.png?raw=true)\n"
]
},
{
Expand Down
14 changes: 7 additions & 7 deletions Part.1.E.4.functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"source": [
"以下,是 print() 这个函数的[官方文档](https://docs.python.org/3/library/functions.html#print):\n",
"\n",
"![](images/doc-print.png)\n",
"![](images/doc-print.png?raw=true)\n",
"\n",
"最必须读懂的部分,就是这一行:\n",
"\n",
Expand Down Expand Up @@ -344,7 +344,7 @@
"source": [
"位置参数,顾名思义,是 “由位置决定其值的参数”。拿 `divmod()` 为例,它的[官方文档](https://docs.python.org/3/library/functions.html#divmod)是这样写的:\n",
"\n",
"![](images/doc-divmod.png)\n",
"![](images/doc-divmod.png?raw=true)\n",
"\n",
"它接收且必须接收两个参数。\n",
"\n",
Expand Down Expand Up @@ -450,7 +450,7 @@
"source": [
"有些函数,如 `pow()`,有**可选的位置参数**(Optional Positional Arguments)。\n",
"\n",
"![](images/doc-pow.png)\n",
"![](images/doc-pow.png?raw=true)\n",
"\n",
"于是,`pow()` 有两种用法,各有不同的结果:\n",
"\n",
Expand Down Expand Up @@ -501,7 +501,7 @@
"\n",
"看看 `exec()` 的官方文档(先别管这个函数干嘛用的),注意函数定义中的两个嵌套的方括号:\n",
"\n",
"![](images/doc-exec.png)\n",
"![](images/doc-exec.png?raw=true)\n",
"\n",
"这些方括号的意思是说:\n",
"\n",
Expand All @@ -528,13 +528,13 @@
"\n",
"再仔细看看 `print()`,它只有一个位置参数:\n",
"\n",
"![](images/doc-print-def.png)\n",
"![](images/doc-print-def.png?raw=true)\n",
"\n",
"因为位置决定了值的定义,一般来说,一个函数里最多只有一个这种可以接收很多值的位置参数 —— 否则如何获知谁是谁呢?\n",
"\n",
"如果与此同时,还有若干个位置参数,那么,*能够接收很多值的位置参数*只能放置最后,就好像 `max()` 函数那样:\n",
"\n",
"![](images/doc-max.png)"
"![](images/doc-max.png?raw=true)"
]
},
{
Expand All @@ -550,7 +550,7 @@
"source": [
"虽然你现在还不一定知道 Class 究竟是什么,但在阅读官方文档的时候,遇到一些内建函数前面写着 Class,比如 `Class bool([x])`,千万别奇怪,因为 Class 本质上来看就是一种特殊类型的函数,也就是说,它也是函数:\n",
"\n",
"![](images/doc-class.png)"
"![](images/doc-class.png?raw=true)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion Part.1.E.5.strings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2666,7 +2666,7 @@
"> * 为了表格在一屏中可以正确显示,本来应该规规矩矩写 `str.xxx`,但写成了 `s.xxx`……\n",
"> * 另外,操作那一行,为了分类记忆方便,把 `len()` 和 `s.join()` 也放进去了……\n",
"\n",
"![](images/string-concepts.png)\n",
"![](images/string-concepts.png?raw=true)\n",
"\n",
"“记住” 的方法并不是马上就只盯着表格看…… 正确方法是反复阅读这一章内容中的代码,并逐一运行,查看输出结果;还要顺手改改看看,多多体会。多次之后,再看着表格回忆知识点,直到牢记为止。"
]
Expand Down
4 changes: 2 additions & 2 deletions Part.1.E.6.containers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"\n",
"字符串、由 `range()` 函数生成的等差数列、列表、元组是**有序类型**(Sequence Type),而集合与字典是*无序*的。\n",
"\n",
"![](images/python-containers-final.png)\n",
"![](images/python-containers-final.png?raw=true)\n",
"\n",
"另外,集合没有*重合*元素。"
]
Expand Down Expand Up @@ -852,7 +852,7 @@
"\n",
"而整理成表格之后呢,理解与记忆真的是零压力:\n",
"\n",
"![](images/list-concepts.png)"
"![](images/list-concepts.png?raw=true)"
]
},
{
Expand Down
10 changes: 5 additions & 5 deletions Part.1.F.deal-with-forward-references.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"source": [
"充满过早引用的知识结构,在大脑中会构成类似 M.C. Escher 善画的那种 “不可能图形” 那样的 “结构”。\n",
"\n",
"![](images/four-cones.png)\n",
"![](images/four-cones.png?raw=true)\n",
"\n",
"在上图中,前三个椎形一般不会造成视觉困惑 —— 尤其是第一个。\n",
"\n",
Expand All @@ -53,7 +53,7 @@
"\n",
"对一个点的位置困惑,连带着它与其它三个点之间的关系。可若那不是锥体,而是立方体呢?每个点的位置困惑会造成对它与更多点之间的更多联系的困惑…… 若是更多面体呢?\n",
"\n",
"![](images/2_necker_cubes.png)\n",
"![](images/2_necker_cubes.png?raw=true)\n",
"\n",
"把这些令人困惑的点,比喻成 “过早引用”,你就明白为什么 “很多过早引用” 的知识结构会那么令人困惑,处理起来那么令人疲惫了吧?"
]
Expand Down Expand Up @@ -252,15 +252,15 @@
"\n",
"我在第一次粗略读过整个 [Python Official Tutorial](https://docs.python.org/3/tutorial/datastructures.html) 中的第五章之后,顺手整理了一下 Containers 的概念表格:\n",
"\n",
"![](images/python-containers.png)\n",
"![](images/python-containers.png?raw=true)\n",
"\n",
"**可这张图错了!**\n",
"\n",
"因为我最早 “合理囫囵吞枣” 的时候,`Bytes` 这种数据类型全部跳过;而后来多轮反复之后继续深入,又去读 [The Python Language Reference](https://docs.python.org/3/reference/datamodel.html) 的第五章 `Data Model` 之后,` 发现 Set` 也有 Immutable,是 `Frozen Set`…… 当然,最错的是,整理的过程中,一不小心把 “Ordered” 给弄反了!\n",
"\n",
"于是肯定需要再次整理,若干次改进之后,那张图就变成了下面这个样子:\n",
"\n",
"![](images/python-containers-final.png)\n",
"![](images/python-containers-final.png?raw=true)\n",
"\n",
"> 另外,从 Python 3.7 开始,Dictionary 是 insertion ordered 了:<br />\n",
"https://docs.python.org/3/library/collections.html#ordereddict-objects\n",
Expand All @@ -277,7 +277,7 @@
"\n",
"人家随手做个图,都舍不得不精致:\n",
"\n",
"![](images/iter-relationships.gif)\n",
"![](images/iter-relationships.gif?raw=true)\n",
"\n",
"自学能力强的人有个特点,就是**不怕麻烦**。小时候经常听到母亲念叨,“怕麻烦!那还活着干嘛啊?活着多麻烦啊!” —— 深刻。"
]
Expand Down
6 changes: 3 additions & 3 deletions Part.1.G.The-Python-Tutorial-local.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"\n",
"此人很帅,但更帅的是他的车牌(摘自 Guido van Rossume 的[个人主页](https://gvanrossum.github.io)):\n",
"\n",
"![](https://gvanrossum.github.io/images/license.jpg)"
"![](https://gvanrossum.github.io/images/license.jpg?raw=true)"
]
},
{
Expand Down Expand Up @@ -109,7 +109,7 @@
"source": [
"把 The Python Tutorial 拉回本地阅读,可能更为方便,尤其是可以用 Sphinx 重新制作之后,页面左侧可以总是显示完整的目录:\n",
"\n",
"![](images/local-tutorial.png)\n",
"![](images/local-tutorial.png?raw=true)\n",
"\n",
"也可以把这个教程转换成 epub 格式,以便在移动设备上阅读;甚至可以把这些个页面的 `.rst` 源文件转换成 `.ipynb` 文件,以便用 Jupyter Lab 浏览时可以直接执行其中的代码……"
]
Expand Down Expand Up @@ -341,7 +341,7 @@
"source": [
"用 Sphinx 这样生成的版本,支持本地目录内搜索,也确实比在网站上看更方便一点:\n",
"\n",
"![](images/search-generated-by-sphinx.png)"
"![](images/search-generated-by-sphinx.png?raw=true)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion Part.2.A.clumsy-and-patience.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"\n",
"大约 1984 年,我在远在边疆的延吉市的本地青少年宫参加了一个要交 10 元学费的暑期计算机兴趣班,老师姓金,教的是 BASIC 语言,用的机器是这样的:\n",
"\n",
"![](images/Acorn-Electron.png)\n",
"![](images/Acorn-Electron.png?raw=true)\n",
"\n",
"它要外接上一个九寸的单色显示器,那时候还没有磁盘,所以,只要一断电,就什么都没有了……\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion Part.2.D.4-recursion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"source": [
"以 factorial(5) 为例,让我们看看程序的流程:\n",
"\n",
"![](images/recursive-function-call.png)\n",
"![](images/recursive-function-call.png?raw=true)\n",
"\n"
]
},
Expand Down
2 changes: 1 addition & 1 deletion Part.2.E.deliberate-thinking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"\n",
"比如,当你看到字符串的 Methods 中有一个 `str.zfill()` 的时候,马上就能想到,“嗯!这可以用来批量更名文件……”\n",
"\n",
"![](images/rename-macos.png)\n",
"![](images/rename-macos.png?raw=true)\n",
"\n",
"虽然现在的 Mac OS 操作系统里已经有相当不错的批量更名工具内建在 Finder 之中(选中多个文件之后,在右键菜单中能看到 `rename` 命令),但这是近期才加进去的功能,几年前却没有 —— 也就是说,几年前的时候,有人可以用 `str.zfill()` 写个简单的程序完成自己的工作,而另外一些人仅因为操作系统没有提供类似的功能就要么手工做,要么干脆忍着忘了算了……\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion Part.3.A.conquering-difficulties.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"\n",
"那个 “突然”,其实就是阿基米德的 [Eureka](https://en.wikipedia.org/wiki/Eureka_effect),那个他从澡堂里冲出来大喊大叫的词汇。\n",
"\n",
"![](images/archimedes-eureka.png)\n",
"![](images/archimedes-eureka.png?raw=true)\n",
"\n",
"其实吧,泡澡和冥想,还真是最容易产生 Eureka 状态的两种活动。原理在于,泡澡和打坐的时候,大脑都极其放松,乃至于原本相互之间并无联系的脑神经突触之间突然产生相互关联;而那结果就是日常生活中所描述的 “融会贯通”,于是,突然之间,Eureka!\n",
"\n",
Expand Down
6 changes: 3 additions & 3 deletions Part.3.B.1.classes-1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"\n",
"在程序设计过程中,我们常常需要对标现实世界创造对象。这时候我们用的最直接手段就是**抽象**(Abstract)。抽象这个手段,在现实中漫画家们最常用。为什么你看到下面的图片觉得它们俩看起来像是人?尤其是在你明明知道那肯定不是人的情况下,却已然接受那是两个漫画小人的形象?\n",
"\n",
"![](images/a-cartoon.png)\n",
"![](images/a-cartoon.png?raw=true)\n",
"\n",
"这种描绘方式,就是抽象,很多 “没必要” 的细节都被去掉了(或者反过来说,没有被采用),留下的两个特征,一个是头,一个是双眼 —— 连那双 “眼睛” 都抽象到只剩下一个黑点了……\n",
"\n",
Expand All @@ -87,7 +87,7 @@
"\n",
"我们为生物分类,就是一层又一层地抽象的过程。当我们使用 “生物” 这个词的时候,它并不是某一个特定的我们能够指称的东西…… 然后我们开始给它分类……\n",
"\n",
"[![](images/Tree-of-Life.gif)](https://crucialconsiderations.org/wp-content/uploads/2016/08/Tree-of-Life.jpg)\n",
"[![](images/Tree-of-Life.gif?raw=true)](https://crucialconsiderations.org/wp-content/uploads/2016/08/Tree-of-Life.jpg)\n",
"\n",
"所以,当我们在程序里创建对象的时候,做法常常是\n",
"\n",
Expand Down Expand Up @@ -134,7 +134,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"![](images/code-review.png)"
"![](images/code-review.png?raw=true)"
]
},
{
Expand Down
Loading

0 comments on commit b5d9e04

Please sign in to comment.