Live Note

Remain optimistic

项目文件目录

1
2
3
4
5
6
7
8
9
10
11
12
-Demo
|--build
|--dist
|--css
|--js
|--view
|--node_modules
|--src
|--
|--package.json
|--webpack.config.js
|--webpack.production.config.js
  • src:代码开发目录
  • build:开发环境 webpack 输出目录
  • dist:生产环境 webpack 输出目录
  • package.json:项目配置
  • webpack.config.js:开发环境配置
  • webpack.production.config.js:生产环境配置

webpack 配置文件

需命名为 webpack.config.js

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
const path = require("path") // 模块

module.exports = {
mode: "development",
entry: path.join(__dirname, "./src/main.js"), // 入口文件
output: {
path: path.join(__dirname, "./dist"), // 输出文件
filename: "bundle.js",
},
plugins: [
// 插件
],
module: {
rules: [
// 路由规则
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
{
test: /\.(png|jpg|gif|bmp|jpeg)$/,
use: "url-loader?limit=1111&name=[hash:8]-[name].[ext]",
},
{
test: /\.(ttf|eot|svg|woff|woff2)$/,
use: "url-loader",
},
{
test: /\.js$/,
use: "babel-loader",
exclude: /node_modules/,
},
],
},
}

webpack-dev-server

  • 通过 npm 安装:npm i webpack-dev-server
  • 运行命令:webpack-dev-server –devtool eval –port 9876 –progress –colors – compress –hot –inline –content-base ./build
    可以在 package.json 中的 script 加一个启动项。
  • –devtool eval:在报错时精确到文件的行号
  • –progress:显示编译的输出内容进度
  • –compress:启用 gzip 压缩
  • –hot:热更新,无需刷新浏览器
  • –colors:显示编译的输出内容颜色
  • –inline:自动刷新模式。默认为 iframe。
  • –content-base:设置输出目录。

Function

function has special rules:

  1. It must work for every possible input value
  2. And it has only one relationship for each input value

Although each input will only have one output, but for different inputs may have the same output.

Pure function

Given all these, pure functions have a big set of advantages. They are easier to read and understand, as they do one thing. There is no need to look outside the function code and check for variables. There is no need to think how changing the value of the variable will affect other functions. No mutations in other functions will affect the result of the pure function for a specific input.
Pure functions are easier to test, as all dependencies are in the function definition and they do one thing.
For Example:

1
2
3
4
5
6
7
8
9
10
var arr = [1, 2, 3]

// Pure
arr.slice(0, 2) // [1, 2]
arr.slice(0, 2) // [1, 2]
arr.slice(2, 3) // [3]

// Impure
arr.splice(0, 2) // [1, 2]
arr.splice(0, 2) // [3]

Another Example:

1
2
3
4
5
6
7
8
9
10
11
// Impure
var sign = 3

// The return value depends on the system status
var isBigger = (num) => num > 3

// Pure
var isBigger = (num) => {
var sign = 3
return num > sign
}

序言

农业和游牧或工业不同,它是直接取资与土地的。
游牧的人飘忽不定,工业可以择地而居。
而种地的人却搬不动地。

从农业本身来看,是无需群居的。最小的社区可以只有一户人家。
夫妻和孩子聚集,满足两性与抚养的需要。
无论在什么性质的社会里,家庭总是最基本的抚养社群。

中国农民聚集而居原因:

  1. 耕地面积小,小农经营。住所与耕地不会相隔太远
  2. 需要水利,所以大家一起合作。
  3. 合作弊害。
  4. 土地继承。

农村属于 face to face group,所以 文字 在农村并没有太大意义。

社会学中通常两种不同性质的社会:

  1. 共同体:没有主要的目的聚集。
  2. 社会:有主要的目的聚集。

孝是什么,孔子并没有抽象地加以说明。最后归结到“心安”二字。
做子女的在日常接触中熟悉父母的性格,然后承他们的欢,做到心安。

Read more »

见证历史了吧

上证指数开盘涨停。

国家这次真算得上破釜成舟了。

就是不知道,半年/多年后回过头来看,这是起大厦的首日,还是倾大厦的首日呢?

不得而知。 楼他们是不打算救了,可以考虑购买房子了。

section 1

小舅子目前阶段的学习生涯结束了,在下一段学习之前,他决定去赚点零花钱。

他在惠州,干了奶茶店/进厂打工/跑外卖。后面还是决定去深圳,跟着他表哥去跑外送。

从小体质就差,再加上深圳鱼龙混杂,病毒也多,没几天就感染了。

  • 2024/7/7 日,送到深圳。
  • 2024/7/11 日凌晨,肚子痛,叫救护车。诊断为胆囊炎。
  • 2024/7/12 日,夜间 11h 左右,未好转,转院到惠州三院,抢救+进入 CCU 治疗。
  • 2024/7/12 日,医生告病重,同时拍片结果显示,前纵隔存在一个畸胎瘤。
  • 2024/7/13 日,未好转,感染指标依旧高,检查过杆菌/结核菌/DNA 序列检测,未找到原因。
  • 2024/7/14 日,感染指标下降,医生说畸胎瘤必须要切除,病理报告未收到,建议先等待。
  • 2024/7/15 日,感染指标下降,右侧积水增多,已经联系好广州三甲医院,先去看心血管方面的情况。积水估计还是要上引流管。
  • 2024/7/16 日,医生说考虑是恶性肿瘤,等待病理结果。
  • 2024/7/17 日,病理结果未出,检测报告拿到广州肿瘤防治中心,医生推测为恶性肿瘤。身体指标好转。
  • 2024/7/18 日,出院,转入中山大学孙逸仙纪念医院(越秀)。
  • 2024/7/21 日,高烧 39 度。
  • 2024/7/22 日,术前准备,状态尚可。
  • 2024/7/23 日,手术很成功,肿瘤大小目测 10cm10cm5cm。

畸胎瘤,生殖细胞肿瘤,医生说出生的时候就携带了,但是不清楚是什么时候发展的。三院无法处理,建议转去更高级医院。医生综合评估,目前的腹部和胸腔还是存在积水,积水的原因很可能就是畸胎瘤导致的,所以建议优先处理畸胎瘤。