Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj01 committed May 10, 2024
1 parent 7b458ba commit a953fc6
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 14 deletions.
6 changes: 6 additions & 0 deletions articles/2020/clinical.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Clinical

## 2024-5-9
产品的部署,绑定到一起了,后面重构的时间也不够,就不会去修改了。
目前有两个地方需要修改的,一个是提交处,一个是后台处。
因为使用的UI(CSS库)不一致,部分逻辑放在protocol中的,每次修改都很麻烦,如果没有大需求基本不会给时间去修改了。
20 changes: 20 additions & 0 deletions cg/library/GLRF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# [GLRF](https://github.com/lmj01/GLRF)
> OpenGL Realtime Framework
## FrameBuffer.hpp
配置GL_FRAMEBUFFER,并绑定n(>=1)个GL_COLOR_ATTACHMENT0+n关联GL_TEXTURE_2D,如果有depth buffer,也配置好

注意两个函数都是在glBindFramebuffer有效之间进行操作

### [glDrawBuffers](https://registry.khronos.org/OpenGL-Refpages/gl4/html/glDrawBuffers.xhtml)
> define an array of buffers into which outputs from the fragment shader data will be written
shader输出到缓存中。它需要绑定Framebuffer Object,如果是0,就是默认的framebuffer绑定。
```c
GLuint attachments[] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 };
glDrawBuffers(config.num_color_buffers, attachments);
```
### [glFramebufferRenderbuffer](https://registry.khronos.org/OpenGL-Refpages/gl4/html/glFramebufferRenderbuffer.xhtml)
> attach a renderbuffer as a logical buffer of a framebuffer object
Renderbuffers cannot be attached to the default draw and read framebuffer
13 changes: 1 addition & 12 deletions cg/opengl.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,18 +180,6 @@ if(ptr)
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
```

## 接口

### [glDrawBuffers](https://registry.khronos.org/OpenGL-Refpages/gl4/html/glDrawBuffers.xhtml)

define an array of buffers into which outputs from the fragment shader data will be written, shader输出到缓存中。它需要绑定Framebuffer Object,如果是0,就是默认的framebuffer绑定。

```c
GLuint attachments[] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 };
glDrawBuffers(config.num_color_buffers, attachments);
```
## UI库

- [NanoGUI is a a minimalistic cross-platform widget library for OpenGL 3.x. It supports automatic layout generation, stateful C++11 lambdas callbacks, a variety of useful widget types and Retina-capable rendering on Apple devices thanks to NanoVG by Mikko Mononen. Python bindings of all functionality are provided using pybind11. ](https://github.com/wjakob/nanogui)
Expand Down Expand Up @@ -236,5 +224,6 @@ void initOpenGl() {
- [OpenGL教程和资料集合](https://zhuanlan.zhihu.com/p/41818595)
- [OpenGL Loading Library](https://www.khronos.org/opengl/wiki/OpenGL_Loading_Library)
- [GLRF - OpenGL Realtime Framework](https://github.com/DunkleMango/GLRF)
- [GLRF笔记](/cg/library/GLRF.md)
- [g-truc creation, OpenGL Mathematics (GLM) OpenGL Image (GLI)等有关opengl的文档与知识](https://www.g-truc.net/)

5 changes: 5 additions & 0 deletions cpl/go.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# [go](https://go.dev/)
>
- [language specification](https://go.dev/ref/spec)

40 changes: 40 additions & 0 deletions cpl/js/regularExpressions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// 汉字、字母、数字、下划线
const re1 = /^[\u4E00-\u9FA5A-Za-z0-9]+$/i;
const re2 = new RegExp('^[\u4E00-\u9FA5A-Za-z0-9_]+$', 'i');
// 汉字
const re3 = /^[\u4e00-\u9fa5]{0,}$/i;
const re3a = /^([\u4e00-\u9fa5]{0,})/i;
const re3b = /[^\u4e00-\u9fa5]/g; // 提取汉字
const re3c = /[^\u4e00-\u9fa5A-Za-z]/g; // 提取汉字字母
// 邮件地址
const re4 = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i;
/**
* 正则表达式中的()作为分组来使用,获取分组匹配到的结果用Regex.$1 $2 $3....来获取
* @deprecated RegExp.$1这种方式已经废弃了
*/
const re4a = /(\w+)@(\w+)\.(\w+)(\.\w+)?/i;

// let str1 = 'abc123';
// console.log(1, 'match', '1', str1.match(re1), '2', str1.match(re2));
// console.log(2, 'replace', '1', str1.replace(re1,''), '2', str1.replace(re2, ''));

let str3 = '我得数字1', str3a = '11汉字', str3b = '11汉字aa', str3c = 'bb11汉字aa';
console.log(3, re3.test(str3), str3.match(re3), re3.test(str3a), str3a.match(re3))
if (re3a.test(str3)) {
console.log(3, RegExp.$1, RegExp.$2);
}
if (re3a.test(str3a)) {
console.log('3a',RegExp.$1, RegExp.$2);
}
console.log('3b', str3.replace(re3b, ''), str3a.replace(re3b,''));
console.log('3b', str3b.replace(re3c, ''), str3b.replace(re3c,''));
console.log('3b', str3c.replace(re3c, ''), str3c.replace(re3c,''));

// let str4 = '[email protected]', str4a = 'a.b.com';
// console.log(4, str4.match(re4), str4a.match(re4));
// if (re4a.test(str4)) {
// console.log('4a1', RegExp.$1, RegExp.$2, RegExp.$3);
// }
// if (re4a.test(str4a)) {
// console.log('4a2', RegExp.$1, RegExp.$2, RegExp.$3);
// }
7 changes: 6 additions & 1 deletion cpl/language.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ rust语言的安全,就是通过所有权的确定来保证在运行期不会
> 可组合的,强调函数,是大型软件和云开发的一些概念基础
- [A build system for development of composable software.JS版的可组合的管理开发](https://github.com/teambit/bit)
- [Android Jetpacketpack 是一个由多个库组成的套件,可帮助开发者遵循最佳做法、减少样板代码并编写可在各种 Android 版本和设备中一致运行的代码,让开发者可将精力集中于真正重要的编码工作](https://developer.android.google.cn/jetpack?hl=zh-cn)
- [Android Jetpacketpack 是一个由多个库组成的套件,可帮助开发者遵循最佳做法、减少样板代码并编写可在各种 Android 版本和设备中一致运行的代码,让开发者可将精力集中于真正重要的编码工作](https://developer.android.google.cn/jetpack?hl=zh-cn)

## 工具

### [正则表达式regular expression](https://www.regular-expressions.info/)
[js RegExp](/cpl/js/regularExpressions.js)
2 changes: 1 addition & 1 deletion index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const patternExternal = /^(https?:|mailto:|tel:)/
function tagLinkClickCaption(event, aLink) {
event.stopPropagation();
event.preventDefault();
const isSameOrigin = aLink.href.startsWith(rootOrigin) && aLink.href.endsWith('.md');
const isSameOrigin = aLink.href.startsWith(rootOrigin) && ['.md','.js','.cpp','.lua'].find(e=>aLink.href.endsWith(e));
if (isSameOrigin) {
// 只解析本地的markdown文件
const tmp = `${rootRelative}${aLink.href.replace(rootOrigin,'').replace(rootRelative, '').replace('//', '/')}`;
Expand Down
4 changes: 4 additions & 0 deletions index/computerScience.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
- [ECMAScript](/cpl/ECMAScript.md)
- [lua](/cpl/lua.md)
- [Java](/cpl/Java.md)
- [Go](/cpl/go.md)
- [Julia](https://julialang.org/)
- [Elixir](https://elixir-lang.org/)
- [Zig is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software.](https://ziglang.org/)

- [core analyzer -- A power tool to understand memory layout](https://core-analyzer.sourceforge.net/index_files/Page525.html)

Expand Down
4 changes: 4 additions & 0 deletions index/online.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 线上文章

## 数学

- [数学家记录史MacTutor is a free online resource containing biographies of more than 3000 mathematicians and over 2000 pages of essays and supporting materials. ](https://mathshistory.st-andrews.ac.uk/)

## 计算机

### 可视化
Expand Down
1 change: 1 addition & 0 deletions web/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- [Web Check网站分析,分析各种配置,可参考网站的配置](https://web-check.as93.net/)
- [Draggable objects可拖动的对象网页实现](https://www.redblobgames.com/making-of/draggable/)

- [正则表达式](/cpl/js/regularExpressions.js)

## WebGL

Expand Down

0 comments on commit a953fc6

Please sign in to comment.