编码
-
codec.编码 encode/decode encoding.字符编码 Marshal
- bit->int->string(Unicode/charset)->protocol/DataFormat/morse.摩斯码
bin.二进制.可执行文件 原码.反码.补码
n&0xffffffff
-
bit.bool 数据完整性.单比特翻转.flip ECC内存 奇偶校验.校验位.CRC.
Cyclic_redundancy_check
纠错码.海明码.海明距离.hammingDistance.Erasure_code
- bit: 8-256 10-1024 16-65536-port 32-42亿-溢出 64-太阳寿命100亿 tinyint smallint mediumint bigint
-
int/integer: base.进制
INI_MAX/INI_MIN
unsigned/溢出 可读性1_000
结尾100L
进制0X0F 0b 0 0x
oct.hex- math: bit.位运算 GMP.任意长度 BCMath.任意精度 rand
float.浮点数 double decimal.precision精度
-
string: case.upper/lower 转义字符
\
EOF.heredoc nowdoc fuzzy regex f-string t-string- fmt.printf格式
%ns %ni %m.nf
strings.TrimSpace(" 123 \t\n\v\r")
- fmt.printf格式
charset.字符集 乱码
Protocol.协议
-
DataFormat.数据格式: JSON/YAML/TOML/ini/xml/html/csv/markdown
- base64.二进制数据安全: bit2byte
- url
%22%3A
MIME: word/ppt/excel/pdf/image/video
Code: The Hidden Language of Computer Hardware and Software 编码 隐匿在计算机软硬件背后的语言上 2012.10 2019.6
float
-
https://www.h-schmidt.net/FloatConverter/IEEE754.html 加法和精度损失.Kahan_summation_algorithm
e | f | s | float |
---|---|---|---|
0 | 0 | 0/1 | 0 |
0 | !=0 | 0/1 | 0.f |
255 | 0 | 0 | INI_MAX |
255 | 0 | 1 | INI_MIN |
255 | !=0 | 0/1 | NAN |
byte
- byte.字节 byte=uint8
- byteOrder.字节序: 168496141 = 0x0A0B0C0D.大端序.网络序 = 0x0D0C0B0A.小端序.机器序
charset
- ASCII: 换行符.lineSeparator.lineEnd 空白符.whiteSpace
- A.chr ascii.ord.65
- ASICII -> GB2312 6k常用汉字 -> GBK 2w汉字.人名/少数民族姓名/繁体字/日语/朝鲜语 -> GB18030-2000/2005 7w汉字.中日韩汉字+少数民族文字
- big5.台湾
- unicode.org
- rune=int32=utf32=ucs4(32bit=\Uhhhhhhhh)
- utf16(16bit=\uhhhh)
- utf8=1-4byte=
1110xxxx 10xxxxxx 10xxxxxx 0xxxxxxx
=\xhh\xhh - unicode.0x41.\x41.\u0041.U+0041
- BOM.byteOrderMark utf16le utf16be \xff\xfe.zeroWidthNoBreakSpace
- 三明治建议: in.解码.bytes>str 计算.str out.编码.str>bytes
TOML
a = "a"
b = "b"
c.x = "c.x"
c.y = "c.y"
[d]
x = "d.x"
y = "d.y"
[[e]]
x = "e[0].x"
y = "e[0].y"
[[e]]
x = "e[1].x"
y = "e[1].y"
[f.A]
x.y = "f.A.x.y"
[f.B]
x.y = """
f.
B.
x.
y
"""
[f.C]
points = [
{ x=1, y=1, z=0 },
{ x=2, y=4, z=0 },
{ x=3, y=9, z=0 },
]
YAML
- yaml Ain'tMarkupLanguage: 会自动识别int/string null.
null/Null/NULL
true/false - 只保留缩进; 语法实在太多了
JSON JSON5 JSNOC
- jsonpath:
$.data.* $.data.[*].id
- null {} []
- go: nil struct{}{} []T{}
- 阅读和编辑它实在不方便
INI .ini
- 最多只能解决一层嵌套
; 最简单的结构
a = a;
b = b; 这些等号后面的值是字符串(句末分号不是必须的;它后面的都是注释)
; 稍微复杂一点的单层嵌套结构
[c]
x = c.x
y = c.y
[d]
x = d.x
y = d.y
# bitwise in conf
E_ALL & ~E_NOTICE
md markdown
- markdown标准化: CommonMark GFM https://bytemd.js.org/playground
- basic: 标题
#
列表/task- 1. [x]
code 加粗/斜体/引用/高亮*- - > ==
链接/图片[]( "") [图片上传失败...(image-f0eee4-1757566821166)]
分割线/删除线--- ~~
表格/对齐:--:
- code.inline/block: 编程语言支持 diff codeChunk.运行代码 highlight
ts{1,6-8}
ts:no-line-numbers
Latex - 特殊sp: 脚注
[]( "name") [^1]
目录[toc]
注音符号<ruby>味<rt>mǐ</rt></ruby> {喜大普奔|hē hē hē hē}
ppt/滑动图片<[图片上传失败...(image-1fd4c9-1757566821166)],[图片上传失败...(image-9764c8-1757566821166)]>
前置frontmatter 批注.criticmarkup - vscode
- markdown-all-in-one: tableFormatter
- MPE.markdown-preview-enhanced
- 合并单元格 纯文本绘图.diagrams
Presentation.slide
toc.⎋ code.{.class} {.line-numbers} {highlight=[1-10,15,20-22]}
- emoji
- 导入文件
@import
导出文件 HTML/chrome/pdf/ebook/pandoc
- 合并单元格 纯文本绘图.diagrams
- davidanson.vscode-markdownlint mrmlnc.remark
- josephcz.vscode-markdown-mindmap-preview
- jerriepelser.copy-markdown-as-html
graph KG
- 画图工具: d2 excalidraw draw.io PlantUML Mermaid Flowchart Graphviz Gantt Lucidchart Gliffy Dia Code2Flow vega.数学图表
- KG: logseq mubu obsidian
- wwj.直播抓娃娃: https://www.processon.com/view/link/59afd99ee4b05fba5eff7797