Skip to content

Commit

Permalink
impr: 常规更新
Browse files Browse the repository at this point in the history
  • Loading branch information
cloaks committed Aug 11, 2024
1 parent 3eb002a commit a905b51
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/zh/posts/10.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Shell 脚本编程【循环】
tags:
- Shell 脚本编程
date: 2024-06-27 17:05
date: 2024-06-27 17:05:00
category:
- Linux
---
Expand Down
2 changes: 1 addition & 1 deletion src/zh/posts/11.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Gitlab CI/CD 配置手册
tags:
- CI/CD
date: 2024-07-09 16:45
date: 2024-07-09 16:45:00
category:
- Gitlab
---
Expand Down
124 changes: 124 additions & 0 deletions src/zh/posts/12.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
title: XML 读书笔记
tags:
- 规范文件
date: 2024-07-20 12:27:00
category:
- 读书笔记
---

XML 文件是由标记及其所标记的内容构成的文本文件,与 HTML 文件不同的是,这些标记可自由定义,其目的是使得 Internet 网络上的数据交互更方便,让文件的内容更加通俗易懂。


<!-- more -->

## 1. XML 规范

![](/assets/images/xml.png)

* XML 声明
1. Version 属性
2. Encoding 属性
3. Standalone 属性
* XML 标记
1. 空标记
2. 非空标记
3. 标记名称区分大小写
4. 根标记
* CDATA 段
CDATA 段中的内容不被解析,CDATA 段不支持嵌套
* 属性
属性区分大小写
使用属性的原则:不要因为属性的频繁使用破坏 XML 的数据结构
* 注释
<! -- 注释 -->
* 命名空间
## 2. 有效的 XML 文件
一个规范的 XML 文件如果和某个 DTD 文件相关联,并遵守该 DTD 文件规定的约束条件,就称为有效的 XML 文件。

DTD(Document Type Definition) 文件是有着特殊结构的文件,简单的说,DTD 文件是由元素所构成的文本文件。在 DTD 文件中,用关键字 `ELEMENT` 来定义一个元素,格式如下:

```xml
<!-- 商店营业时间标记中只可以由若干个名字为商店的子标记 -->
<!ELEMENT 商店营业时间 (商店*)>
<!-- 商店的标记恰好顺序为商店名称、开门时间、关门时间,而且约束名称为商店的标记包含的内容不可以含有可显示的字符(允许含有空格、回车等空白类字符) -->
<!ELEMENT 商店 (商店名称,开门时间,关门时间)>
<!-- 约束标记中只能是文本数据,不可以包含子标记 -->
<!ELEMENT 商店名称 (#PCDATA)>
<!ELEMENT 开门时间 (#PCDATA)>
<!ELEMENT 关门时间 (#PCDATA)>
```

### 2.1. XML 文件与 DTD 文件相关联

* SYSTEM 格式 `<DOCTYPE 根标记名称 SYSTEM "DTD 文件 URL">`
* PUBLIC 格式 `<DOCTYPE 根标记名称 PUBLIC "正式公用标识符" "DTD 文件 URL">`

正式公用标识符(Formal Public Identifier, FPI)的格式为 “-ISO认证//单位名称//DTD说明//所用语言”

如果 URI 是一个文件名,该 DTD 文件必须和当前 XML 文件在同一目录中,否则 URI 是一个可访问的 URL 资源。

DTD 文档类型的声明必须写在 XML 声明后。

### 2.2. DTD 完整性

* ELEMENT 标记约束
```xml
<!ELEMENT 标记名称 标记的约束条件>
```
* ATTLIST 属性约束列表

```xml
<!ATTLIST 标记名称
属性名称 属性类型 默认值情况
属性名称 属性类型 默认值情况
...
>
```

#### 属性类型

|属性类型|约束意义
|-|-
|CDATA|字符串
|Enumerated|枚举值
|NMTOKEN|属性中不能含有空格
|NMTOKENS|属性中可以含有空格
|ID|唯一类型,默认值情况只能是`#REQUIRED,#IMPLIED`,一个标记中只能有一个 ID 属性类型
|IDREF|ID 引用属性类型,其内容只能是已有的 ID 属性中的值
|IDREFS|ID 引用属性类型的集合,可以添加多个 ID 属性

1. Enumerated

```xml
<!ATTLIST 标记名称 属性名称 (属性值1|属性值2|...|属性值n) 默认值情况>
```

#### 默认值情况

|默认值情况|约束意义
|-|-
|字符串|标记必须有该属性,且有默认值
|#IMPLIED|标记可以没有该属性,没有默认值
|#REQUIRED|标记必须有该属性,没有默认值
|#FIXED"字符串"|标记可以没有该属性,但如果有该属性,那么属性值固定不变

### 内部 DTD

```xml
<!DOCTYPE 根标记名称 [
内部 DTD 内容
]>
```

内部 DTD 与 外部 DTD 混合

```xml
<!DOCTYPE 根标记名称 SYSTEM "外部 DTD 的 URI" [
内部 DTD 内容
]>
<!DOCTYPE 根标记名称 PUBLIC "正式公用标识符" "外部 DTD 的 URI" [
内部 DTD 内容
]>
```

67 changes: 67 additions & 0 deletions src/zh/posts/14.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Gaoman 数位板 M6 linux 配置
date: 2024-08-11 16:31:00
category:
- Q&A
---

## 多屏如何设置数位板控制哪个屏幕

1. 查看显示器信息 `xrandr`

```plain
Screen 0: minimum 320 x 200, current 3840 x 1200, maximum 16384 x 16384
eDP-1 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 302mm x 189mm
1920x1200 60.00*+ 60.00
...
320x240 60.00
360x202 60.00
320x180 60.00
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
HDMI-3 disconnected (normal left inverted right x axis y axis)
DP-3 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 345mm x 194mm
1920x1080 59.93*+ 60.00 59.94
1600x900 60.00
1280x720 60.00 59.94
1024x768 60.00
800x600 60.32
640x480 60.00 59.94
DP-4 disconnected (normal left inverted right x axis y axis)
```

可以看到目前检索到 `eDP-1`, `DP-3` 两个屏幕

2. 执行 `xsetwacom` 命令设置数位板参数

‵‵‵plain
Usage: xsetwacom [options] [command [arguments...]]
Options:
-h, --help - usage
-v, --verbose - verbose output
-V, --version - version info
-d, --display "display" - override default display
-s, --shell - generate shell commands for 'get'
-x, --xconf - generate xorg.conf lines for 'get'

Commands:
--list devices - display detected devices
--list parameters - display supported parameters
--list modifiers - display supported modifier and specific keys for keystrokes
--set "device name" parameter [values...] - set device parameter by name
--get "device name" parameter [param...] - get current device parameter(s) value by name
‵‵‵

1. `xsetwacom --list devices` 检索数位板设备

```plain
GAOMON GAOMON_M6 Pen stylus id: 16 type: STYLUS
GAOMON GAOMON_M6 Pad pad id: 17 type: PAD
GAOMON GAOMON_M6 Touch Ring pad id: 22 type: PAD
GAOMON GAOMON_M6 stylus id: 23 type: STYLUS
GAOMON GAOMON_M6 eraser id: 24 type: ERASER
```

2. `xsetwacom set 'GAOMON GAOMON_M6 Pen stylus' MapToOutput DP-3` 完成设置
2 changes: 1 addition & 1 deletion src/zh/posts/8.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 关于 golang 的条件编译个人实践
tags:
- 条件编译
date: 2024-05-27 11:39
date: 2024-05-27 11:39:00
category:
- Golang
---
Expand Down
2 changes: 1 addition & 1 deletion src/zh/posts/9.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Navicat for Linux 无限适用
tags:
- 破解
date: 2024-06-24 14:55
date: 2024-06-24 14:55:00
category:
- Linux
---
Expand Down

0 comments on commit a905b51

Please sign in to comment.