Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj01 committed Apr 29, 2024
1 parent ddcbc31 commit 657ce7c
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 170 deletions.
8 changes: 8 additions & 0 deletions articles/2024/wechat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 微信
> 网页开发中,很多地方会用到微信,记录一下相关过程
## 扫码关注
- 先获取一个tick数据,是str
- 轮询去检查这个str对应的图像被扫码不
- 扫码,返回openid,属于关注成功
- 为得到openid,重复轮询check
27 changes: 27 additions & 0 deletions cg/opengl.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,33 @@ glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
- [OGLplus's Documentation!](https://matus-chochlik.github.io/oglplu2/sphinx/index.html)
- [github](https://github.com/matus-chochlik/oglplus)

## tools

### [glad](https://glad.dav1d.de/)

- [Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specifications for multiple languages.](https://github.com/Dav1dde/glad)
- [This is a webservice for glad, a multi-language Vulkan/GL/GLES/EGL/GLX/WGL loader-generator based on the official specifications.](https://github.com/Dav1dde/glad-web)

初始化时,一定注意顺序,特别是封装成框架时,一定要注意这个顺序,否则调用任何gl的函数都会失败
```js
void initOpenGl() {
// 必须先执行
glewInit();
// glad的执行前提窗体的上下文context中,即需要先创建窗体
this->window = glfwCreateWindow(resolution.width, resolution.height, "OpenGL", NULL, NULL);
if (!this->window) {
glfwTerminate();
throw std::runtime_error("Failed to create GLFW window!");
}
glfwMakeContextCurrent(this->window);
// 执行任何gl函数前,需要初始化glad
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) {
std::cout << "Failed to initialize GLAD" << std::endl;
}
}
```


## 参考

- [OpenGL基础,一个韩国人写的基础知识](http://www.songho.ca/opengl/index.html)
Expand Down
100 changes: 88 additions & 12 deletions cpl/ECMAScript.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# JavaScript
# ECMAScript
>
- [Standard ECMA-262 6th Edition / June 2015 ECMAScript® 2015 Language Specification ](https://262.ecma-international.org/6.0/)
- [RxMarbles](https://rxmarbles.com/)
- [github](https://github.com/staltz/rxmarbles)

## JavaScript

[JavaScripture The bridge between W3C, WHATWG and ECMAScript](https://www.javascripture.com/)

ECMAScript

Blob-binary large object

***

## 不常用特性与新语法
### 不常用特性与新语法

### double exclamatioin mark

Expand Down Expand Up @@ -58,7 +64,7 @@ a == null ? undefined : a();
***
## 特性
### 特性
**this**
Expand Down Expand Up @@ -150,7 +156,7 @@ Drivered.prototype = Object.assign(Object.create(Base.prototype), {
```
## Event
### Event
浏览器中实现事件循环有两个概念:MacroTask宏任务和MicroTask微任务
macrotasks:setTimeout, setInterval, setImmediate, I/O, UI rendering
Expand All @@ -170,18 +176,17 @@ JavaScript代码执行顺序:从script开始,全局上下文进入函数调
a interface provides the ability to watch for changes being made to the DOM tree.
## web worker
### web worker
HTML5提供了一个javascript多线程解决方案,在之前DOM渲染与JavaScript执行是在同一线程中执行的,现在UI界面与web worker属于不同线程了。
- 通过worker=new Worker(url)加载一个js文件
- 通过postMessage(data)方法来向主线程发送数据
- 绑定worker.onmessage接受worker数据
- 使用worker。terminate()终止一个worker
## typescript
## 工程化
### 工程化
Fetch API
Expand Down Expand Up @@ -217,9 +222,80 @@ Error, DOMException
try...catch...不能捕获异步操作
## typescript
> javascript的超集,更加面向对象的编程语言,可以便宜为纯Javascript
## 参考
### 特性
- [Standard ECMA-262 6th Edition / June 2015 ECMAScript® 2015 Language Specification ](https://262.ecma-international.org/6.0/)
- [RxMarbles](https://rxmarbles.com/)
- [github](https://github.com/staltz/rxmarbles)
union
```typescript
type1 | type2 | type3
```
interface
Typescript的interface比起C#或Java来说时有区别的,Typescript更加广泛,
```typescript
interface SomePoint {
x: number;
y: number;
}
interface SomePoint {
z: number;
}
```
接口合并后增加了扩展性
class
标准模式
```typescript
class A {
static st:string;
inst: number;
constructor(m: any){}
}
```
分解模式
```typescript
interface A_Static {
new(m: any): A_Instance;
st: string;
}
interface A_Instance {
inst: number;
}
declare var A: A_Static;
```
内心时讨厌这种语法的,就是所学其他语言那样,变着花样让我去理解,很容易让人找不到头脑的,但是有时候又特别有用。
***
### [Declaration Files](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)
用来定义类型信息及接口规范,当使用扩展的JS库或插件API时,需要使用声明文件来描述库的类型。比如编辑器需要给引用库的提示,就需要类型信息与接口。所以早期的Javascript 库时没有类型定义信息的,需要创建一个对应的d.ts文件,如three-js这样的库。
写*.d.ts的流程,尽量从文档入口,不要被细节影像。
### 参考
- [typescript官网文档](https://www.typescriptlang.org/docs)
## QuickJS
> 是一个轻量,嵌入式的Javascript引擎
### list
- list.h
```c
struct list_head {
struct list_head *prev;
struct list_head *next;
};
```
链表头的实现。这样看来不是把数据嵌入到链表中,而是把链表嵌入到其它对象中,来维护这些对象之间的链表关系。
### cutils.h/cutils.c
一些位操作,与内存,字符编码,排序等有关的函数
62 changes: 0 additions & 62 deletions cpl/typescript.md

This file was deleted.

3 changes: 3 additions & 0 deletions index/book-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
### [Polygon Mesh Processing](https://book.douban.com/subject/5463738/)
[官网有资源](http://www.pmp-book.org/)

### [The Software Foundations series is a broad introduction to the mathematical underpinnings of reliable software.](https://softwarefoundations.cis.upenn.edu/)
> 该系列现在有6本了,属于理论比较高深的
## readed
- 计算机图形图像设计,2016,中国传媒大学出版社,已读
- 囚徒的困境-冯·诺依曼、博弈论和原子弹之谜,已读
Expand Down
3 changes: 2 additions & 1 deletion index/computerScience.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
- [3D Grafik - WebGL mit three.js](https://xprofan.net/intl/de/php,html,js/3d-grafik-webgl-mit-three-js/)
- [use your mouse to control the camera and build an andorid](https://hofk.de/main/threejs/raycaster/raycaster.html)
- [webgl examples](https://alteredqualia.com/)
- [](https://github.com/brunosimon/folio-2019)
- [22](https://github.com/brunosimon/folio-2019)

### 动画

Expand Down Expand Up @@ -136,6 +136,7 @@
- [协同编辑](../articles/2023/associateEditor.md)
- [Building a collaborative text editor in Go协同开发文本编辑器的go实现思考](https://www.aadhav.me/posts/collaborative-editor)
- [CRDT相关的资料集A Conflict-free Replicated Data Type (CRDT) is a data structure that simplifies distributed data storage systems and multi-user applications.](https://crdt.tech/)


## 数值计算
Expand Down
95 changes: 0 additions & 95 deletions web/quickjs.md

This file was deleted.

0 comments on commit 657ce7c

Please sign in to comment.