Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wenerme committed Nov 3, 2023
1 parent 6b3f8ff commit b867001
Show file tree
Hide file tree
Showing 71 changed files with 1,424 additions and 327 deletions.
10 changes: 5 additions & 5 deletions notes/ai/ai-awesome.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ tags:
- https://anonymous-31415926.github.io/
- 发现
- https://www.theaivalley.com/
- [ShishirPatil/gorilla](https://github.com/ShishirPatil/gorilla)

## Coding

Expand All @@ -75,6 +76,7 @@ tags:
- https://www.promptingguide.ai/zh/readings
- https://jalammar.github.io/
- https://karpathy.ai/zero-to-hero.html
- https://github.com/premAI-io/state-of-open-source-ai

## Prompt

Expand Down Expand Up @@ -138,8 +140,8 @@ tags:
- [clue-ai/PromptCLUE](https://github.com/clue-ai/PromptCLUE)
- [clue-ai/ChatYuan](https://github.com/clue-ai/ChatYuan)
- [cocktailpeanut/dalai](https://github.com/cocktailpeanut/dalai)
- [belladoreai/llama-tokenizer-js](https://github.com/belladoreai/llama-tokenizer-js)
- https://github.com/cogentapps/chat-with-gpt/blob/main/app/src/core/tokenizer/bpe.ts
- [belladoreai/llama-tokenizer-js](https://github.com/belladoreai/llama-tokenizer-js)
- https://github.com/cogentapps/chat-with-gpt/blob/main/app/src/core/tokenizer/bpe.ts
- https://github.com/dqbd/tiktoken
- https://github.com/functorism/gpt4-tokenizer-visualizer
- [run-llama/llama_index](https://github.com/run-llama/llama_index)
Expand Down Expand Up @@ -180,7 +182,6 @@ tags:
- [allenai/RL4LMs](https://github.com/allenai/RL4LMs)
- [lucidrains/PaLM-rlhf-pytorch](https://github.com/lucidrains/PaLM-rlhf-pytorch)


## Bot

- [ConnectAI-E/Feishu-OpenAI](https://github.com/ConnectAI-E/Feishu-OpenAI)
Expand All @@ -195,7 +196,7 @@ tags:
- im:chat,im:chat:readonly
- https://github.com/zhayujie/bot-on-anything
- [chathub-dev/chathub](https://github.com/chathub-dev/chathub)
- All-in-one chatbot client
- All-in-one chatbot client

## Misc

Expand All @@ -219,4 +220,3 @@ tags:
- NodeJS
- [erelsgl/limdu](https://github.com/erelsgl/limdu)
- https://github.com/a16z-infra/ai-getting-started

12 changes: 12 additions & 0 deletions notes/ai/claude.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: claude
---

# claude

> Anthropic
- 160.79.104.0/23, 2607:6bc0::/48
- https://docs.anthropic.com/claude/reference/ip-address-allowlisting
- https://www.anthropic.com/earlyaccess
- https://console.anthropic.com/
9 changes: 9 additions & 0 deletions notes/ai/model-awesome.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ tags:
- [ymcui/Chinese-LLaMA-Alpaca](https://github.com/ymcui/Chinese-LLaMA-Alpaca)
- https://www.promptingguide.ai/zh/models/collection
- [Releasing 3B and 7B RedPajama-INCITE family of models including base, instruction-tuned & chat models](https://www.together.xyz/blog/redpajama-models-v1)
- RedPajama-Data-v2
- https://together.ai/blog/redpajama-data-v2
- https://github.com/togethercomputer/RedPajama-Data
- https://huggingface.co/datasets/togethercomputer/RedPajama-Data-V2
- en, de, fr, es, it
- [hysts/ControlNet-v1-1](https://huggingface.co/spaces/hysts/ControlNet-v1-1)
- ggml
- [ggerganov/ggml](https://github.com/ggerganov/ggml)
Expand All @@ -52,6 +57,10 @@ tags:
- https://erichartford.com/uncensored-models
- https://huggingface.co/spaces/facebook/seamless_m4t
- https://github.com/LinkSoul-AI/Chinese-Llama-2-7b
- Jina AI 8k text embedding
- https://news.ycombinator.com/item?id=38020109
- https://huggingface.co/jinaai/jina-embeddings-v2-base-en
- https://huggingface.co/jinaai/jina-embeddings-v2-small-en

```bash
# AVX = 1 | AVX2 = 0 | AVX512 = 0 | FMA = 0 | NEON = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 1 | VSX = 0 |
Expand Down
5 changes: 5 additions & 0 deletions notes/ai/prompt-awesome.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ tags:
- https://arxiv.org/abs/2302.14045
Language Is Not All You Need: Aligning Perception with Language Models
- https://help.openai.com/en/collections/3675942-prompt-engineering

---

- DALL·E
- https://twitter.com/dr_cintas/status/1717896142044676356
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ https://www.game-game.com.ua/
| Roguelike |
| Roguelite |

- https://store.epicgames.com/en-US/free-games

## Nitendo Switch

> SW-1452-6543-9033
Expand Down
15 changes: 15 additions & 0 deletions notes/culture/tv/tv-awesome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
tags:
- Awesome
---

# TV Awesome

## To Be Watched

- Gen V
- R&M S7
- The Mandalorian Season 4
- Loki Season 2
- Severance Season 2
- 万神殿 第二季 Pantheon Season 2
65 changes: 45 additions & 20 deletions notes/db/design-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,42 @@ 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 | 内部扩展数据 - 客户端 不可见 |
| column | for |
| ------------- | -------------------------------------------------------- |
| id | 主键 - ULID, tagged ID |
| sid | 租户维度单调递增 - 用户友好 |
| uid | UUID |
| 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 | 内部扩展数据 - 客户端 不可见 |
| owner_id | 所有者 |
| owner_type | User, Team, Department, Organization |
| owner_user_id | `case owner_type when 'User' then owner_id end` |
| owner_team_id | `case owner_type when 'Team' then owner_id end` |
| entity_id | 关联任意实体 |
| entity_type |
| created_by_id |
| updated_by_id |
| deleted_by_id |
| state | 状态 - 面向系统,不可自定义 |
| status | 业务状态、阶段、原因、细节 - 可自定义 |

- eid
- 同质系统导入外建关联 - 例如: SaaS <-> 现存内部系统
- 也可能会导出再导入
- cid & rid
- 非同质系统 - 例如: 服务商、平台
- -> sourceType+sourceId
- -> vendorType+vendorId

```sql
create table tpl_res
Expand All @@ -162,8 +182,10 @@ create table tpl_res
owner_id text,
owner_type text,
owner_uid uuid,
owner_user_id text,
owner_team_id text,
owner_id text,
owner_type text, -- User, Team, Department
owner_user_id text generated always as ( case owner_type when 'User' then owner_id end ) stored,
owner_team_id text generated always as ( case owner_type when 'Team' then owner_id end ) stored,
owner_department_id text,
primary key (tid, id),
unique (tid, sid),
Expand Down Expand Up @@ -237,12 +259,12 @@ select set_config('tenant.id','1', true);

## created_at vs create_time

- created_at
- created_at, `*_at`
- 语义 准确
-`created_by_id` 形式上类似
- 使用: Spring, Gorm 默认
- 面向 **系统**
- create_time
- create_time, `*_time`
- 使用: AIP
- 面向 **用户**, 业务

Expand All @@ -256,6 +278,9 @@ select set_config('tenant.id','1', true);
- 前端使用,服务端可见
- metadata
- 对数据内容的补充说明
- raw
- 外部导入原始数据
- 也可以记录到 metadata, properties.raw, extensions.raw

## 单数还是复数表名

Expand Down
26 changes: 26 additions & 0 deletions notes/db/relational/postgresql/postgresql-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,32 @@ tags:
- 最多 32767 参数占位 - `?` - 范围为 smallint
- https://www.postgresql.org/docs/current/limits.html

## unique constraint vs unique index

> 核心业务语义尽量用 constraint
- unique constraint
- `unique(tid,entity_id)` -> `flow_tid_entity_id_key`
- 可以延后
- 通过 unique index 实现 - 自动创建
- 附带在 TABLE 上
- `unique` 在 create table 时定义
- `alter table TABLE add unique (tid,rid,cid);` 在 create table 之后定义
- 不支持 `ADD CONSTRAINT IF NOT EXISTS`
- 支持 `DROP CONSTRAINT IF EXISTS`
- unique index
- `create unique index on flow(tid,entity_id)` -> `flow_tid_entity_id_idx`
- 可以并发
- 可以 带条件
- 独立 INDEX 概念
- 不能在 create table 时定义 - inline index 概念
- UNIQUE 只是 INDEX 的一个限制
- https://stackoverflow.com/a/6804058/1870054
- add constraint if not exists
- https://stackoverflow.com/questions/23542794
- 都支持 UNIQUE NULLS NOT DISTINCT
- 因为是 INDEX 的能力

## TOAST

- TOAST = The Oversized-Attribute Storage Technique
Expand Down
11 changes: 11 additions & 0 deletions notes/db/relational/postgresql/postgresql-sql-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ tags:
- [JSON Functions and Operators](https://www.postgresql.org/docs/current/functions-json.html)
- `PRIMARY KEY` ~= `UNIQUE` + `NOT NULL`
- FK
- **MATCH SIMPLE**
- MATCH FULL
- 都不 null,或都 null
- ~~MATCH PARTIAL~~
- CONSTRAINTS
- DEFERRED | IMMEDIATE
- 创建时
- DEFERRABLE INITIALLY DEFERRED
- DEFERRABLE INITIALLY IMMEDIATE
- NOT DEFERRABLE

## XML xpath 返回结果包含 CDATA

Expand Down
Loading

0 comments on commit b867001

Please sign in to comment.