Skip to content

Commit

Permalink
update nextra
Browse files Browse the repository at this point in the history
  • Loading branch information
wenerme committed Oct 16, 2023
1 parent 7f8915b commit 07ebf9d
Show file tree
Hide file tree
Showing 31 changed files with 1,448 additions and 33 deletions.
6 changes: 6 additions & 0 deletions notes/ai/ai-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ tags:
- DL 是实现 ML 的方式之一
- Algorithms
- 通用的概念

## RAG

- RAQ - retrieval-augmented generation - 检索增强生成
- 参考
- https://research.ibm.com/blog/retrieval-augmented-generation-RAG
19 changes: 18 additions & 1 deletion notes/db/design-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tags:
- timestamp 41bits + instance 10bits + sequence 12bits
- sequence - 4096 个 - 正常 1ms 内达到了会递增 timestamp - **需要维护全局状态**
- 69 years
- timestamp 通过 offset 调整 - e.g `(2023-1970)*31536000*1000`
- timestamp 通过 offset 调整 - e.g `(2023-1970)*31536000*1000`
- instance - Machine ID
- 注意选择,通常使用 IP/Hostname/Mac
- AmazonEC2MachineID
Expand Down Expand Up @@ -120,6 +120,23 @@ a-1-b-0
> - 元数据不要用于业务依赖
> - 可以创建模板表然后 CREATE TABLE LIKE
| column | for |
| ---------- | -------------------------------------------------------- |
| id | 主键 |
| sid | 租户维度单调递增 - 用户友好 |
| tid | 租户 ID |
| eid | 用于导入数据关联 - tid+eid 唯一 |
| cid | 外部系统租户 ID - Colocate ID/Corp ID - tid+cid+rid 唯一 |
| rid | 外部系统资源 ID - Ref ID/Relative ID |
| created_at |
| updated_at |
| deleted_at |
| version | 基于版本的乐观锁 |
| metadata | 补充数据 |
| attributes | 使用端自定义数据 - 客户端 读写 |
| properties | 服务端自定义数据 - 客户端 只读 |
| extensions | 内部扩展数据 - 客户端 不可见 |

```sql
create table tpl_res
(
Expand Down
18 changes: 17 additions & 1 deletion notes/dev/design/design-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ title: Auth
- Bearer RFC6750
- PAT - Persional Access Token
- Bearer - Opaque 的内容
- JWT 对 Token 内容做第一
- JWT 对 Token 内容做定义
- ACL
- Subject, Object, Action, Condition, Effect, Priority
- 参考
- [Swagger Aith](https://swagger.io/docs/specification/authentication/)

Expand Down Expand Up @@ -65,3 +67,17 @@ OpenAI-Organization: $ORG_ID
- client_id + client_secret
- grant=client_credential -> AccessToken
- 可以获取用户相关的 AccessToken

## Principal vs Subject

- Subject - 访问主体 - 请求访问对象或者执行操作的发起方
- 通用概念 - 更抽象
- 主动发起
- 当前状态
- 使用场景: ACL, 临时授权, 主体隔离, 代理访问, 会话管理, 审计跟踪
- 常见主体: User, Department, Customer, Process, Group, Service Account, System, Device
- Principal - 明确身份
- 是一个验证过的身份,通常是一个指定的用户 - 更具体
- 被动绑定
- 持久标识
- 使用场景: 认证, 授权, 跟踪审计, 身份隔离, 权限委托, 资源归属, 责任追究, 长会话
49 changes: 49 additions & 0 deletions notes/dev/design/design-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,52 @@ title: Workflow design
- argo workflow
- n8n
- nodered
- Dynamic 365 Customer Engagement
- Workflow=[Process](https://learn.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/entities/workflow)
- 基于实体事件创建流程
- PrimaryEntity - 触发的实体类型
- 不同事件的开始阶段
- CreateStage
- DeleteStage
- UpdateStage
- FormId - 可关联一个 Form
- [NewProcess](https://learn.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/entities/newprocess?view=op-9-1)
- 流程实例
- ActiveStageId - 当前阶段
- ActiveStageStartedOn - 开始时间
- CompletedOn
- State=Active/Inactive
- Status=Active/Finished/Aborted
- [ProcessStage](https://learn.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/entities/processstage?view=op-9-1)
- StageCategory - Qualify, Develop, Propose, Close, Identify, Research, Resolve, Approval
- 分类是固定的,不支持任意流程
- StageName
- ClientData
- 所有相关实体上有 StageId 字段反向关联 ProcessStage
- lead, products, campaing, opportunity, quote, salesorder, invoice, contract, case, knowledgearticle

## Workflow vs Flow

- workflow
- 着重预定义流程
- 图形化设计
- 通常在一个系统内部执行
- 由内部事件触发
- 使用更广泛
- flow
- 更强调动态自由流程
- 可以通过低代码实现
- 可以跨多个系统和服务
- 可以通过外部服务触发
- 出现时间更晚

## Stage vs Step

- Step
- 更加细粒度,强调组成部分
- 顺序执行
- Stage
- 可能包含多个 Step
- 不一定顺序执行
- 比如 CI 里有多个 Stage - Build、Test、Deploy
- 比如销售里有多个阶段 - Qualify, Develop, Propose, Close, Identify
9 changes: 9 additions & 0 deletions notes/dev/editor/jetbrain.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,12 @@ sharedIndex:
- 显示使用情况
- 占用更多 CPU
- https://www.jetbrains.com/help/rider/Code_Vision.html
## Cannot connect to already running IDE instance. Exception: Process 621 is still running
```bash
ls "$HOME/Library/Application Support/JetBrains/IntelliJIdea2023.2"

ls $HOME/Library/Application\ Support/JetBrains/*/.lock
rm $HOME/Library/Application\ Support/JetBrains/*/.lock
```
Loading

0 comments on commit 07ebf9d

Please sign in to comment.