From a953fc69d50ebe85e8b164411fcaa5c72eb1094e Mon Sep 17 00:00:00 2001 From: lmj01 Date: Fri, 10 May 2024 13:38:01 +0800 Subject: [PATCH] update --- articles/2020/clinical.md | 6 ++++++ cg/library/GLRF.md | 20 ++++++++++++++++++ cg/opengl.md | 13 +----------- cpl/go.md | 5 +++++ cpl/js/regularExpressions.js | 40 ++++++++++++++++++++++++++++++++++++ cpl/language.md | 7 ++++++- index.mjs | 2 +- index/computerScience.md | 4 ++++ index/online.md | 4 ++++ web/index.md | 1 + 10 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 articles/2020/clinical.md create mode 100644 cg/library/GLRF.md create mode 100644 cpl/go.md create mode 100644 cpl/js/regularExpressions.js diff --git a/articles/2020/clinical.md b/articles/2020/clinical.md new file mode 100644 index 0000000..0d68e4b --- /dev/null +++ b/articles/2020/clinical.md @@ -0,0 +1,6 @@ +# Clinical + +## 2024-5-9 +产品的部署,绑定到一起了,后面重构的时间也不够,就不会去修改了。 +目前有两个地方需要修改的,一个是提交处,一个是后台处。 +因为使用的UI(CSS库)不一致,部分逻辑放在protocol中的,每次修改都很麻烦,如果没有大需求基本不会给时间去修改了。 \ No newline at end of file diff --git a/cg/library/GLRF.md b/cg/library/GLRF.md new file mode 100644 index 0000000..f007f2c --- /dev/null +++ b/cg/library/GLRF.md @@ -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 diff --git a/cg/opengl.md b/cg/opengl.md index 62a47d2..5165561 100644 --- a/cg/opengl.md +++ b/cg/opengl.md @@ -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) @@ -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/) diff --git a/cpl/go.md b/cpl/go.md new file mode 100644 index 0000000..2893b29 --- /dev/null +++ b/cpl/go.md @@ -0,0 +1,5 @@ +# [go](https://go.dev/) +> + +- [language specification](https://go.dev/ref/spec) + diff --git a/cpl/js/regularExpressions.js b/cpl/js/regularExpressions.js new file mode 100644 index 0000000..5c91705 --- /dev/null +++ b/cpl/js/regularExpressions.js @@ -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 = 'a@b.com', 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); +// } \ No newline at end of file diff --git a/cpl/language.md b/cpl/language.md index ad8fbb8..3a189b7 100644 --- a/cpl/language.md +++ b/cpl/language.md @@ -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) \ No newline at end of file +- [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) \ No newline at end of file diff --git a/index.mjs b/index.mjs index dab4208..10f8e16 100644 --- a/index.mjs +++ b/index.mjs @@ -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('//', '/')}`; diff --git a/index/computerScience.md b/index/computerScience.md index 9e7418e..6f19451 100644 --- a/index/computerScience.md +++ b/index/computerScience.md @@ -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) diff --git a/index/online.md b/index/online.md index c0bf4b6..dbd07b2 100644 --- a/index/online.md +++ b/index/online.md @@ -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/) + ## 计算机 ### 可视化 diff --git a/web/index.md b/web/index.md index d62f7f0..182b8aa 100644 --- a/web/index.md +++ b/web/index.md @@ -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