重构第一步,构造可靠的测试环境。
What
任何可以立即查阅的东西,都故意不去记忆。
什么是重构
重构,对软件内部结构调整,在不改变外部可观察行为的前提下,提高其可理解性,减低修改成本。
重构难题
对于修改接口,能获取所有调用者,那么可以安心修改。如果无法修改全部调用者,如果是公开已经发布的接口,就需要同时维护新旧两个接口,直到所有用户将该变化做出反应。
How
Duplicated Code
重复代码提炼。兄弟类,则推到 super class,如果是不完全相同的,则分解方法提炼统一的方法。
Long method
小函数准确的命
Read more ...
最近用 [[GoldenDict]] 查词非常频繁且非常有效的提高了阅读的效率,但是在日常有的时候听一些英语口语的广播节目的时候,经常会有一些短语搭配,而我们平时如果写作的话,其实短语较于单词更为重要,口语亦然。所以产生了一个念头,如果有一本英语搭配语字典就能够提高不少效率,没想到都不用去刻意搜索,就出来了好几个推荐。
Oxford Collocation Dictionary 牛津英语搭配语词典
The BBI dictionary of English word combinations BBI 英语搭配词典
Longman Coll
Read more ...
Shell Syntax - what is your input means to the shell
Shell Operations - what can shell do
read input from file
breaks the input into words and operations
parse the token into simple and compound commands
performs the various shell expansions
redirections
execute th
Read more ...
一般服务器中会默认已经安装 SSH server,而个人版本的发行版,比如桌面版的 Ubuntu 或者我用的 Mint 可能默认没有安装,那么就需要自己安装配置。
SSH is program and protocol for securely logging into remote machines across a network. It allows you to run programs, and do a variety of tasks as if you were sitting at the machine. SSH is ver
Read more ...
在本机使用 Tomcat 启动 Drools Workbench,通常情况下直接使用 Docker 起就行了,但是为了学习 KIE Drools Workbench,这边就补习一下 Tomcat 启动方式。
基本的准备工作包括:
JDK, JAVA_HOME
Tomcat
Drools 相关工具
sudo 使用权限
installation
Make sure you have Tomcat installed.
Follow this link to download the drools workbench. And ch
Read more ...
DescriptionApache Tomcat implements several Java EE specifications including Java Servlet, JavaServer Pages, Java EL, and WebSocket, and provides a “pure Java” HTTP web server environment in which Java code can run.
Apache License 2.0
installation
Firstly, make sure jdk is inst
Read more ...
MySQL 中默认是没有开启日志记录的,所以需要手动修改配置文件开启日志。而在 MySQL 中我们需要关心的有三类日志:
The error log 错误日志,这一类日志包括了服务器运行时,包括启动和停止时的错误等信息
The General Query Log 查询日志,通常是 mysqld 进行连接,断开连接,查询等等操作的日志
The Slow Query Log 慢查询日志,包含了慢查询的 SQL 语句
在配置中没有开启任何日志记录时,MySQL 相关的日志在 /var/log/syslog 中。之所以关注到 MySQL 的日
Read more ...
Claude Code Skills 功能介绍以及使用经验
我们在使用 Claude Code 的过程当中,是否经常会遇到重复给 AI 提供相同的提示词,不停的告诉 Claude 我自己的工作方式和代码标准,虽然在之前我们可以通过 slash command 或者 CLAUDE.md 文件来部分实现。但今天我要介绍的 Claude Skill 可以更好的帮你解决这个问题。