diff --git a/articles/2024/appDev.md b/articles/2024/appDev.md index 9a8bbad..b90cc1c 100644 --- a/articles/2024/appDev.md +++ b/articles/2024/appDev.md @@ -6,3 +6,7 @@ ## 鸿蒙系统 - [HUAWEI DevEco Studio面向HarmonyOS应用及元服务开发者提供的集成开发环境(IDE), 助力高效开发。](https://developer.huawei.com/consumer/cn/deveco-studio/) - [官方案例](https://gitee.com/openharmony/applications_app_samples) + +### 开发问题 + +在local.properties中填写sdk.dir diff --git a/cg/canvas.md b/cg/canvas.md index 1556b73..6df43fa 100644 --- a/cg/canvas.md +++ b/cg/canvas.md @@ -99,4 +99,12 @@ ctx.translate(-center.x, -center.y); ## 参考 - [OffscreenCanvas-离屏canvas使用说明](https://zhuanlan.zhihu.com/p/100375855) -- [canvas-scale](https://dustinpfister.github.io/2019/03/06/canvas-scale/),这篇文章很详细的介绍了canvas关于scale的细节,配合[playground](https://playcode.io/1833399)查看结果 \ No newline at end of file +- [canvas-scale](https://dustinpfister.github.io/2019/03/06/canvas-scale/),这篇文章很详细的介绍了canvas关于scale的细节,配合[playground](https://playcode.io/1833399)查看结果 + +## 经验 + +### 2024-4-19 +在使用CanvasRenderingContext2D.drawImage以canvas为参数时,关于图像的放大问题,会陷入使用图像的逻辑中,先以中心点放大,再截图。 +在使用canvas实现这个逻辑时,小程序上的实现让我很郁闷。表现出了不是预期的情况。 +最后就是简单的绘制一部分到另外一个canvas上,就产生了预期的结果。实在令人困扰。 +这个可能与微信中canvas实现机制有关,那就好奇实现原理了。 \ No newline at end of file diff --git a/cg/ct.md b/cg/ct.md index d84e99c..0cb643b 100644 --- a/cg/ct.md +++ b/cg/ct.md @@ -86,3 +86,4 @@ WADO:Web Access to DICOM Objects - PET(Positron Emission Tomography), 正电子发射断层成像,PET 对疾病诊断的灵敏度高,但分辨率低 - Ultrasound, 超声,可以清晰显示脏器及周围器官的各种断面像,接近解剖真实结构,因其价廉、简便、迅速、无创、无辐射性、准确、可连续动态及重复扫描等优势应用甚广 - VOI(volumes of interest), 感兴趣区域 +- Slab Thickness(), 三维图像数据中的一个切片或体检元素Voxel diff --git a/cg/geometry.md b/cg/geometry.md index 1355adc..e026469 100644 --- a/cg/geometry.md +++ b/cg/geometry.md @@ -21,4 +21,7 @@ CAD的开花理论, 2005年,Tom Hughes博士提出了等几何分析的思想(isogeometric analysis),核心是采用统一的样条语言来表达几何形状和物理场:利用平面NURBS参数曲面或者体NURBS参数体积作为计算域,计算单元为节点区间对应的曲面单元或者体单元;以NURBS基函数作为物理场的基函数(形函数),以控制顶点的物理数学分量作为未知变量。这样,形状几何与分析几何在同一样条空间,避免了数据交换;在精确CAD几何上进行仿真计算,避免了几何离散误差;在同样自由度下,达到较高计算精度,或者在同样的精度下,需要较少的自由度。同时,物理仿真保持了光滑性。从工程角度而言,等几何分析与传统的有限元方法兼容,等几何分析可以集成到现有的有限元环境之中。 -虽然等几何分析具有很多传统方法无法比拟的优点,但是等几何分析并没有被工业界广泛采纳,核心在于传统CAD工业中的样条曲面无法满足等几何分析的要求。传统NURBS大量应用裁剪样条,裁剪样条无法分解成规则单元,需要重新构造;传统NURBS缺乏水密性,存在大量缝隙,因此有很多弥补缝隙的碎片样条,需要融合成整片样条;最为致命的问题是传统CAD模型只表达了几何体的边界曲面,而等几何分析需要将整个实体的内部也表达成样条。 \ No newline at end of file +虽然等几何分析具有很多传统方法无法比拟的优点,但是等几何分析并没有被工业界广泛采纳,核心在于传统CAD工业中的样条曲面无法满足等几何分析的要求。传统NURBS大量应用裁剪样条,裁剪样条无法分解成规则单元,需要重新构造;传统NURBS缺乏水密性,存在大量缝隙,因此有很多弥补缝隙的碎片样条,需要融合成整片样条;最为致命的问题是传统CAD模型只表达了几何体的边界曲面,而等几何分析需要将整个实体的内部也表达成样条。 + +## 参考 +- [代数几何小科普3:怎么知道方程(组)有解? ](https://blog.sciencenet.cn/blog-1646100-818073.html) \ No newline at end of file diff --git a/cg/library/cornerstonejs.md b/cg/library/cornerstonejs.md index 2b8f3c5..1d6b022 100644 --- a/cg/library/cornerstonejs.md +++ b/cg/library/cornerstonejs.md @@ -18,4 +18,12 @@ yarn run serve-static-examples - volume,是三个 ## 文档 -- [一文(10图)了解Cornerstone3D核心概念(万字总结附导图) ](https://juejin.cn/post/7326432875955798027) \ No newline at end of file +- [一文(10图)了解Cornerstone3D核心概念(万字总结附导图) ](https://juejin.cn/post/7326432875955798027) + +## [OHIF Medical Imaging Viewer](https://github.com/lmj01/Viewers) + +### DICOM +关于处理DICOM的部分,分了三部分 +- DICOM RT(Radiation Therapy),是DICOM3.0的标准扩展,专门用于放射治疗 +- DICOM Seg(Segmentation), 涉及图像分割,是一种将医学影像中的特定结构、感兴趣区域与周围组织分离的过程 +- DICOM SR(Structured Reporting), 是DICOM标准的一部分, \ No newline at end of file diff --git a/cg/library/itk.md b/cg/library/itk.md new file mode 100644 index 0000000..e2f81f2 --- /dev/null +++ b/cg/library/itk.md @@ -0,0 +1,12 @@ +# [ITK](https://itk.org/) +> Gain insights into scientific images with the Insight Toolkit (ITK) + +## 概念 + +### 宏Marco +ITK创建对象的一种机制,因为ITK中的constructor构造函数都是protect的,不能直接调用。这样的目的就是添加标准方法到所有的类当中。 + +### DICOM +ITK中的[DICOM Rescale Slope/Intercept](https://docs.itk.org/en/latest/learn/dicom.html) + +## itk.js diff --git a/cg/shader.md b/cg/shader.md index 77f6493..1b38e56 100644 --- a/cg/shader.md +++ b/cg/shader.md @@ -20,7 +20,7 @@ const passSequence = { { subpasses: [], }, - ], + ], }; // 渲染主循环 function doRender() { @@ -97,7 +97,7 @@ shader的作用就是由数据生成图像 Render Pass定义为一个渲染步骤。如有一个很多不同材质的球体的场景需要渲染,就可以声明一个render pass给所有球使用,因为对每一个球体,渲染结果都会输出到同一个FrameBuffer的Attachment上,所以流程上是一样的。 -如果说Buffer的数据可以供所有shader使用,那么在render pass中就是更加定制化的渲染, +如果说Buffer的数据可以供所有shader使用,那么在render pass中就是更加定制化的渲染, 每个pass通常对应的渲染流程中不同阶段【相同阶段通常会使用MRT,或硬件不支持,需要多个Pass;或渲染目标size不一样,也需要多个pass来渲染】。实际意义是对一个Mesh渲染多遍,是对材质抽象的一种解释,一个Technique里会包含一个或多个Pass,如DeferredLighting流程里面一个物体就需要2个Pass,一个用来计算Z,一个用来lighting;如果有阴影,又需要一个Pass;如果需要精细反射图,需要一个反射的Pass。引擎一般会把状态类似的不同Mesh的Pass一起渲染, 用Pass对材质进行排序。 @@ -141,6 +141,10 @@ mat3( - [WebGPU Shading Language](https://gpuweb.github.io/gpuweb/wgsl/) - [WebGPU深入探索](http://www.bimant.com/blog/webgpu-deep-dive/) +### [RenderDoc](https://renderdoc.org/) + +[RenderDoc在线文档](https://renderdoc.org/docs/index.html) + ## 参考 - [the books of shader详细解说shader的开源书籍](https://thebookofshaders.com/) diff --git a/dev-note/cmake.md b/dev-note/cmake.md index 4c54b02..b908305 100644 --- a/dev-note/cmake.md +++ b/dev-note/cmake.md @@ -46,4 +46,5 @@ MSBuild.exe INSTALL.vcxproj /p:Configuration=release - [cmake常用命令](https://zhuanlan.zhihu.com/p/315768216) - [CMake-tutorial中文教程](https://www.cnblogs.com/lnlin/p/16576418.html) - [CMake入门笔记系列(一):CMake编译过程详解 | Micro CMake for C++](https://zhuanlan.zhihu.com/p/620839692) -- [一个简单例子,完全入门CMake语法与CMakeList编写](https://zhuanlan.zhihu.com/p/630144233) \ No newline at end of file +- [一个简单例子,完全入门CMake语法与CMakeList编写](https://zhuanlan.zhihu.com/p/630144233) +- [CMake的自动传递依赖Configuring Transitive Dependencies with Modern CMake](https://www.cppmore.com/2024/04/22/configuring-transitive-dependencies-with-modern-cmake/) \ No newline at end of file diff --git a/dev-note/cmd.md b/dev-note/cmd.md index 174a93f..833d1b0 100644 --- a/dev-note/cmd.md +++ b/dev-note/cmd.md @@ -2,6 +2,13 @@ ## bat - copy +- echo %path% +### 环境变量 +环境变量设置,这样只能在CMD窗口有效,永久有效的有两种方法:一是注册表,二是系统变量 +- set // 查看所有 +- set 变量名=变量内容 // 赋值 +- set 变量名= // 置空 +- set 变量名=%变量名%;变量内容 // 如set path=%path%;d:\nmake.exe ## powershell 拷贝目录到另一个目录 diff --git a/dev-note/vscode.md b/dev-note/vscode.md index 0533d17..823f9c6 100644 --- a/dev-note/vscode.md +++ b/dev-note/vscode.md @@ -11,14 +11,14 @@ vscode的配置有两种形式 ```json { // 预览模式关闭,直接打开新的tab页面 - "workbench.editor.enablePreview":false, - + "workbench.editor.enablePreview":false, + // Customizes which terminal to run on Windows. - "terminal.external.windowsExec": "C:\\windows\\System32\\cmd.exe", - + "terminal.external.windowsExec": "C:\\windows\\System32\\cmd.exe", + // The path of the shell that the terminal uses on Windows. [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration). "terminal.integrated.shell.windows": "C:\\windows\\system32\\cmd.exe", - + } ``` @@ -58,7 +58,7 @@ rem %USERPROFILE% 当前用户的配置文件目录 rem %HOMEPATH% 当前用户的配置文件目录 rem %APPDATA% 当前用户的配置文件目录 rem 设置绝对路径 -call:set_absolute_path USERPROFILE .\.portable\User +call:set_absolute_path USERPROFILE .\.portable\User call:set_absolute_path APPDATA .\.portable\User\AppData\Roaming call:set_absolute_path mingwbin .\.portable\mingw64\bin call:set_absolute_path msysbin E:\IDE\msys1.0\bin @@ -74,7 +74,7 @@ rem %~fX 将%X扩充到一个完全合格的路径名 rem %~dX 将%X扩充到一个驱动号 :set_absolute_path for /f %%p in ("%2") do (set %1=%%~fp) -goto:eof +goto:eof ``` VSCode的[extensions installed]()的路径 @@ -104,74 +104,6 @@ ${fileExtname}:当前打开文件的后缀名 ${cwd}:当前执行目录 ``` -## msys - -mingw只是编译的运行库,缺少相关的系统级的工具,就需要msys了。 - -[msys-1.0]()下载这个系统级别工具,安装到指定目录 - -### 方案1 - -把msys工具配置给mingw64使用,这样没有home路径,只能算是运行库和运行环境 - -```bat -@echo off -set mingw=H:\\tools\\VSCode-win32-x64-1.38.0\\.portable\\mingw64 -set msys=H:\\tools\\msys\\1.0\\bin -set PATH=%PATH%;%mingw%;%msys% - -start C:\Windows\System32\cmd.exe -``` - -### 方案2 - -使用msys为入口,这样就存在home,和根目录root,就可以安装指定的软件,可以编译相关的软件来使用了。 - -在msys.bat文件里面添加mingw的路径 - -## clang-llvm - -### 方案1 - -编译[llvm 8.0.0](http://releases.llvm.org/8.0.0/)版本 - -```shell -// llvm根目录 -llvm -// 其他部分源码分两大类,tools和projects -llvm/tools/clang -llvm/tools/clang/tools/extra -llvm/tools/lld -llvm/tools/lldb -llvm/tools/polly -llvm/projects/compiler-rt -llvm/projects/libcxx -llvm/projects/libcxxabi -llvm/projects/libunwind -llvm/projects/openmp -// -``` - -[编译参考](https://llvm.org/docs/CMake.html) - -```shell -cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/llvm/install/8.0.0 ../../llvm-8.0.0 -cmake --build . -cmake --build . --target install -``` - -mingw64-win32版本的mutex没有得到支持,编译不能通过,使用posix版通过至10% - -出现glibc的引发的连锁问题,改用vs编译发现lldb面前不支持window。这样就没有必要去做任何的尝试了。 - -### 方案2 - -mingw的环境编译存在些许问题,相关的依赖库很难配齐,[llvm download page](http://releases.llvm.org/download.html)下载编译好的 - -但是有个缺点就是没有lldb。 - -目前只能用来编译代码,还不能调试。 - ## 配置VSCode 在VSCode的启动batch文件中设置LLVM的bin环境 @@ -188,7 +120,7 @@ mingw的环境编译存在些许问题,相关的依赖库很难配齐,[llvm "intelliSenseMode": "clang-x64", "includePath": [ "${workspaceFolder}", - "D:/App/MinGW/mingw64/include", + "D:/App/MinGW/mingw64/include", "D:\\llvm\\7.0.1-win64\\LLVM\\include", "H:\\tools\\VSCode-win32-x64-1.38.0\\.portable\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\8.1.0", "H:\\tools\\VSCode-win32-x64-1.38.0\\.portable\\mingw64\\x86_64-w64-mingw32\\include" @@ -201,7 +133,7 @@ mingw的环境编译存在些许问题,相关的依赖库很难配齐,[llvm ], "browse": { "path": [ - "${workspaceFolder}" + "${workspaceFolder}" ], "limitSymbolsToIncludedHeaders": true, "databaseFilename": "" @@ -214,6 +146,8 @@ mingw的环境编译存在些许问题,相关的依赖库很难配齐,[llvm } ``` +- Workbench › Editor: Enable Preview, 打开新的页面 + ### 快捷键 Ctr + ` 打开集成终端 @@ -223,7 +157,7 @@ Ctr + Shift + ` 打开新终端 安装Tex Live软件,使用清华的镜像,在VSCode中安装插件 - latex workshop -- latex preview +- latex preview 配置参数, 参考使用就是啦! 注意的是目录和参考文档的生成是需要中间文件的,而且是需要多次执行的 @@ -242,4 +176,4 @@ xxxx是tex的文件名,后缀.tex可省略,最后点击Latex的build控件 ## reference -- [从 VSCode 看大型 IDE 技术架构](https://zhuanlan.zhihu.com/p/96041706) \ No newline at end of file +- [从 VSCode 看大型 IDE 技术架构](https://zhuanlan.zhihu.com/p/96041706) diff --git a/index/article.md b/index/article.md index 3131cab..da13fba 100644 --- a/index/article.md +++ b/index/article.md @@ -23,6 +23,7 @@ - [powershell](../dev-note/powershell.md) - [nodejs包管理](../web/pkg.md) - [包管理C++](../dev-note/pkg.md) +- [maven](../java/maven.md) ### web - [网页开发内容](../web/index.md) diff --git a/index/community.md b/index/community.md index 9dccd3b..24e8345 100644 --- a/index/community.md +++ b/index/community.md @@ -6,6 +6,7 @@ - PaaS, Platform as a service - SaaS, Software as a service - IQaaS, Intelligence as a service +- [设计模式目录](https://refactoringguru.cn/design-patterns/catalog) ### Actor diff --git a/index/online.md b/index/online.md index 06e6746..0b668af 100644 --- a/index/online.md +++ b/index/online.md @@ -39,6 +39,7 @@ - [Denis Bakhvalov, 关于性能优化的一个博客](https://easyperf.net/) - [SaschaWillems,业余贡献实时3D以Khronos标准软件开发者](https://www.saschawillems.de/) - [Agner Fog Research, 涉及很多编程知识,很好的文档几何,作者自己更新自己的理解与文档](https://www.agner.org/?e=0#0) +- [Bjarne StroustrupC++之父的网站](https://www.stroustrup.com/) ## 工具 diff --git a/web/pkg.md b/web/pkg.md index 8216121..a238744 100644 --- a/web/pkg.md +++ b/web/pkg.md @@ -3,113 +3,97 @@ ## update ```js +node --harmony script.js --version --help --harmony 传递给node参数的修饰 npm install -g n 非window上使用n来管理 +npm config list ``` -# [npm](https://docs.npmjs.com/) +# 包管理 -```bat -node --harmony script.js --version --help ---harmony 传递给node参数的修饰 -``` -```javascript -npm init -vim index.js -node index.js +## [npm](https://docs.npmjs.com/) + +[npm-config](https://docs.npmjs.com/cli/v10/commands/npm-config) + +```js +npm init // 初始化工程 npm init -w ./packages/a // 创建子包 npm install libraryX --workspace packages/pA // 子工作区按照特定依赖 npm i libraryX -w packages/pA -``` - -包管理 - -```shell -npm install --registry=https://registry.npm.taobao.org 指定淘宝源的安装 npm install XXX 安装但不写入package.json npm install XXX --save 安装且写入package.json中的dependencies npm install XXX --save-dev 安装且写入package.json中的devDependencies npm install xxx@a.b.c --save-dev // 安装指定版本 npm install update xxx --save-dev 指定升级某个包 npm install xxx@latest --save-dev 安装最新版本 -npm install -ddd // 可以查看安装的细节 +npm install -ddd // 可以查看安装的细节, 查看安装细节卡住哪里 npm install relative-path // 把某个本地包安装进当前工程 npm lx xxx 查询依赖的库信息 -``` - -npm已经发展几个版本了,npm5发布于2017年,增加了package-lock.json文件,它对应node_modules中目录文件层结构是对应的,是锁定依赖安装结构 - -清除node_modules目录的在非window的命令可参考 - -```shell -find . -name "node_modules" -print | xargs rm -rf -``` - -## 配置 - -### proxy - -```shell +// proxy代理设置 npm config get proxy npm config get https-proxy // 确定没有设置代理, 返回为null, 否则强制设置为null npm config set proxy null npm config set https-proxy null - -npm config get registry -npm config delete registry - -``` - - -### cnpm -为解决国内网络环境的问题,需要使用稳定的网络源 -[淘宝镜像](https://npm.taobao.org/) - -```javascript +// 镜像设置 +npm config get registry // 获取 +npm config delete registry // 删除注册表 +npm config set registry https://registry.npmmirror.com // 使用镜像源 +npm config set registry https://registry.npmjs.org // 官方源 npm install -g mirror-config-china --registry=https://registry.npm.taobao.org -npm install -g cnpm --registry=https://registry.npm.taobao.org -ln -s xxx/cnpm /usr/bin/cnpm - -``` - -### install failure - -npm 有9层日志行为 -silent, error, warn, notice, http, timing, info, verbose, silly - -合并代码时,总是被他人的package.json与package-lock.json产生的冲突问题 - -源可能存在问题,如设置淘宝的源,就需要删除registry使用默认的 - +npm install --registry=https://registry.npm.taobao.org 指定淘宝源的安装 +// 清理 +npm config get cache // 缓存路径 npm cache clean --force npm config list -npm install -ddd 查看安装细节卡住哪里 - - -# [pnpm](https://pnpm.io/) - -```javascript -pnpm i // 按照依赖 -pnpm add libName --save // 按照库 ``` -[配置Configuring](https://pnpm.io/configuring) -因为是portable版的vscode?就容易出错? +## [pnpm](https://pnpm.io/) + ```js -pnpm // 回显用法 +pnpm i // 安装依赖 +pnpm add libName --save // 按照库 pnpm store status // 会出现问题, -pnpm store prune // 删除有问题的 -pnpm i // 重新按照 +pnpm store path // 缓存路径 +pnpm store prune // 删除缓存 ``` -# [Yarn is a package manager](https://yarnpkg.com/) +## [Yarn is a package manager](https://yarnpkg.com/) + +- [yarn add](https://classic.yarnpkg.com/en/docs/cli/add) + ```js yarn install +yarn install --registry https://registry.npm.taobao.org +// 清除缓存 +yarn cache dir // 查看路径 +yarn cache clean // 清理 +// 镜像设置 +yarn config get registry +yarn config set registry https://registry.npmmirror.com +yarn config set registry https://registry.yarnpkg.com +yarn config delete registry +// 安装库时指定镜像位置 +yarn add libraryName -W --registry https://registry.npm.taobao.org ``` -# 打包工具 - ## [Rollup](https://rollupjs.org/introduction/) ## [webpack](https://www.webpackjs.com/) + +## 相关库 + +### [nrm切缘源的工具](https://github.com/Pana/nrm) + +### [nvm-windows](https://github.com/coreybutler/nvm-windows/releases) + +[windows安装nvm的两种方式](https://www.jianshu.com/p/1d80cf35abd2)参考了noinstall的方式,还是会报错 +执行nvm root f:/dev/nvm就可以安装了 +- 右键以管理员的身份运行install.cmd, 会提示设置目录 +- NVM_HOME, NVM_SYMLINK,PATH:%NVM_HOME%;%NVM_SYMLINK% 环境变量的设置 + +### sharp +```js +yarn config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp" +yarn config set sharp_libvips_host "https://npm.taobao.org/mirrors/sharp-libvips" +```