[toc]

  Unmanned surface vehicles (USVs) are autonomous marine vessels that can execute multiple tasks in a variety of cluttered marine environments without human supervision. The future progress of USVs depends on the development of full autonomy, which would enable USVs to work in any unstructured or unpredictable environment without human intervention.
  One of the main challenges in enhancing USV autonomy is the simultaneous detection and avoidance of obstacles in either open or confined waters. Local obstacle avoidance for USVs is used to avoid static and dynamic obstacles by adopting a timely avoidance manoeuvre. Local obstacle avoidance algorithms are of two types: path searching-based local path planning, which can generate appropriate trajectories or waypoints followed by the vehicle, and the behaviour-based reactive obstacle avoidance method, which can generate the guidance angle and guidance velocity realized by the navigation controller in real time.
  A novel path searching-based algorithm called the local normal distribution-based trajectory (LNDT) is proposed in this paper to address the local obstacle avoidance problem of USVs in complicated encounter situations. The design and implementation of LNDT has been published in Ocean Engineering with reference link. Besides, there is a copy only for personal research purpose.
  The following sections mainly discuss the implementation principle of the algorithm and provide some critical information to facilitate the following researchers. About the detailed information, you can refer my master thesis - Research on the Technology of Path Planning for Unmanned Surface Vehicle, while it is written in Chinese. The LNDS method is mainly extracted from my master thesis and polished in simulation.

Abstract

英文在中文之后 / English follows Chinese
  本文讲述了一种新型的、遵守 COLREGs 规则的无人水面艇 (USV) 自动避障方法的初步研究结果。这个方法本质上是一种基于路径搜索的算法,称为局部正态分布轨迹法,该算法可以在存在静态和动态障碍物的情况下规划出可行的避障轨迹。算法可以根据正态分布的钟形曲线生成符合 COLREGs 的次优轨迹,并提取航路点以供导航控制器安全操纵 USV。此外,我们讨论了构成钟形曲线的三个关键参数,并提出了一种轨迹重新规划策略,以提高该方法的安全性和灵活性。我们在实验中模拟了常见的超车、交叉和正面碰撞情况来验证算法,仿真表明该方法考虑了多个因素,可以规划出能够安全、平滑地避开障碍物的路径。此外,该方法还和另一种遵守 COLREGs 规则的反应式避障方法做了比较。
  This paper reports the preliminary research results of a novel automatic obstacle avoidance approach based on the COLREGs for unmanned surface vehicles (USVs). The approach presented is essentially a path searching-based algorithm called the local normal distribution-based trajectory, which plans viable avoidance trajectories in the presence of both static and dynamic obstacles. The proposed algorithm can generate a COLREGs-compliant suboptimal trajectory based on the bell-shaped curve of normal distribution and extract waypoints for the navigation controller to steer USVs safely. In addition, we discuss three key parameters and present a trajectory replanning strategy to improve the safety and flexibility of our approach. The common overtaking, crossing and head-on collision scenarios are each simulated in experiments. It is shown through simulations that the proposed approach considers multiple factors and can plan paths to avoid obstacles safely and smoothly. A comparison is also made with a reactive path planning algorithm which has been modified to follow the COLREGs.

Design and Implementation

  The overall scheme of obstacle avoidance is illustrated in following figure. The decision-making module in the dashed frame includes a two-layered distributed architecture of obstacle avoidance; we primarily study the COLREGs-based obstacle avoidance approach.

  The LNDT algorithm includes six processes, as shown below. We first integrates COLREGs rules into the obstacle avoidance approach of USVs. When there is a collision risk, it would determine three key parameters of the trajectory by a fixed procedure, and the primitive trajectory would be rotated and translated to adapt the real collision scenario. The USV then follows the planned trajectories. We would replan the trajectory once USVs can not follow the planned trajectory.

  Besides, we propose a scalable and flexible obstacle avoidance architecture. And we proposes six evaluation indicators to establish a scientific and impartial obstacle avoidance behaviour assessment (OABA) method in this paper.

Others

  The LNDT algorithm is mainly implemented in 2018, and it has not been tested in complex sea trial, so there must be some drawbacks to improve.
  In order to put it into wide practice, I'm glad to discuss some topics with you via email and polish this method, even share part of the source code with you.

基于电子海图的水面无人艇全局路径规划

该论文已经在 ICMIR2017 会议上发表,附上 springer 的文献地址 Research and Implementation of Global Path Planning for Unmanned Surface Vehicle Based on Electronic Chart,以及 arXiv 上的 文献地址。本文接下来主要对论文的实现原理进行分析,在最后给出程序代码,方便后来者研究和参考。

摘要

英文在中文之后 / English follows Chinese

水面无人艇 (Unmanned Surface Vehicles, USVs) 是一种新型的水面智能载具,其中全局路径规划是 USV 研究的关键技术,它可以反映出 USV 的智能程度。为了解决 USV 的全局路径规划问题,本文基于电子海图提出航行代价寻优 (sailing cost optimization) 的改进 A * 算法。我们使用 S-57 电子海图实现八叉树网格的环境模型建立,并基于航行安全权重、引导量和路径曲线平滑处理,提出优化的 A * 算法来实现规划路径航行安全,减少规划时间,提高路径平滑度。仿真结果表明,环境建模方法和改进 A * 算法可以规划出安全合理的全局路径。

Unmanned Surface Vehicle (USV) is a new type of intelligent surface boat, and global path planning is the key technology of USV research, which can reflect the intelligent level of USV. In order to solve the problem of global path planning of USV, this paper proposes an improved A* algorithm for sailing cost optimization based on electronic chart. This paper uses the S-57 electronic chart to realize the establishment of the octree grid environment model, and proposes an improved A* algorithm based on sailing safety weight, pilot quantity and path curve smoothing to ensure the safety of the route, reduce the planning time, and improve path smoothness. The simulation results show that the environmental model construction method and the improved A* algorithm can generate safe and reasonable global path.

论文实现原理

水面无人艇的全局路径规划,是指在存在障碍物的复杂环境下,给定起始点和目标点,根据任务要求自主规划出一条能够安全避开环境中静态障碍物的最优路径。

本文提出基于电子海图的 USV 全局路径规划方案,分为电子海图解析、全局环境模型建立和路径搜索算法三部分。通过解析电子海图文件,提取其中的海域地理信息及碍航物等信息,将海图信息渲染成为自主航路规划系统能够识别的信息模式,建立由可航行网格和不可航行网格组成的环境模型。在此基础上,本文综合考虑航行安全性、航行距离、路径平滑度等因素,采用基于航行代价寻优的改进 A * 算法来搜索环境模型中的最优路径,实现水面无人艇的全局航路自主规划,提高水面无人艇的自主决策能力和智能化水平。

水面无人艇全局路径规划系统无法直接利用电子海图进行自主路径规划,所以需要研究矢量电子海图 S-57 数据结构,提取出全局路径规划需要的海洋环境信息,裁剪无关数据,将电子海图转换为全局航路规划系统能够直接使用的信息。其中,利用开源的 TinyXML 库保存到 xml 文件中,供路径规划系统的后续分析和处理。

在提取得到电子海图 xml 文件后,通过网格化的方法把感兴趣区域划分为若干块大小相等的矩形网格,然后利用 Shapely 开源地理库依次判断网格中是否存在从电子海图中解析的静态障碍物(如陆地、海岛、浅滩),从而将网格环境地图划分为可航区域和不可航区域。

在实现环境建模后,全局路径搜索算法优化的目标是在确保航行安全性的前提下,尽可能使规划的路径航行代价最小,最大程度地减小与最短路径、最小航行代价无关的计算量。其中,Hart 等使用启发式函数来评估从初始点到目标点的代价,在 Dijkstra 算法基础上,结合启发式函数形成新的路径搜索策略 --A * 算法,通过减少搜索空间来提高搜索效率,所以更适合网格情形下的全局路径规划。本文对传统的 A * 算法进行改进,实现全局路径的初步搜索。

网格环境下,如果直接把 A * 算法搜索得到的节点顺序连接起来作为水面无人艇的全局规划路径,通常会出现阶梯或者锯齿状路径的情况,很明显规划的路径并不是两点间的期望路径。所以,本文提出去除多余航点的曲线平滑算法,在保证安全的前提下减少路径中不必要的航点,使多段折线化为直线,增加路径的光滑度,规划的路径会更加符合起止点之间的期望路径,符合水面无人艇的运动学特性。

实现程序

因为程序是 2017 年 4 月份实现的,仍然不够完善,可能存在 bug 或者性能优化点,欢迎交流和改善。程序最新代码请参考本人 github wylloong

电子海图解析

S-57 电子海图解析中,本文在之前文章中已经进行详细的分析和讲解,并给出源代码,可以参见 S57-Electronic-Chart-Reading-and-Storing基于 8211lib 库对 s57 电子海图的解析和存储

建立环境模型

该部分代码可详见 github GlobalEnviStructWithSquare,如有需要请备份,可能后期会删除掉部分程序。 ### 改进 A * 算法和路径平滑处理

该部分代码可详见 github GlobalPathPlanWithSquare,如有需要请备份,可能后期会删除掉部分程序。

程序示例

程序的全局路径规划示意图如下所示:

Note: It's been years since I last wrote electronic chart, all examples may not be syntactically valid but the idea should be correct.

[toc]

背景

  针对多任务点的全局路径规划,是指在存在静态障碍物的环境中,给定水面无人艇起始点、目标点以及多个任务点的情况下,设计从起始点出发,安全地遍历各个任务点,最终返回目标点的全局路径,要求行驶的航路代价总和最小。

多平台维护不易,最新文章更新于 个人网站,欢迎访问和留言。

  本文主要解决水面无人艇在对多个任务点进行全局路径规划时的设计和实现算方法,相关研究和设计已在 International Journal of Vehicle Autonomous Systems (IJVAS) EI 期刊发表。附 InderScience Publiers - IJVAS 的官方文献下载链接 Design and Implementation of Global Path Planning System for Unmanned Surface Vehicle among Multiple Task Points,以及 arXiv 的下载链接。官方文献下载链接需要科学上网才可以打开。
  本文主要讨论论文的实现原理,并给出部分程序源代码,方便后来者研究和参考。
# 摘要 英文在中文之后 / English follows Chinese
  全局路径规划是水面无人艇设计的关键技术之一。本文基于电子海图和六边形网格建立全局环境模型,并且证明六边形网格在有效性,安全性和快速性方面优于传统的正方形网格。此外,本文引入 Cube 坐标系来简化六边形坐标运算。进一步地,我们提出了一种改进的 A * 算法来实现两点之间的路径规划。在此基础上,我们构建了多个任务点的全局路径规划模型,并提出了一种改进的蚁群优化算法来准确实现多任务点的全局路径规划。仿真结果表明,全局路径规划系统可以安全、快速地规划出多个任务点的最优路径,在安全性,快速性和路径长度方面均优于传统方法。此外,全局规划路径可直接用于 USV 的实际场景。
  Global path planning is the key technology in the design of unmanned surface vehicles. This paper establishes global environment modelling based on electronic charts and hexagonal grids which are proved to be better than square grids in validity, safety and rapidity. Besides, we introduce Cube coordinate system to simplify hexagonal algorithms. Furthermore, we propose an improved A* algorithm to realize the path planning between two points. Based on that, we build the global path planning modelling for multiple task points and present an improved ant colony optimization to realize it accurately. The simulation results show that the global path planning system can plan an optimal path to tour multiple task points safely and quickly, which is superior to traditional methods in safety, rapidity and path length. Besides, the planned path can directly apply to actual applications of USVs. # 论文实现原理   本文提出的多任务点全局路径规划算法主要分为电子海图解析、六边形网格化建模、两点间路径搜索、多任务点的路径规划四部分。

  其中,通过解析电子海图文件,提取其中的海域地理信息及碍航物等信息,利用六边形进行网格化,建立由可航行六边形网格和不可航行六边形网格组成的环境模型。相关资料可以参考 基于 8211lib 库对 s57 电子海图的解析和存储正六边形网格化 (Hexagonal Grids) 原理与实现
  在实现环境建模后,两点间路径搜索算法优化的目标是在确保航行安全性的前提下,尽可能使规划的路径航行代价最小,最大程度地减小与最短路径、最小航行代价无关的计算量。本文设计综合多因素的航行代价,利用 Hart 提出的 A * 算法实现两点间的初步搜索,然后利用去除多余航点的曲线平滑算法,在保证安全的前提下减少路径中不必要的航点,使多段折线化为直线,增加路径的光滑度,规划的路径会更加符合起止点之间的期望路径,符合水面无人艇的运动学特性。相关资料可以参考 Research and Implementation of Global Path Planning for Unmanned Surface Vehicle Based on Electronic Chart 论文。
  在多任务点设计中,本文分析了港口巡逻、水质采样、水文勘测等任务对于全局路径规划的具体要求,从中抽象出针对这些任务通用的路径规划需求:在存在障碍物的海洋环境中,在给定多个任务点坐标的情形下,要求水面无人艇从起始点出发,安全地巡行到各个任务点执行具体的任务,再返回到目标点,要求总体的航路代价和最小。如在水质采样中,航路任务要求水面无人艇从固定点出发,根据设定路线行驶到各个采样点,根据采样要求完成全自动采集水样后,返回到目标点进行下一步处理,该航路任务要求完全符合本文抽象出来的全局路径规划要求。
  在水面无人艇复杂任务应用场景下,多任务点的路径规划可以抽象为网络最短路径问题,该网络本质上是一个有权值的有向图。多任务点的全局路径规划抽象模型 -- 网络最短路径问题,可以近似为旅行商问题 (Traveling Salesman Problem, TSP),是非常典型的 NP (Nondeterministic Polynomial) 难问题。在应用蚁群算法解决多任务点的全局路径规划问题时,路径规划问题可以转化为在一个由节点和边组成的网络权重图(网络最短路径模型)中搜索最优闭环路径,如下图所示。相关资料可以参考 基于蚁群算法的机械臂打孔路径规划

实现程序

  因为程序实现于 2017 年,在性能和流程中仍然不够完善,欢迎邮件进行交流和给出建议。程序最新代码请参考本人的 GitHub wylloong
  程序运行结果如下,其中黑点为任务点,红色线段为最后规划的全局路径。

程序运行结果

[toc]

本文主要在 S-57 电子海图数据的理论模型和数据结构的基础上,实现对 S-57 电子海图数据文件的解析,将海图信息解析后保存到 xml 文件中,供下游程序调用和后续研究。

什么是电子海图

电子导航图 (Electronic Navigational Chart, ENC) 是为航海需要而绘制的包含海域地理信息和航海信息的一种数字化的专题地图,是由各个国家的航道官方部门根据国际航道组织的《数字海道测量数据传输标准》 (S-57 标准) 而制作的。符合国际标准的电子海图数据统称为 S-57 电子海图, 它是一种面向对象的矢量格式的电子地图,其存储形式是二进制。
电子海图的理论模型和数据结构,可以查看国际标准《数字海道测量数据传输标准》,这里不再详述,对应英文版是《IHO TRANSFER STANDARD for DIGITAL HYDROGRAPHIC DATA》。
S-57 电子海图的结构如下图所示,来自 Research and Implementation of Global Path Planning for Unmanned Surface Vehicle Based on Electronic Chart

S57数据结构

ISO 8211lib 和 OGR 简介

S-57 标准封转格式是 ISO/IEC 8211 国际标准,封装标准的基础是文件,逻辑记录是封装标准的基本成分。
ISO 8211lib 是 C++ 编写的开源库,专门用于读取符合 ISO 8211 封装标准的数据文件,如 S-57 电子海图数据格式和空间数据传输标准数据集 (SDTS); GDAL 是一个开源栅格空间数据转换库,其中 OGR 是对 GDAL 的扩展,功能与 GDAL 类似,主要提供对矢量数据格式的读写,支持 S-57 电子海图格式,其中 S57reader 类是对 ISO 8211lib 库的封装,该类中包含读取 S-57 电子海图数据文件所用到的基本函数。

程序实现

读取 ENC

OGR 有关于 S-57 读取的官方文档 IHO S-57 (ENC),其中需要注意 OGR 的 S-57 驱动模块将处理 S-57 文件里所有的 feature 要素,其中 S-57 的特征物标 (feature objects) 转换为要素 (feature),空间物标 (geometry objects) 自动转换化对应要素下的空间几何对象。
在 OGR 中,从 S-57 文件读取的所有要素根据物标类型 (OBJL) 归属于相应的图层,可以类比于 GIS 里的 shape 格式,对应的图层下有要素 (feature), 要素下面有字段 (field) 和几何对象 (geometry),要素的几何形状可以从几何形状中获取,要素属性可以从字段中获取。

1
2
3
4
layer according to OBJL
repeated feature
repeated field
repeated geometry

其中,深度信息 (Depth soundings) 是 S-57 文件特有的,在读取 Depth soundings 需要设置 S57 Control Options 中的 ADD_SOUNDG_DEPTH 选项为 ON,对于 S57 Control Options 读取和导出的深层次知识请阅读官网文档。
最后,注意在程序中附加 s57objectclasses.csv 和 s57attributes.csv 文件,否则会缺少信息,如图层只有 5 层,无法读取等深线等。官方文档是这么解释的: > The S-57 reader depends on having two supporting files, s57objectclasses.csv, and s57attributes.csv available at runtime in order to translate features in an object class specific manner. These should be in the directory pointed to by the environment variable S57_CSV, or in the current working directory.

保存到 xml 文件中

因为项目需要,需要把 S-57 文件里特定图层的信息提取出来,S-57 文件解析后,把感兴趣的信息保存到 xml 文件中,方便后续的处理。

在 C++ 中,对 XML 文件处理中,使用一个开源的解析 XML 的解析库 -- TinyXML,这个解析库的模型通过解析 XML 文件,然后在内存中生成 DOM 模型,从而让我们很方便的遍历这棵 XML 树。

一些实现细节

如果无法得到一个 object class 的属性或者值不正确,如 VALDCO 的值始终为 0。根据论坛的讨论 OGR to access s57 file, missing attributes issue,注意是否加载了 S-57 的支持文件.csv。 > The solution to that is to set the GDAL_DATA environment variable to point the directory with the s57objectclasses.csv and related files。

代码和结果

解析和存储效果如下图所示,按图层要素顺序依次组织。

S57结构

程序实现源代码及示例,欢迎访问 Github: wylloong/S57-Electronic-Chart-Reading-and-Storing
程序开发环境是 VS2015,其中需要在编译的时候修改两个位置,如下图所示,否则编译会报错。

S57结构
S57结构

如果有内容讨论,可以下面留言。

References

[toc]

Hexo 搭建博客后,如果想在博客中分享视频,避免网站服务器带宽的限制,需要添加其他视频网站的外链播放器,具体该怎么操作呢?

Solution 1: hexo-tag-aplayer

hexo-tag-dplayerDPlayer 播放器的 Hexo 标签插件。

因为版本维护者不再支持新版本的更新,有些 bug 没有解决,所以对于高版本的 Hexo 支持不友好,甚至安装阶段就会报错。所以,我不是很支持继续使用该方法。

ps. 想继续坚持使用该方法的,可以移步阅读 在 Hexo 搭建的博客中插入音乐或者视频

Solution 2: 视频网站外链

Hexo 支持 iframe 的方式插入视频,所示我们可以把视频上传到哔哩哔哩、优酷、腾讯视频等,然后生成外链再拿来用。

大部分视频网站的外链播放器在视频开头都会加上 30 秒 - 2 分钟的广告,于是选择 B 站,无广告,无广告,无广告!

去 B 站获取视频外链

选择视频下方 “分享” 里的嵌入代码,而不是视频地址。否则进入 Hexo 博客后,网页会自动跳转到 bilibili 的视频页面,而不是自己的博客页面。

在文章中插入视频外链

Markdown 中可以直接插入 html 代码,但是 hexo 给我们特意准备了一个 raw 标签来插入 html 代码,防止一些其他因素的干扰,这里我们就使用 raw 来插入视频外链。

因为外链 html 没有和 Hexo 适配,所以在网页上打开,界面靠左并且窗口小,显得很难看,不够大气。

美化播放器样式

这里分享一个很巧妙的偷懒方法,我们可以去 Hexo 的 官网,看看作者是如何布局的,然后把代码抄回来。

那么,我们只要把布局中的 src,替换为自己的外链地址,就可以设置好视频的布局。

因为简书不支持 iframe,大家可以去我的网站看看效果。

References

背景

当用户点击我们发布的一些旧链接,而 Hexo 的链接都是永久链接,如果该文章被我们删除或者更改了链接,那么用户便会显示 nginx 的 404 页面,这个页面不够友好并且不能帮我们跳转到首页。

其实,hexo 本身是具备自定义 404 页面的,并且 nginx 会自动拦截并显示指定的 404 Not Found 页面,我们可以通过配置 hexo 和 nginx 来跳转自定义界面。

你可以在我的域名下随便修改一个网址,查看自定义 404 页面展示效果,如 http://www.yanlongwang.net/123_404

希望新的一年每个家庭都能够幸福美满,充满孩子们的欢声笑语。我也想尽自己的所能,来帮助离家的孩子们能够回到温暖的父母身边。我在今天这个特殊的日子,在自己的博客添加了腾讯 404 公益页面,希望光顾我博客的朋友如果看到 404 页面的时候,能够有现实的意义。每一个孩子都不应该被放弃,如果有万分之一的希望。

设置 hexo 的 404 页面

  1. 在 Hexo 命令行执行
    1
    hexo new page 404

那么在 Hexo 的根目录下,创建一个文件夹:\404。

  1. 编辑 index.md,自动跳转腾讯公益。
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8" />
    <title>404</title>
    </head>
    <body>
    <script type="text/javascript" src="//qzonestyle.gtimg.cn/qzone/hybrid/app/404/search_children.js" homePageName="返回首页" homePageUrl="https://www.yanlongwang.net"></script>
    true</body>
    </html>

其中,修改 homePageUrl 设置为自己的网站主页。

  1. 重新发布网站

设置 nginx 环境以支持 404 页面显示

  1. 编辑服务器上 nginx 的配置文件,将 error_page 设置为 hexo 的 404 页面。
1
2
3
4
5
6
## location in /etc/nginx/conf.d/xxx.conf
location / {
root /your_root;
index index.html index.htm;
error_page 404 /404/index.html;
}
  1. 重启 nginx 并检查 nginx 状态
1
2
3
4
5
6
## 重启 nginx
- systemctl restart nginx
## 检查重启后 nginx 的状态
- nginx -t
* nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
* nginx: configuration file /etc/nginx/nginx.conf test is successful

[toc]

音标

国际音标分类图
发音原理
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
graph LR
A[音标_48个] --> B(元音音标_20个)
A --> C(辅音音标_28个)
B --> D(元音是构成英文单词发音的基本元素)
D --> E(单元音)
D --> F(双元音)
B --> G(发音时声带振动且气流在通路上不受发音器官阻挡的是元音)
C --> H(发音时气流在通路上受到发音器官阻挡的是辅音)

G --> I(舌位不移动,在发音过程中没有摩擦,不受发音器官的任何阻碍)
F --> J(双元音的发音要领是发音饱满,舌行和唇形都要到位)
C --> K(辅音依元音而存在,与元音配合产生音节)
H --> L(清辅音)
L --> M(发音时声带不振动,送气的叫清辅音)
H --> N(浊辅音)
N --> O(发音时声带振动,不送气的叫浊辅音)

名词复数变化及发音规则

  • 一般在词尾加 - s。s 在元音或浊辅音后读 [z],在清辅音后面读成 [s],在 [t] 后与 [t] 在一起读成 [ts],在 [d] 后与 [d] 一起读成 [dz]。

  • 以 s, sh, ch, x 结尾的词在词尾加 - es,读 [iz]。

1
2
3
watch -> watches  
class -> classes
box -> boxes
  • 以 "元音字母+y" 结尾的词,加 - s,读作 [z];以 "辅音字母+y" 结尾的词,变 y 为 i,再加 - es,读 [iz]。
1
2
boy -> boys
factory -> factories
  • 以 o 结尾的词,多数加 - s,读 [z]。
    • 以元音字母 + o 结尾的词一律加 - s,读 [z]。
    • 少数以 o 结尾的词,在词尾加 - es,读 [z]。
1
2
3
4
5
tobacco -> tobaccos
radio -> radios
hero -> heroes
tomato -> tomatoes
potato -> potatoes
  • 以 f 或 fe 结尾的词,多数把 f,fe 变为 v,再加 - es,读 [vz]。
1
2
3
thief -> thieves
shelf -> shelves
knife -> knives
  • 不规则名词的复数形式
    • 通过变化单词内部元音字母,构成复杂形式。
      1
      2
      man -> men
      mouse -> mice
    • 单数形式和复数形式相同
      1
      sheep, deer, Chinese, Japanese

Reference to 沪江英语_名词复数变化及发音规则

动词第三人称单数的变化规则及发音规律

  • 大多数动词在词尾加 "s",在清辅音后发音为 [s],在浊辅音及元音后发音为 [z]。
    1
    2
    stop -> stops [s] make -> makes [s]
    read -> reads [z] play -> plays [z]
  • 以辅音字母加 "y" 结尾的,要先将 "y" 变为 "i",然后再加 "es",读 [iz]。
    1
    fly -> flies [iz] carry -> carries [iz]
  • 以 "s, x, ch, sh" 结尾的,在词尾加 "es",发音为 [iz]。
    1
    teach -> teaches [iz] watch -> watches [iz]
  • 以 "o" 结尾的动词,加 "es",读 [z]。
    1
    go -> goes [z] do -> does [z]

Reference to 动词第三人称单数的变化规则及发音规律

动词的过去式、过去分词及发音规则

规则动词的过去分词的构成规则与规则动词的过去式的构成规则相同。

词尾变化

  • 规则动词的过去式词尾变化有几种:
    • 一般动词,在词尾直接加 - ed。
      1
      watched, planted, watered, pulled, climbed, picked
    • 以不发音的 e 结尾的动词,只在词尾加 d。
      1
      liked, moved, tasted
    • 以 “辅音字母 + y” 结尾的动词,变 y 为 i,再加 ed。
      1
      study —> studied
    • 以 1 个元音字母加 1 个辅音字母结尾的重读闭音节,末尾只有一个辅音字母 (r、y、x、w 除外),先双写该辅音字母,再加 ed。
      1
      stop -> stopped drop —> dropped

发音规则

  • 在浊辅音和元音后,-ed 读 [d]。
    1
    lived, watered, listened, played
  • 在清辅音后,-ed 读 [t]。
    1
    liked, helped, watched
  • 在 [t],[d] 音后,-ed 读 [id]。
    1
    planted, wanted, handed
  • 在 "辅音字母 + y" 结尾后,-ed 读 [ɪd] 或 [aɪd]。
    • 如果 y 的发音为 [ɪ],则整体词尾发作 [ɪd]。
      1
      studied、carried、hurried
    • 如果 y 的发音为 [aɪ],则整体词尾发作 [aɪd]。
      1
      dried、cried、fried

Reference to 规则动词的过去式及发音规则
动词过去式和过去分词的变化及发音规则

[toc]

What's zoom

Zoom offers communications software that combines video conferencing, online meetings, chat, and mobile collaboration. Zoom can be installed on Windows and Linux desktops and mobile devices.

Zoom's Linux client allows you to start or join Zoom meetings on Ubuntu, Fedora and many other Linux distributions.

How to install zoom

The following commands would download the Zoom package for Debian system and install it using the apt package manager.

  1. Install wget if not installed

    1
    sudo apt -y install wget

  2. Download the latest Zoom package

    1
    wget https://zoom.us/client/latest/zoom_amd64.deb

  3. Install the zoom package

    1
    sudo apt install ./zoom_amd64.deb

  4. Check zoom is installed successfully

    1
    apt-cache policy zoom

apt-cache queries and displays available information about installed and installable packages, in which policy shows policy settings. The output information has demonstrated the downloaded package has installed successfully.

1
2
3
4
5
6
zoom:
Installed: 3.5.352596.0119
Candidate: 3.5.352596.0119
Version table:
*** 3.5.352596.0119 100
100 /var/lib/dpkg/status

  1. Set up zoom in command line
    1
    zoom

Reference

None.

[toc]

What's boost?

Boost 是为 C++ 语言标准库提供扩展的一些 C++ 程序库的总称。Boost 库是一个可移植、提供源代码的 C++ 库,作为标准库的后备,是 C++ 标准化进程的开发引擎之一,是为 C++ 语言标准库提供扩展的一些 C++ 程序库的总称。

Boost 由于其对跨平台的强调,对标准 C++ 的强调,与编写平台无关。但 Boost 中也有很多是实验性质的东西,在实际的开发中使用需要谨慎

The Boost license encourages both commercial and non-commercial use.

Boost.Geometry

Boost.Geometry (aka Generic Geometry Library, GGL), part of collection of the Boost C++ Libraries, defines concepts, primitives and algorithms for solving geometry problems. / Boost.Geometry 用于解决几何问题的概念、原语和算法。

Functions

Geometry

Reference

buffer

Calculates the buffer (a polygon being the spatial point set collection within a specified maximum distance from a geometry) of a geometry. / 通俗点,在原有形状的外围加上指定距离的边界,形成新的几何形状。

一图胜千言

difference

Calculates the spatial set theoretic difference of two geometries. / 计算两个图形的差异。

simplify

Simplify a geometry. / 简化一个几何图形,比如减少曲线的端点数。

Others

1
2
3
4
5
dpkg -S /usr/include/boost/version.hpp

// or

vim /usr/include/boost/version.hpp // without dpkg

复习: Run "dpkg --help" in Linux, 可以查看 "-S|--search Find package(s) owning file(s)".

[toc]

背景

大多数读者比较害羞,不喜欢留言,这样子就不方便自己从读者角度评价博客文章的质量,希望在网站增加投票的功能,方便读者留下评价和反馈。

多平台维护不易,最新文章更新于 个人网站,欢迎访问和留言。

网站的 NexT 主题,已默认集成 WidgetPack 的 Rating widget,在主题文件夹下的 _config.yml 的 rating 字段就可见相关默认配置。

1
2
3
4
5
6
7
# Star rating support to each article.
# To get your ID visit https://widgetpack.com
rating:
enable: false
id: #<app_id>
color: fc6423
# ---------------------------------------------------------------

总体而言,NexT 已经默认集成了 WidgetPack 的 Ratingwidget,要启用 Ratingwidget,只需要在 WidgetPack.com 注册后添加站点,获得 ID 后,修改 NexT 主题配置文件 rating 字段内容即可。目前,WidgetPack 对个人用户提供了部分免费功能,可以满足个人博客网站的需求。

什么是 WidgetPack

Widget Pack makes it easy to add website widgets like comments, reviews, rating to your Blog, Online Shop or Website in minutes.

While using this Site, you may need to feed-in personal information that can be used to contact or identify you (“Personal Information”). Personal Information may include, but is not limited to, some unique characteristics that disclose your personality, such as: name, email, photo, likes and dislikes. WidgetPack web-servers automatically track and store Site usage data. This information is liable to include, but is not limited to, your computer’s IP. Along other sites, WidgetPack also uses “cookies” to collect such information. A cookie is an essential data file that is stored on your computer hard drive for record-keeping purposes allowing saving your registration ID and login password for prospective logins to WidgetPack Site; “session ID cookies” enable certain features of the Site providing authentication, identification of a user session, session contents and some other preferences. You can tweak your browser by changing its options to stop accepting cookies or to prompt you before accepting a cookie from the websites you visit. If you do not accept cookies, however, you may not be able to use some of the Site’s features or all the functionalities of our services.

简而言之,Widget Pack 会在得到授权的情况下,自动跟踪和存储你在某些网站上留下的个人信息 (邮箱、IP、cookies) 等,方便快捷地为一些博客、购物网站提供评价、留言和投票等小插件功能。

目前,WidgetPack 对个人用户提供了部分免费功能,一个网址和一个 moderator,可以满足个人博客网站的需求。

配置过程

获取 ID

  • 点击 Widgetpack.com 链接注册,可以获得获取用户 ID。
  • 在 “Add new site” 中,填入网站地址和名称,会生成 Rating Widget 安装代码,如下所示。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<div id="wpac-rating"></div>
<script type="text/javascript">
wpac_init = window.wpac_init || [];
wpac_init.push({widget: 'Rating', id: your_id}); # your_id 为注册生成的ID
(function() {
if ('WIDGETPACK_LOADED' in window) return;
WIDGETPACK_LOADED = true;
var mc = document.createElement('script');
mc.type = 'text/javascript';
mc.async = true;
mc.src = 'https://embed.widgetpack.com/widget.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(mc, s.nextSibling);
})();
</script>
<a href="https://widgetpack.com" class="wpac-cr">Star Rating WIDGET PACK</a>

以上安装代码已默认集成到 /hexo/themes/next/layout/_third-party/rating.swig 文件中,所以除了确认下 ID,或者使用默认的 theme.rating.id, 不需要其他操作。

设置投票方式

在网站上,在侧边栏可以选择统计 Rating 的方式。

目前网站有三种方式可选,目标读者是国内的话,建议采用 Device,我是选择 IP Address。 - Social - IP Address - Device (Cookie)

Hexo 配置

NexT 主题配置文件 _config.yml 中 rating 的默认设置如下:

1
2
3
4
rating:
enable: false
id: #<app_id>
color: fc6423

仅需要将设置 enable 改为 true,把 #<app_id> 替换为 widgetpack.com 上生成的 ID。

网站效果预览

  • 桌面浏览器效果

  • 手机浏览器效果

投票监控

登录你的网站后,可以监控投票反馈情况,以及对某些投票进行管理,示意如下:

Reference


如果文章对你有帮助,请为我投票哦!如果有任何疑问,欢迎留言讨论。
If the article helps you, please vote for me. If you have any questions, please do not hesitate to discuss with me!

0%