whoru

学习、分享、交流、沉淀

安装

1
➜  ~ npm i nrm -g

使用

1
2
3
4
5
6
7
8
9
10
11
12
# 查看 nrm 内置的几个 npm 源
➜ ~ nrm ls
npm ---------- https://registry.npmjs.org/
yarn --------- https://registry.yarnpkg.com/
tencent ------ https://mirrors.cloud.tencent.com/npm/
cnpm --------- https://r.cnpmjs.org/
* taobao ------- https://registry.npmmirror.com/
npmMirror ---- https://skimdb.npmjs.com/registry/

# 切换源
➜ ~ nrm use cnpm
Registry has been set to: http://r.cnpmjs.org/

❗️JD-GUI 有点老了,已经很久没更新,推荐另一款:https://github.com/skylot/jadx


JD-GUI 是一款大家耳熟能详的 Java 反编译工具,可以方便的将编译好的 .class 文件反编译为 .java 源码文件,用于开发调试、源码学习等。

官网地址:http://java-decompiler.github.io

Git 地址:https://github.com/java-decompiler/jd-gui

下载地址

当前最新版本:v1.6.6 @ Dec 25, 2019

阅读全文 »

由于前一段时间公司项目需求,参与了把 MySQL 数据库迁移到 PostgreSQL 数据库的工作,本文主要记录常用语法的转换规则,待补充完善。

数据库版本:

  • MySQL 8.0.x
  • PostgreSQL 15.0.x

基本规则

引号、反引号

在 PostgreSQL 中,单引号 AS 'col1' 和反引号 `` 都不支持,要么去掉,要么用双引号代替。

在 Java 的 MyBitis xml 文件中,如果返回结果是 Map 结构,并且返回字段用 AS 转为驼峰,则必须用双引号包起来,否则返回后会转换为小写,如

1
2
3
4
5
<select id="getWaitAuditPurchaseReturn" resultType="java.util.Map">
select
coalesce(count(1),0) as "waitAuditNum",
min(prepared_bill_time) as "preparedBillMintime"
...

WHERE 中字段值的大小写与实际数据不一致

1
2
3
4
5
6
-- 这样在 MySQL 可以正常查询出来结果,但是在 PostgreSQL 中查询不到
-- 表中存的实践数据是大写的 MATERIAL_USE_TYPE
select id from system_user_privilege where tableAlias.privilege_type = 'material_use_type'

-- 可以用 UPPER 或 LOWER 函数处理一下
select id from system_user_privilege where tableAlias.privilege_type = UPPER('material_use_type')
阅读全文 »

Docker 是一款针对程序开发人员和系统管理员来开发、部署、运行应用的一款虚拟化平台。它可以让你像使用集装箱一样快速的组合成应用,并且可以像运输标准集装箱一样

Vagrant 是另一款虚拟化工具,与 Docker 的区别参见这里

阅读全文 »

1. 设置

1.1. 查看

1
2
3
$ git config --list # 所有设置
$ git config --list --global # 全局设置
$ git config --list --local # 当前仓库设置

1.2. 最小设置

1
2
3
4
5
# 不进行此设置时,只能执行 git add 操作
# 一般与待 push 的远程仓库保持一致
# 针对 --local 的设置,优先级高于 --global s
$ git config --global user.name "xxx" # 用户名
$ git config --global user.email "xxx@email.com" # 用户绑定的邮箱
阅读全文 »