第一周的课程介绍了 C 语言的基础语法,比如 include 库,声明变量,基础数据类型等,这部分需要赘述的内容不多,且大部分语言的基础都是类似的。

让我印象最深刻的是,整节课程从一开始就在强调代码风格的重要性,包括提交作业时,除了检查代码的准确性,还会检查代码风格是否与仓库风格一致。比如 include 的顺序,括号的位置(这部分对于习惯了 js 的我来说真的是非常不习惯,平时敲完 for 循环或 if 就顺手敲大括号了,现在必须另起一行)。

其次是课程并没有因为是概论课程而忽略了原理的讲解,课上以 include <stdio.h> 为例讲解了编译的流程,每一步计算机完成了什么。

同时,由于每一周的课程结束都需要提交一份作业,因此在第一周的课上就介绍了如何有效地 debug,具体介绍了 printfdebugger 和小黄鸭三种最有效的 debug 方法。

第二周介绍了数组这一数据类型,比较特别的地方是,课上详细介绍了它的实现方式,比如如何存储数组里的内容,如何标记一个数组的完结。

这几课学下来的感受和 Week 0 一样,课程的讲解方式非常高效,但对于零基础的人能学到的内容更多,对于了解编程基础知识的人来说新信息不多。

炎症是人体保护自己的免疫系统之一。其中,急性炎症伴随着显著症状,容易被发现,也容易消退。慢性炎症往往症状不明显,但是长期的慢性炎症能够给身体带来持续的负面影响。

引发慢性炎症的原因有很多,包括饮食习惯、运动习惯、慢性病、年龄增长等。

年龄增长之所以会引发慢性炎症,原因是老化细胞会分泌出促进发炎的无知,同时影响周围的细胞一同老化,使发炎范围扩大。

此外,氧化也是随着年龄增长一同出现的问题。氧化过程中,随着呼吸进入人体内的部分氧气会转变成活性氧。活性氧是免疫细胞与入侵敌人战斗的武器,但是过多的活性氧会对人体造成伤害。因此,人体是在一边经历氧化作用,一边通过特殊物质,如 SOD 酵素,进行抗氧化。一旦活性氧超过了 SOD 可以处理的范围,就会生成氧化压力。
多出的活性氧会对细胞造成伤害,从而导致炎症的发生,而炎症又会促使身体产生更多的活性氧抵抗炎症,此时,超出身体处理部分的活性氧又会加剧炎症,造成恶性循环。

身体内最容易发炎的器官就是肠道,原因是胃消化不完全的食物都会积攒到肠道,而肠道内的免疫细胞占到全身的70%,一旦肠道发炎,就会影响免疫系统,还会把分解的有害物质输送到全身。
肠道中包含好菌、坏菌和机会致病菌三种类型,其中,机会致病菌的属性会随着所占比例更大的菌类切换。一旦坏菌较多,在肠道内分解食物时就会产生坏的气体和物质,从而造成炎症。因此肠道内理想的菌群比例是2:1:7,好菌比例大于坏菌。
膳食纤维是肠道内好菌的养分来源,应该多吃。不过膳食纤维还分为可溶性膳食纤维和不可溶性膳食纤维,其中,不可溶性膳食纤维吸水后会膨胀,容易导致便秘,应少吃。

饮食中还有一类会影响我们是否有炎症的食物:脂肪酸。脂肪酸可以作为细胞膜的养分,它们可以分为饱和脂肪酸和不饱和脂肪酸,我们只用简单记住,在常温下会凝固的油脂成为“饱和脂肪酸”,不会凝固的油脂成为“不饱和脂肪酸”。
我们日常食用的油类大多是不饱和脂肪酸,它们根据分子结构的不同,可以分为 ω-3、ω-6 和 ω-9 三种。其中,ω-3的代表是EPA和DHA,它们存在于深海鱼油中,食用油的代表则是亚麻籽油;EPA和DHA不易引发炎症,而且它们受不同酵素的影响还能够转换成抑制炎症的介质;ω-6 的代表是色拉油、玉米油等,它会转变成AA,含AA较多的细胞容易引发炎症;ω-9 则多含于橄榄油,它既不会引发炎症,也不会抑制炎症。
EPA、DHA、AA三类脂肪酸会玩抢座椅的游戏,一旦DHA、EPA较多,AA就会被排挤出来,因此多摄取DHA、EPA能够起到抗炎的作用。

这周开始了我的 CS 自学计划,目的是补全自己作为转行前端工程师缺失的系统计算机学习。目前的想法是对标计算机本科专业的课程设置,全面系统地学习一遍计算机基础课程。

这个计划的第一门课选择了哈佛大学最受欢迎的公选课程:CS50,算是把自己当做小白重新入门吧。​课程的定位是为包括小白在内的同学提供对 CS 和编码艺术的介绍。第一周的内容是课程介绍,​没有涉及太多的技术细节,我会总结为两个字,就是关于“抽象”。

阅读全文 »

Question

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

You may assume that each input would have exactly one solution, and you may not use the same element twice.

You can return the answer in any order.

Example 1:

1
2
3
4
Input: nums = [2,7,11,15], target = 9
Output: [0,1]
Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].

Example 2:

1
2
3
Input: nums = [3,2,4], target = 6
Output: [1,2]

Example 3:

1
2
Input: nums = [3,3], target = 6
Output: [0,1]
阅读全文 »

链接:https://leetcode.com/problems/plus-one/

Question

You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0‘s.

Increment the large integer by one and return the resulting array of digits.

Example 1:

1
2
3
4
5
Input: digits = [1,2,3]
Output: [1,2,4]
Explanation: The array represents the integer 123.
Incrementing by one gives 123 + 1 = 124.
Thus, the result should be [1,2,4].

Example 2:

1
2
3
4
5
Input: digits = [4,3,2,1]
Output: [4,3,2,2]
Explanation: The array represents the integer 4321.
Incrementing by one gives 4321 + 1 = 4322.
Thus, the result should be [4,3,2,2].

Example 3:

1
2
3
4
5
Input: digits = [9]
Output: [1,0]
Explanation: The array represents the integer 9.
Incrementing by one gives 9 + 1 = 10.
Thus, the result should be [1,0].
阅读全文 »

链接:https://leetcode.com/problems/search-insert-position/

Question

Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.

You must write an algorithm with O(log n) runtime complexity.

Example 1:

1
2
Input: nums = [1,3,5,6], target = 5
Output: 2

Example 2:

1
2
Input: nums = [1,3,5,6], target = 2
Output: 1

Example 3:

1
2
Input: nums = [1,3,5,6], target = 7
Output: 4
阅读全文 »

链接:https://leetcode.com/problems/customers-who-never-order/

Question

Table: Customers

1
2
3
4
5
6
7
8
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| id | int |
| name | varchar |
+-------------+---------+
id is the primary key column for this table.
Each row of this table indicates the ID and name of a customer.
阅读全文 »
0%