Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj01 committed Jun 26, 2024
1 parent 505c4e0 commit 88da8cb
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 50 deletions.
21 changes: 4 additions & 17 deletions cpl/ECMAScript.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ try...catch...不能捕获异步操作
## typescript
> javascript的超集,更加面向对象的编程语言,可以便宜为纯Javascript
```shell
tsc --init 自动生成tsconfig.json文件
```
### 特性
union
Expand Down Expand Up @@ -283,23 +287,6 @@ declare var A: A_Static;
## QuickJS
> 是一个轻量,嵌入式的Javascript引擎
### list
- list.h
```c
struct list_head {
struct list_head *prev;
struct list_head *next;
};
```
链表头的实现。这样看来不是把数据嵌入到链表中,而是把链表嵌入到其它对象中,来维护这些对象之间的链表关系。
### cutils.h/cutils.c
一些位操作,与内存,字符编码,排序等有关的函数
# Babel
babel7舍弃了以前的 babel-*-* 的命名方式,改成了@babel/*-*
处理流程
Expand Down
21 changes: 19 additions & 2 deletions exercises/math.secondary.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
# 中学数学

- 平面几何

## 几何
<details>
<summary>数的几何变换</summary>
让我们从另外一个角度来看到数字,会发现实数与复数一样自然!
**对称与变换**,对称性指的是在某种操作下使物体保持不变的性质。
<p>1. 正方形旋转90度后,旋转对称</p>
<p>2. 沿着直线方向移动一段距离,称为平移对称</p>
<p>3. 放大或缩小任何几何平面图形,称为扩张/缩放对称性</p>
<p>4. 反射</p>

现在用上面定义的几何语言来重新定义数字与运算。
<p>现在想象有一个平面,中间有一条水平直线,把数字0放在中间,把正实数放在0的右边,把负实数放在左边,这就是熟悉的数轴。</p>
<p>现在有一个几何对象,一条直线,将直线平移x个数字会产生什么结果呢?数字0将位于x的位置,数字1位于x+1的位置,即平移变换对应于平移方向就是加减运算</p>
<p>现在进行扩展或缩放变换,这相当于乘法与除法运算,就看你变换的数字是大于1还是小于1,是1就是变换成自己</p>
<p>4. 反射</p>
<p>4. 反射</p>
<p>4. 反射</p>

</details>

## 几何

<details>
<summary>2024-5-33初三模拟习题</summary>
Expand Down
30 changes: 0 additions & 30 deletions web/JavaScript.md

This file was deleted.

2 changes: 1 addition & 1 deletion web/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [使用过的库](/web/library.md)
- [正则表达式](/cpl/js/regularExpressions.js)
- [webassembly](/web/webAssembly.md)
- [web概念](/web/web.md)
- [html](/web/html.md)
- [css](/web/css.md)
- [canvas](/cg/canvas.md)
Expand All @@ -16,7 +17,6 @@
- [图像处理](/web/ImageManipulation.md)
- [diff算法原理](/web/diff.md)
- [FRP-Functional Reactive Programming](/cpl/frp.md)
- [web](/web.md)
- [浏览器](/web/browser.md)
- [html](/web/html.md)
- [CSS](/web/css.md)
Expand Down
27 changes: 27 additions & 0 deletions web/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,33 @@
Access-Control-Allow-Origin:https://www.example.com


## SPA

single page application单页面应用, 动态重写页面与用户交互,不需要重新加载整个页面,实现前后端分离,后端处理数据提供接口,页面逻辑与渲染留给前端处理。

选择何种架构,还与SEO(Search Engine Optimization)搜索引擎优化有关,SEO只与识别HTML中的内容,这就是产生很多页面的原因了。

- SSR,Server Side Render,服务端生成DOM树后返回给前端
- CSR,Client Side Render,渲染过程全部由浏览器进行处理,服务器不参与任何渲染,如Vue框架
- Prerender,预渲染,打包阶段就预先渲染页面,如Angular框架

### SSR
大致流程
1. 浏览器请求HTTP-GET(url) => 服务器进行路由分析与渲染,返回HTML首屏
2. 浏览器请求HTTP-GET的bundle.js资源 => 服务器返回bundle.js
3. 浏览器进行路由分析,生成DOM => diff & patch DOM and bind event => 更新渲染

### CSR
大致流程
1. 浏览器请求HTTP-GET(url) => 服务器返回HTML模板
2. 浏览器根据模板中的bundle.js资源 HTTP-GET => 服务器返回bundle.js资源
3. 浏览器执行路由分析与渲染,得到首屏

### Prerender
大致流程
1. 浏览器请求HTTP-GET(url) => 服务器返回预渲染的HTML
2. 浏览器请求HTTP-GET的bundle.js资源 => 更新渲染

## 记住密码

做网站时会碰到要实现记住密码,下次自动登录,一周内免登录等这种需求,一般都是通过cookie来实现的。用户成功登录后,存储一个实现自动登录的cookie数据到数据库,作为下次登录时验证使用,验证通过就自动登录,否则需要输入用户名和密码进行登录。

0 comments on commit 88da8cb

Please sign in to comment.