题目传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1010
题目大意
小狗要逃离一个的长方形迷宫,迷宫出口的门仅在第 秒时开一瞬间(不到1秒)。因此,小狗必须恰好在第 秒到达门口才能逃离。 每一秒,它可以向上下左右任意移动一格,且所有格子至多走一次。
Windows 安装
本来想着本地电脑上安装完RabbitMQ,也就跑跑测试,直接安装在Windows里也没啥问题,于是先安装了Erlang OTP,再安装RabbitMQ,配置完环境变量,启动rabbitmq-server时喜提报错:
C:\Users\Xanadu13>rabbitmqctl stop
Stopping and halting node rabbit@Xanadu ...
Error: unable to perform an operation on node 'rabbit@Xanadu'. Please see diagnostics information and suggestions below.
Most common reasons for this are:
* Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
* CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
* Target node is not running
In addition to the diagnostics info below:
* See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
* Consult server logs on node rabbit@Xanadu
* If target node is configured to use long node names, don't forget to use --longnames with CLI tools
DIAGNOSTICS
===========
attempted to contact: [rabbit@Xanadu]
rabbit@Xanadu:
* connected to epmd (port 4369) on Xanadu
* epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic
* TCP connection succeeded but Erlang distribution failed
* suggestion: check if the Erlang cookie is identical for all server nodes and CLI tools
* suggestion: check if all server nodes and CLI tools use consistent hostnames when addressing each other
* suggestion: check if inter-node connections may be configured to use TLS. If so, all nodes and CLI tools must do that
* suggestion: see the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
Current node details:
* node name: 'rabbitmqcli-633-rabbit@Xanadu'
* effective user's home directory: c:/Users/Xanadu13
* Erlang cookie hash: RLHiYW9O79itD2p1tY011A==
在@pdai的这篇文章中提到,MySQL
中Sharding
策略主要分为三种:哈希取模、范围分片和映射表。
但作者没有细讲各自的优缺点以及应用场景,在此总结了一下:
deepseek的思考过程
嗯,我需要详细介绍一下MySQL分表分库中的Sharding策略,特别是哈希取模、范围分片和映射表这三种方法。首先,我得确保自己理解这些策略的基本概念,然后考虑如何向别人解释清楚。让我先回忆一下相关知识,再逐步整理思路。
排序算法总览
排序算法 | 平均时间复杂度 | 最好 | 最坏 | 空间复杂度 | 稳定性 |
---|---|---|---|---|---|
冒泡排序 | O(n^2) | O(n) | O(n^2) | O(1) | 稳定 |
选择排序 | O(n^2) | O(n^2) | O(n^2) | O(1) | 不稳定 |
插入排序 | O(n^2) | O(n) | O(n^2) | O(1) | 稳定 |
希尔排序 | O(nlog²n) | O(nlog²n) | O(nlog²n) | O(1) | 不稳定 |
归并排序 | O(nlogn) | O(nlogn) | O(nlogn) | O(n) | 稳定 |
快速排序 | O(nlogn) | O(nlogn) | O(n^2) | O(logn) | 不稳定 |
堆排序 | O(nlogn) | O(nlogn) | O(nlogn) | O(1) | 不稳定 |
计数排序 | O(n+m) | O(n+m) | O(n+m) | O(m) | 稳定 |
桶排序 | O(n) | O(n) | O(n^2) | O(n) | 稳定 |
基数排序 | O(n·k) | O(n·k) | O(n·k) | O(n+k) | 稳定 |
作为一个已经停止维护的项目,Yapi 安装过程中比较容易踩坑,这里记录一下安装过程。
相关文档
https://hellosean1025.github.io/yapi/devops/index.html#%e5%ae%89%e8%a3%85
文档里提到的方式一无法成功,存在两个问题:
主要日志系统
JUL
Java标准库java.util.logging
,但不常用。
Log4j
Log4j 的短板在于性能,在Logback 和 Log4j2 出来之后,Log4j的使用也减少了。
Logback
同样由Log4j的作者开发,提供了性能更好的实现,异步 logger,Filter等更多的特性。
Log4j2
由Log4j维护者开发,诞生晚于logback,因此吸收了slf4j和logback的一些优点(比如日志模板),性能也比较好。在设计上分离Facade和Implementation,即log4j-api
和 log4j-core
。
第二章:形式文法和形式语言
句型
从文法的开始符号出发进行零步或多于零步的推导得到的文法符号串(S =*=> α)。句型可以既包含终结符号又包含非终结符号。
句子
只包含终结符号的句型称为句子。句子是一种特殊的句型。
语言
文法 G 推导出的所有句子组成的集合,称为语言,记为 L(G),即:
第一步:清理yarn缓存
yarn cache clean