diff --git a/articles/2024/trend.md b/articles/2024/trend.md index 2d6e615..4f57bc9 100644 --- a/articles/2024/trend.md +++ b/articles/2024/trend.md @@ -6,8 +6,9 @@ 无头系统(Headless System)是指已配置为无须显示器(即“头”)、键盘和鼠标操作的计算机系统或设备。无头系统通常通过网络连接控制,但也有部分无头系统的设备需要通过RS-232串行连接进行设备的管理。服务器通常采用无头模式以降低运作成本。 -[Headless UI 全称是 Headless User Interface](https://www.merrickchristensen.com/articles/headless-user-interface-components/),是一种前端开发的方法论(亦或者是一种设计模式),其核心思想是将 用户界面(UI)的逻辑和交互行为 与 视觉表现(CSS 样式) 分离开来;具体而言,Headless UI 的组件通常是纯粹的 JavaScript(或其他编程语言)组件,它们包含了一些交互逻辑和状态管理,但没有任何与视觉样式相关的代码。 +[Headless UI 全称是 Headless User Interface](https://www.merrickchristensen.com/articles/headless-user-interface-components/),是一种前端开发的方法论(亦或者是一种设计模式),其核心思想是将 **用户界面(UI)的逻辑和交互行为** 与 **视觉表现(CSS 样式)** 分离开来;具体而言,Headless UI 的组件通常是纯粹的 JavaScript(或其他编程语言)组件,它们包含了一些交互逻辑和状态管理,但没有任何与视觉样式相关的代码。 +这个算是组件开发的一部分了,把逻辑与样式分离开,样式名使用自己的一套命名规则,样式在对这些特定class name进行赋值。 ## AI diff --git a/web/font.md b/cg/font.md similarity index 85% rename from web/font.md rename to cg/font.md index e699e22..1a38db3 100644 --- a/web/font.md +++ b/cg/font.md @@ -62,6 +62,10 @@ figma文字 > 矢量形状 > 屏幕像素 - [canvas-editor基于canvas/svg的富文本编辑器](https://hufe.club/canvas-editor-docs/) +使用 freetype 库 用opengl显示 ,无法显示汉字, +freetype可以根据ttf等格式的font文件 提取到文字轮廓 然后根据轮廓三角化就行了,可以借助[CGAL库](https://www.cgal.org/) + +[FTGL is a free cross-platform Open Source C++ library that uses Freetype2 to simplify rendering fonts in OpenGL applications. FTGL supports bitmaps, pixmaps, texture maps, outlines, polygon mesh, and extruded polygon rendering modes.](https://sourceforge.net/projects/ftgl/) ## 参考 [Web 字体 font-family 该如何设置?](https://zhuanlan.zhihu.com/p/313284552) diff --git a/cpl/language.md b/cpl/language.md index b2ac22b..8b2f224 100644 --- a/cpl/language.md +++ b/cpl/language.md @@ -57,3 +57,16 @@ rust语言的安全,就是通过所有权的确定来保证在运行期不会 - [js版的highlight高亮配置,选中语言,下载后选择es版本的,选择特定语言即可](https://highlightjs.org/download) + +## OOP + object-orientation + +- [What's In a Class? - The Interface Principle](http://www.gotw.ca/publications/mill02.htm) + +- [Tell-Don't-Ask is a principle that helps people remember that object-orientation is about bundling data with the functions that operate on that data.](https://martinfowler.com/bliki/TellDontAsk.html) + +logic 指的就是 functions,logic 和 data 分离,就是 C 时期的 functions + struct;合并起来,就是 class。尽管 trivial getters/setters 是用 class 写的,但和 function + struct 并没有区别,只是在对象里面转发了一下数据而已,反而会使 API 膨胀,显得十分冗余。 + +class 抽象的是想法,而不是一堆数据。private 和 public 访问控制分离了抽象层次,private 里面应该放的是 data,public 里面应该放的是 idea。public 里面的接口要对人,而非对数据,要表现有关抽象的意义,而不是有关抽象的实现。 + +trivial getters/setters 并没有使接口更安全,只是把对于数据的抽象转移到了接口上,这样的封装没有体现任何抽象的意义,也没有体现任何数据间的联系,未能施展 OOP 的 class 概念和访问控制能力。那为什么还要用 class 呢? diff --git a/dev-note/git.md b/dev-note/git.md index 362aa02..449a9ce 100644 --- a/dev-note/git.md +++ b/dev-note/git.md @@ -138,6 +138,8 @@ git checkout -b XXX 新建本地分支XXX git reset --hard commit-id 回滚分支XXX上的某个提交点 git reset --soft HEAD^ 撤销上一个提交,回到staging状态 git reset --soft HEAD~2 撤销多个提交 +git reflog --show 查看操作记录 +git checkout -b branName commit-id ``` 此时代码就是某个提交点的,就可以修改了 diff --git a/dev-note/maven.md b/dev-note/maven.md index 3c88481..6565a83 100644 --- a/dev-note/maven.md +++ b/dev-note/maven.md @@ -12,6 +12,7 @@ ### springboot - mvn spring-boot:run +- mvn package 打包后用java -jar来运行 ## 配置 diff --git a/exercises/index.md b/exercises/index.md index 392ecfa..553fa81 100644 --- a/exercises/index.md +++ b/exercises/index.md @@ -1,5 +1,6 @@ # 习题 -> 典型和分类学习 + +- [常用数学公式排版KaTex语法总结](https://kissingfire123.github.io/2022/02/18_%E6%95%B0%E5%AD%A6%E5%85%AC%E5%BC%8Fkatex%E5%B8%B8%E7%94%A8%E8%AF%AD%E6%B3%95%E6%80%BB%E7%BB%93/) ## 数学 diff --git a/exercises/math.high.md b/exercises/math.high.md index fbcc523..bef2ba6 100644 --- a/exercises/math.high.md +++ b/exercises/math.high.md @@ -1,2 +1,23 @@ # 高中数学 -> + +
+厦门2024强基 + +$$ +\text{已知}x,y \gt 0, (x + y + xy)(x + y - xy) = xy, \text{求}x + y + xy \text{和}x + y - xy \text{的最小值}. \newline +\text{解读:记}A = x + y, B = xy, \text{则有} \newline +\begin{cases} + x,y \gt 0, A^2 \ge 0 \to A^2 - 4B \ge 0 \to A^2 \ge 4B, & \text{(1)} \newline + (A + B)(A - B)=B \to A^2 - B^2 = B \to A^2 = B^2 + B, & \text{(2)} \newline +\end{cases} \newline +\text{联立解得}B \ge 3 (\text{等号成立仅且当}x=y=\sqrt{3}) \newline +x + y + xy = A + B \ge 2\sqrt{B} + B \ge 2\sqrt{3} + 3 \newline +x + y - xy = A - B = \sqrt{B^2 + B} - B = \frac{B^2 + B - B^2}{\sqrt{B^2 + B} - B} = \frac{1}{ \sqrt{1 + \frac{1}{B}} + 1} +\ge = \frac{1}{ \sqrt{1 + \frac{1}{3}} + 1} = 2\sqrt{3} - 3. +$$ + +式子(1)的推理处理后面的就容易了,一步步地推到就可以得到。算术平均数总是大于或等于几何平均数,即算术平均数-几何平均数不等式(AM-GM不等式) +这个性质在数学与物理的许多领域都有应用 + + +
diff --git a/index/book-info.md b/index/book-info.md index 6e3651d..42f51c8 100644 --- a/index/book-info.md +++ b/index/book-info.md @@ -1,7 +1,8 @@ # Books -[只收录优质在线工具的导航网站](https://www.tboxn.com/) -[zlibrary网站状态](https://www.tboxn.com/sites/320.html) +- [只收录优质在线工具的导航网站](https://www.tboxn.com/) +- [zlibrary网站状态](https://www.tboxn.com/sites/320.html) +- [程序员开发的书籍By Developers, For Developers](https://pragprog.com/) ## reading diff --git a/index/computerScience.md b/index/computerScience.md index 325cc21..62a0ef0 100644 --- a/index/computerScience.md +++ b/index/computerScience.md @@ -37,6 +37,7 @@ ## ComputerGraphics - [OpenGL](/cg/api.opengl.md) +- [字体](/cg/font.md) - [webgl](/cg/canvas.md) - [Shader](/cg/shader.md) - [vulkan](/cg/api.modern.md) diff --git a/web/index.md b/web/index.md index 7c645a3..8978e44 100644 --- a/web/index.md +++ b/web/index.md @@ -10,7 +10,7 @@ - [css](/web/css.md) - [canvas](/cg/canvas.md) - [小程序开发](/web/mini.md) -- [字体](/web/font.md) +- [字体](/cg/font.md) - [框架](/web/framework.md) - [测试模块](/web/test.md) - [图像处理](/web/ImageManipulation.md) @@ -21,7 +21,6 @@ - [html](/web/html.md) - [CSS](/web/css.md) - [适配屏幕](/web/adapt.screen.md) -- [font](/web/font.md) - [http](/web/http.md) - [javascript](/cpl/web/ECMAScript.md)