通过 DNS 方式,速度快,性能好。 dig ANY +short @resolver2.opendns.com myip.opendns.com dig ANY +short @resolver2.opendns.com myip.opendns.com dig ANY +short @ns1[......]继续阅读

2022年10月12日 0条评论 1754点热度 0人点赞 痴者工良 阅读全文

Fast speed and good performance through DNS. dig ANY +short @resolver2.opendns.com myip.opendns.com dig ANY +short @resolver2.opendns.com myip.opendn[......]继续阅读

2022年10月12日 0条评论 52点热度 0人点赞 痴者工良 阅读全文

使用接口的另一个好处是,方便 mock。 要检验自己代码是否好,足够分离,是否过度设计等,给自己写完整的单元测试。 如果自己写的代码,单元测试很难写或者无从下手,那么就要考虑改进代码了。 首先在单元测试类中,mock 注入服务: public class BasketWebApiTest {[......]继续阅读

2022年3月30日 0条评论 2300点热度 0人点赞 痴者工良 阅读全文

Using interfaces has another benefit: it facilitates mocking. To evaluate whether your code is good, properly separated, or over-designed, write compr[......] 继续阅读

2022年3月30日 0条评论 82点热度 0人点赞 痴者工良 阅读全文

using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Running; public unsafe class Model { public int Id { get; set[......]继续阅读

2022年3月29日 1条评论 2496点热度 1人点赞 痴者工良 阅读全文

using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Running; public unsafe class Model { public int Id { get; set[......]继续阅读

2022年3月29日 1条评论 62点热度 1人点赞 痴者工良 阅读全文

阅读《实现领域驱动设计》做的小笔记。 什么是 DDD 领域模型 什么是领域模型?领域模型是关于某个特定业务领域的软件模型。通常,领域模型通过对象模型来实现,这些对象同时包含了数据和行为,并且表达了准确的业务含义。 领域模型即 DDD 中强调的建模,要设计一个模型,需要考虑三点: 为什么要建模; [......] 继续阅读

2022年3月29日 0条评论 2909点热度 0人点赞 痴者工良 阅读全文

What is DDD Domain Model What is a domain model? A domain model is a software model that pertains to a specific business domain. Typically, a domain m[......] 继续阅读

2022年3月29日 0条评论 70点热度 0人点赞 痴者工良 阅读全文

rsync 是 linux 系统下的数据镜像备份工具。使用快速增量备份工具Remote Sync可以远程同步,支持本地复制,或者与其他 SSH、rsync 主机同步。 rsync 可以镜像保存整个目录树和文件系统。可以很容易做到保持原来文件的权限、时间、软硬链接等等。无须特殊权限即可安装。 快速:第[......] 继续阅读

2022年1月21日 0条评论 3469点热度 0人点赞 痴者工良 阅读全文

rsync is a data mirroring and backup tool for Linux systems. Using the fast incremental backup tool Remote Sync allows for remote synchronization, sup[......] 继续阅读

2022年1月21日 0条评论 90点热度 0人点赞 痴者工良 阅读全文

首先要安装 mysqlclient,apt install mysql-client。 然后使用里面的 mysqldump 工具。 命令格式示例如下 mysqldump -h127.0.0.1 --port=端口 -uroot -p密码 --databases 数据库名称 > /var/bak[......]继续阅读

2022年1月21日 2条评论 3239点热度 0人点赞 痴者工良 阅读全文

首先要安装 mysqlclient,apt install mysql-client。 然后使用里面的 mysqldump 工具。 命令格式示例如下 mysqldump -h127.0.0.1 --port=端口 -uroot -p密码 --databases 数据库名称 > /var/bak[......]继续阅读

2022年1月21日 2条评论 3209点热度 0人点赞 痴者工良 阅读全文

Recently, I migrated my blog system, which involved Nginx, SSL certificates, a MySQL database, and various WordPress files. After quite a bit of effor[......] 继续阅读

2022年1月21日 0条评论 3218点热度 0人点赞 痴者工良 阅读全文

最近将博客系统迁移,有 Nginx,ssl证书,mysql数据库和 wordpress 各类文件,折腾了一番。 为了避免后续服务器故障等问题,在家里启动树莓派,对博客所在的服务器使用 rsync 做定期备份。 树莓派使用自带的 cron 服务,做定期启动任务。 打开 /etc/cron.d 目录,然[......] 继续阅读

2022年1月21日 0条评论 3210点热度 0人点赞 痴者工良 阅读全文

Installed Mysql/MariaDB, but I cannot log in as root; I can only use the mysql account to get in. [root@192-168-0-241 ~]# mysql -u mysql Welcome to th[......]继续阅读

2022年1月13日 1条评论 5048点热度 2人点赞 痴者工良 阅读全文

安装了 Mysql/MariaDB ,但是 root 死活进不去,只能用 mysql 这个账号进去。 [root@192-168-0-241 ~]# mysql -u mysql Welcome to the MariaDB monitor. Commands end with ; or \g.[......]继续阅读

2022年1月13日 1条评论 5068点热度 2人点赞 痴者工良 阅读全文

reflect.Type.Elem() 可以返回元素的类型,例如指针类型,返回不带指针的类型。 reflect.Value.Elem() 是获取指向值的引用。 type name struct { } func (n name) Print(str string) { } func main([......]继续阅读

2021年11月16日 0条评论 2578点热度 0人点赞 痴者工良 阅读全文

reflect.Type.Elem() can return the type of the element, for example, for pointer types, it returns the type without the pointer. reflect.Value.Elem()[......] 继续阅读

2021年11月16日 0条评论 52点热度 0人点赞 痴者工良 阅读全文

代码所示,将 Table 导出为 .csv 格式的数据。 public static async Task SaveCSV(DataTable dt,string[] header, string fileName) { StringBuild[......]继续阅读

2021年8月23日 0条评论 2656点热度 0人点赞 痴者工良 阅读全文

The code provided exports a DataTable to a .csv format. public static async Task SaveCSV(DataTable dt,string[] header, string fileName)[......]继续阅读

2021年8月23日 0条评论 2688点热度 0人点赞 痴者工良 阅读全文