Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj01 committed Feb 29, 2024
1 parent 7113254 commit dcb085c
Show file tree
Hide file tree
Showing 17 changed files with 200 additions and 105 deletions.
28 changes: 28 additions & 0 deletions articles/2023/smile.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,34 @@ y轴方向上的调整,

使用二次曲线来拟合切缘曲线

## 问题

### 至2024-2-26

1、颜色更新的问题,原因是流程错误,多次叠加了处理的结果,精简了单次更改结果
2、去掉之前处理阴影的流程逻辑,把不必要的流程删除,ai返回的数据直接映射到原图上,
A、从我的手机上测试流畅度现在比较顺滑,颜色值的变化现在只有在一开始改变时有点突兀
B、色调、亮度、饱和度的调整范围要更新,与网页应该有差异
3、修复了UI的双向交互问题,滑动过程中有些没有反应,表现出来给人就是卡的问题,(后面ui更新这方面可能需要花时间)


### 至2024-2-22目前的开发问题
我总结了一下开发中要面临的问题:
目前的形式是微信小程序,但自2023年微信小程序更新后,出现了很多问题,特别是渲染与性能问题,还存在Android和iOS不一致的情况,微信开发社区反馈很多,有线上运营的都出现这种问题,导致不能使用。


对我们的影响就是渲染,涉及两点
1、iOS没有渲染出图片,这个可以改用图片来显示,但在颜色更新时会面临更大的挑战和不确定性。
2、颜色更新的问题,这个涉及到小程序内部的机制(为了跨平台与体验一致性,有一套逻辑像素与物理像素的映射,引入的一个尺寸单位rpx(responsive pixel)机制,导致更新颜色值产生了与接口描述不一致的情况,目前反馈的是不一定修复)。
上面微信小程序出现的问题,微信修复进度很难控制,这些修复改善的地方都是性能瓶颈之处,很难及时更新。
微信小程序的跨平台,在选着App时也面临选着:App开发选着的技术路线也有两套
1、一套就是还是以web技术方案,多跨平台,如Flutter等,可能会提供类似web的接口,但这种性能与微信可能出现同样的问题。
2、另一套就是使用原生的技术,技术上限制最少,比如可以使用opencv等库,但因为是native开发,多使用C++开发,除了核心功能使用第三方库以外,需要自己维护和编写很多,工作量很大
考虑独立的App的额外开销还有:
1、iOS的开发需要苹果的账号,分个人、公司、企业。账号的费用是个人与公司-99美元/年,可以上AppStore,企业-299美元/年。需要苹果电脑
2、Android的开发的app,需要维护不同品牌手机的应用商店,比如华为应用商店、小米应用商店。


## 参考

- 口腔固定修复中的美学重建 第1卷
Expand Down
9 changes: 9 additions & 0 deletions articles/2024/app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 技术方案

## CEF与Electron

[github CEF](https://github.com/chromiumembedded/cef)
[Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.](https://bitbucket.org/chromiumembedded/workspace/projects/CEF)
CEF面向会使用C++和JS、HTML、CSS的,是对Chromium做了精简和封装,允许开发者通过C++控制chromium核心,与Javascript交互,但其他都需要开发者自己处理

Electron面向纯前端开发者
16 changes: 9 additions & 7 deletions articles/2024/trend.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# 趋势

## platform

- IaaS, Infrastructure as a service
- PaaS, Platform as a service
- SaaS, Software as a service
- IQaaS, Intelligence as a service

## AI

美国作家Clifford Stoll的一句话,曾很好地概括了这一点,也可以回应你的这个问题,他曾说过:“数据不是知识。知识不是智慧。智慧不一定是聪明”。
Expand All @@ -15,6 +8,15 @@ AI不能产生知识或智慧,大数据只是一个数据处理得过程,得

国外的研究在于解决人的身体缺陷,而资本在运作概念。

### 2024-2-16
Sora是OpenAI推出的一个diffusion model,生成视频的工具,非常令人震撼,让国内一批人在那里忽悠。

这件事说明了AI在基础上中美的差异之大,比想象中的还要大。

David Gu 顾险峰写了一篇文章《Sora物理悖谬的几何解释》基本解释了一下,从中可以看到在数学家眼中的详细,不必吃惊!
> 摘自一段话:自然界的绝大多数物理过程都是稳恒态与临界态的交替变化。在稳恒态中,系统参数缓慢变化,容易获取观察数据;在临界态中(灾变态),系统骤然突变,令人猝不及防,很难抓拍到观察数据。因此,临界态的数据样本非常稀少,几乎在训练集中零测度。由此,Sora系统学习到的数据流形,绝大多数都是由稳恒态的样本所构成。物理过程中的临界态样本多分布在数据流形的边界。因此,在生成过程中,Sora非常容易生成稳恒态的视频片段,但是往往跳过临界态。但是在人类认知中,最为关键的观察恰恰是概率几乎为零的临界态。
上面的描述加上对图像处理的理解,现在越来越感受到那种临界状态的问题!即使完成大部分内容,但是在这种情况下也会导致越来越差的效果,就是那个临界状态。

## 参考

Expand Down
7 changes: 6 additions & 1 deletion books/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
## reading
- [Learn OpenGL](../books/Learn%20OpenGL.md)
- [vulkan tutorial](https://vulkan-tutorial.com/)
- [Performance Analysis and Tuning on Modern CPUs 2023]()
- 3
- [Effective Debugging中文翻译](https://celthi.github.io/effective-debugging-zh/)
- 引言

## readed
- [软件设计-从专业到卓越](../books/%E8%BD%AF%E4%BB%B6%E8%AE%BE%E8%AE%A1-%E4%BB%8E%E4%B8%93%E4%B8%9A%E5%88%B0%E5%8D%93%E8%B6%8A.md)
Expand All @@ -19,4 +23,5 @@
## github resource

- [A collection of academic papers, articles, and other resources that I plan to read or have read. ](https://github.com/jeffrey-xiao/papers/tree/master)
- [Modern Robotics: Mechanics, Planning, and Control现代机器人学:机构、规划与控制](http://hades.mech.northwestern.edu/index.php/Modern_Robotics)
- [Modern Robotics: Mechanics, Planning, and Control现代机器人学:机构、规划与控制](http://hades.mech.northwestern.edu/index.php/Modern_Robotics)

2 changes: 1 addition & 1 deletion cg/image/algorithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

## 颜色转换

- [Change color lightness](https://www.30secondsofcode.org/js/s/change-lightness/)
- [Change color lightness](https://www.30secondsofcode.org/js/s/change-lightness/)
7 changes: 7 additions & 0 deletions cg/image/tool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Image Tool

## [wsrv.nl](https://images.weserv.nl/)
An image cache & resize service. Manipulate images on-the-fly with a worldwide cache.
据说速度很快
- [Source code of wsrv.nl (formerly images.weserv.nl), to be used on your own server(s). ](https://github.com/weserv/images)
- [A fast image processing library with low memory needs. ](https://github.com/libvips/libvips)
1 change: 1 addition & 0 deletions cg/shader.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,6 @@ mat3(
- [A reusable GLSL directional light function ](https://github.com/hughsk/glsl-directional-light)

- [The Book of Shaders by Patricio Gonzalez Vivo & Jen Lowe ](https://thebookofshaders.com/00/)
- Introduction
- [OpenGL 图元处理,一些关于OpenGL的概念](https://www.jianshu.com/p/3d974e69f842)
- [Learning practice demo for examples in OpenGL Super Bible 6th ](https://github.com/StarryThrone/OpenGL-SBible-example-code)
130 changes: 69 additions & 61 deletions dev-note/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
[官方文档](https://git-scm.com/docs)
[中文官方文档](https://git-scm.com/book/zh/v2)
[A successful Git branching model](https://nvie.com/posts/a-successful-git-branching-model/)
- 未读完
## 概念
- 补丁,即git diff生成的内容
- commit,提交内容
- version,版本

## 常用命令

Expand All @@ -18,12 +23,6 @@
- git push 远程的remote_branch存在且关联local_branch,把local_branch推送到remote_branch
- git push -u origin/remote_branch 远程有分支但未关联本地分支
- git push origin local_branch:remote_branch 远程remote_branch不存在
- 删除修改
- git reset --hard origin/master 强制用服务器覆盖本地的修改
- git rebase 已服务器远程仓库为基准
- git rm --cached file.ext 删除file.ext的跟踪, 并保留本地的
- git rm -f file.ext 删除跟踪,并删除本地文件
- git reset --hard xxxx // 退回到那个版本
- git pull origin main --allow-unrelated-histories //历史记录不一样

### submodule
Expand All @@ -33,12 +32,6 @@
- git submodule update更新子模块 // 切换分支后就需要执行它
- git submodule foreach git pull拉取所有的子模块
- git submodule sync
- git rm --cached modulename删除子模块

子模块删除
- 删除.gitsubmodule里的那一部分
- 删除.git/config文件的相关字段
- 删除子模块的目录

### branch
分支
Expand All @@ -57,41 +50,6 @@
- git rm -rf . // 删除当前目录下的文件
- 添加新的文件

### merge合并
- git cherry-pick <commit-id> 合并某个commit,只能在本地操作,本地分支要有这个commit记录才可以合并
- git checkout -p(--patch) origin/A filename.ext 把A(本地或远程)分支的某个文件合并到现在分支。
存在差异时有如下的缩写字母命令
y - apply this hunk to index and worktree # 应用当前hook,把A分支的东西应用到当前分支
n - do not apply this hunk to index and worktree # 放弃当前hook,放弃A分支的,用当前分支的。
q - quit; do not apply this hunk or any of the remaining ones # 不使用任何hook,直接退出
a - apply this hunk and all later hunks in the file # 在当前文件下应用此hook以及后续的所有hook
d - do not apply this hunk or any of the later hunks in the file # 在当前文件下不应用此hook以及后续的所有hook
g - select a hunk to go to # 选择一个hook
/ - search for a hunk matching the given regex # 使用正则搜索hook
j - leave this hunk undecided, see next undecided hunk # 先跳过当前hook,并跳转到下一个未处理hook
J - leave this hunk undecided, see next hunk # 先跳过当前hook,并跳转到下一个hook
k - leave this hunk undecided, see previous undecided hunk # 先跳过当前hook,并跳转到上一个未处理hook
K - leave this hunk undecided, see previous hunk # 先跳过当前hook,并跳转到上一个hook
s - split the current hunk into smaller hunks # 切割当前hook
e - manually edit the current hunk # 编辑当前hook
? - print help # 显示帮助信息

### 回滚

```shell
git checkout branch-with-history 切换到带有历史记录的分支中
git checkout -b XXX 新建本地分支XXX
git reset --hard commit-id 回滚分支XXX上的某个提交点
```
此时代码就是某个提交点的,就可以修改了

- git reset --hard彻底回退到某个版本,同时回退暂存区和版本库和工作区
- git reset --soft回退到某个版本,只回退到暂存区
- git reset --mixed默认不带参,只回退暂存区和本地版本库

### 打包

- git archive --format zip --output path/zipfile.zip branch-name

### [stash](https://www.git-scm.com/docs/git-stash)

Expand Down Expand Up @@ -172,22 +130,72 @@ pox.xml merge=ours
3. /mtk/do.c 过滤指定文件
4. !/mtk/one.txt 添加指定文件

## 回滚

## 其他
```shell
git checkout branch-with-history 切换到带有历史记录的分支中
git checkout -b XXX 新建本地分支XXX
git reset --hard commit-id 回滚分支XXX上的某个提交点
```
此时代码就是某个提交点的,就可以修改了

- git reset --hard彻底回退到某个版本,同时回退暂存区和版本库和工作区
- git reset --soft回退到某个版本,只回退到暂存区
- git reset --mixed默认不带参,只回退暂存区和本地版本库
- git reset --hard origin/master 强制用服务器覆盖本地的修改
- git reset --hard xxxx // 退回到那个版本
- git rebase 以服务器远程仓库为基准

## 删除
- git rm --cached file.ext 删除file.ext的跟踪, 并保留本地的
- git rm -f file.ext 删除跟踪,并删除本地文件
- git rm --cached modulename 删除子模块

### 错误
子模块删除
- 删除.gitsubmodule里的那一部分
- 删除.git/config文件的相关字段
- 删除子模块的目录

error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
## 合并

通过设置来解决
git config --global http.postBuffer 524288000
上面没有解决时,换个思路
git clone url_repository --depth 1
cd url_repository
git fetch --unshallow
或者不用HTTP
https://改成git://
- git cherry-pick <commit-id> 合并某个commit,只能在本地操作,本地分支要有这个commit记录才可以合并
- git checkout -p(--patch) origin/A filename.ext 把A(本地或远程)分支的某个文件合并到现在分支。

存在差异时有如下的缩写字母命令
y - apply this hunk to index and worktree # 应用当前hook,把A分支的东西应用到当前分支
n - do not apply this hunk to index and worktree # 放弃当前hook,放弃A分支的,用当前分支的。
q - quit; do not apply this hunk or any of the remaining ones # 不使用任何hook,直接退出
a - apply this hunk and all later hunks in the file # 在当前文件下应用此hook以及后续的所有hook
d - do not apply this hunk or any of the later hunks in the file # 在当前文件下不应用此hook以及后续的所有hook
g - select a hunk to go to # 选择一个hook
/ - search for a hunk matching the given regex # 使用正则搜索hook
j - leave this hunk undecided, see next undecided hunk # 先跳过当前hook,并跳转到下一个未处理hook
J - leave this hunk undecided, see next hunk # 先跳过当前hook,并跳转到下一个hook
k - leave this hunk undecided, see previous undecided hunk # 先跳过当前hook,并跳转到上一个未处理hook
K - leave this hunk undecided, see previous hunk # 先跳过当前hook,并跳转到上一个hook
s - split the current hunk into smaller hunks # 切割当前hook
e - manually edit the current hunk # 编辑当前hook
? - print help # 显示帮助信息

### 迁移
cherry-pick对子目录不太友好,会改变目录结构,迁移时更多选择
- git apply 可应用补丁,不创建commit,提交前测试git diff(即补丁),也可将构建前将补丁应用到第三方库
- git am 可应用补丁,要创建commit,适用于协作和接收他人的贡献代码,从邮件或git format-patch生成文件中应用补丁

- git diff > changes.patch 补丁信息
- git diff commit1 commit2 比较两个提交的差异
- git format-patch -1 --stdout > changes.patch 获取最新commit生成patch补丁
- git format-patch <start_commit>..<end_commit> 两个提交之间的补丁
- git format-patch <start_commit>..<end_commit> --stdout > changes.patch 多个补丁合并成一个补丁

开启-3或--3way,有冲突时可以查看diff信息, --directory通过指定目录来迁移,比cherry-pick更友好

- git apply --3way --directory=extension changes.patch
- git am --3way --directory=extensioin changes.patch




## 打包

- git archive --format zip --output path/zipfile.zip branch-name
5 changes: 5 additions & 0 deletions index/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Architecture

- IaaS, Infrastructure as a service
- PaaS, Platform as a service
- SaaS, Software as a service
- IQaaS, Intelligence as a service

### Actor

- [CAF is an open source implementation of the actor model for C++ featuring lightweight & fast actor implementations, pattern matching for messages, network transparent messaging, and more.](https://www.actor-framework.org/)
Expand Down
2 changes: 2 additions & 0 deletions index/online.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
- [A Graphics Guy's Note](https://agraphicsguynotes.com/posts/)
- [figma的博客,有关figma实现的一些思路和总结,值得借鉴](https://www.figma.com/blog/)

- [Denis Bakhvalov, 关于性能优化的一个博客](https://easyperf.net/)
- [SaschaWillems,业余贡献实时3D以Khronos标准软件开发者](https://www.saschawillems.de/)

## 工具

Expand Down
1 change: 1 addition & 0 deletions index/standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

## Images

- [图片处理工具-库,程序](../cg/image/tool.md)
- [颜色](../cg/Color.md)
- [图像相关的算法](../cg/image/algorithm.md)
- [图像格式](../others/images.md)
Expand Down
13 changes: 13 additions & 0 deletions web/browser.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Browser
> 浏览器
浏览器的两大核心是
- 渲染引擎,即内核,负责对网页语法的解释并渲染成网页内容、排版等
- JS引擎,是执行在一个线程里,不像其他语言那样多线程并可阻塞主线程,而是通过事件机制来解决。
- JS线程、工作线程、渲染线程之间的通信机制叫做事件循环EventLoop,其一是Call Stack宏任务,其一是Task Queue微任务,其执行流程是:
- 工作线程完成异步任务,会把消息(注册时的回调函数)推到Task Queue中
- 当Call Stack为空时,主线程从Task Queue取消息放入Call Stack来执行
- 主线程一直重复前两步的逻辑直到消息队列为空

[WebKit is the web browser engine used by Safari, Mail, App Store, and many other apps on macOS, iOS, and Linux. ](https://webkit.org/)发展一个分支,支撑了现代浏览器的大部分功能,
chrome是Webkit的分支发展的,后来由于沙箱设计上产生冲突,逐渐发展成了Blink内核,脱离了Webkit。


## 认证与登录

Expand Down
8 changes: 8 additions & 0 deletions web/css.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@ div {
}
```

### Color颜色

渐变色,linear-gradient创建一个对象gradient,是一种特别的image,就像使用canvas直接生成一个色条一样,不能使用到color对象上

```css
border-image: linear-gradient(90deg, #B3ADD3 0%, #96BED7 21%, #EB9582 41%, #C3C68C 62%, #FAACAC 81%, #FED09F 99%) 1;
```

## Tools

### WebAIM:web accessibility in mind
Expand Down
35 changes: 35 additions & 0 deletions web/i18n.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 多语言
> i18n是国际化的英文为 internationalization,为了方便,通常会简写为 i18n(开头的 i、中间的 18 个字符、末尾的 n)
分三类信息,
- message,文本的替换
- date time format,时间日期的格式
- number,数字格式,货币形式等

但难点还是很多的:
- 多语言的没有标准,使用起来就存在各种兼容的问题,如中文有zh,zh_CN等来区分中文, 可参考BCP 47,全称为Best Current Practice for Tags for the Identification of Languages,是一个基于RFC 5646标准的语言标签格式的建议标准。
- 多语言还是影响视觉设计,开发时就需要考虑这些问题,不同语言的表述会导致字符的长度差异较大
- 语言的字段是复用还是语义化,都是一个难点,随着需求的变化可能会有很大的影响
- 符合用户习惯与不同文化的需求


## web

**vue**

把i18n实列对象放入Vue的实例中,通过this.$i18n.locale='zh'来设置对应的语言

也可以存储在store或cookie中,

但对惰性组件,如echarts这类需要重新渲染的,就需要手动处理了,方法有:
- 利用watch监听locale字段是否发现变化,主动调用重新渲染
- locale变化时直接this.reload强制刷新页面

```js
new Vuei81n({
locale:'',
messages: {}, // $t(path)
numberFormats: {}, // $n()
dateTimeFormats: {}, // $d()
})
```
2 changes: 1 addition & 1 deletion web/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- [typescript](./typescript.md)
- [bable](./babel.md)
- [vue](./vue.md)
- [多语言i18n](./language.md)
- [多语言i18n](./i18n.md)

## library

Expand Down
Loading

0 comments on commit dcb085c

Please sign in to comment.