Introducing pdmreader

PowerDesigner is a powerful and popular data modeling tool, but it’s too expensive to afford. As a developer, I have to consume the PDM artifacts created by my colleagues, so switching to another tool is not a solution.

Fortunately, PowerDesigner supports plain XML file format, which allows the possibility of reading and writing without PowerDesigner. This is officially documented.

Although you can read the PDM XML file with any text editor, it will be too annoying to work directly with XML, and text editor won’t make you any help in generating DDL.

So I create a simple command line tool: pdmreader.

Read more >>

SubGit - 用 Git 与 SVN 仓库交互

目前在公司参与的项目都是用 SVN 做版本控制的,然而我非常不喜欢 SVN:

  • 配置忽略文件规则没 Git 的 .gitignore 那么方便灵活
  • 查看提交记录慢的要死
  • 每次提交都得提交到远程仓库,不太方便
    • 网络不佳或 SVN 服务器故障的时候,无法提交
    • 有时同时做了几件事,想做完一起提交,但又不希望放到同一个提交记录里
    • 有时本地做好了某个东西,想先保存下来,但还不宜提交到远程仓库
Read more >>

Upgrading my blog to Spring Boot 2.0

Spring Boot 2.0 was finally released on May 1, 2018, and my blog has been upgraded to it from Spring Boot 1.5.9.

Spring Boot 2.0 is a major update of 17 months’ work. It breaks some configurations due to refactoring and dependency updates along with it.

Read more >>

Soft hyphen (0xAD) - 看不见的连字符

今天在阅读一篇英文文章 The Last JSON Spec 时,发现自己写的划词翻译工具 popup-dict 对很多词无效,比如 “ir­ra­tional”。

细查之下,发现 “ir­ra­tional” 虽然看起来只有 10 个字符,但 “ir­ra­tional”.length 却返回 12。第三个字符的 char code 是 173(16 进制表示就是 0xAD),这不是字母 “r”。整个字符串不匹配英文单词/合成词/句子的正则表达式,因此被 popup-dict 忽略。

Read more >>

popup-dict - Linux 下的划词翻译工具

查看英文网页或阅读英文电子书时,划词翻译是个非常实用的功能。

之前一直在用 youdao-dict-for-ubuntu,这是个基于 Python 2 + Gtk+ 2 + webkit 编写的小工具,简单实用。但也有些不足:

Read more >>

JPA many-to-many update efficiency

When updating many-to-many relationships, the SQL executed by JPA may be quite inefficient.

Suppose we have a Post-Tag association: each post can have multiple tags, and each tag can also has multiple posts.

Read more >>

My own blog built with Spring Boot

I have been planning to build my own blog (previously it was powered by WordPress) for a long time, and now it finally comes.

The new blog is build with Spring Boot.

Read more >>

Deploy Rails application to sub-uri

Sometimes you may want to deploy a Rails application to sub-uri. But it’s not seamless if you didn’t write your code carefully. The main problem is absolute url.

Read more >>

Let's Encrypt SSL 证书申请及配置

HTTPS 的必要性

  1. 保护用户隐私、账号安全 HTTPS 在客户端和服务器之间传输加密内容,即使被窃听,也极难解密;而 HTTP 明文传输。 对于用户登录操作,使用 HTTP 很难保证用户的账号安全:若明文传输,攻击者很容易窃听;若使用固定的加密算法,攻击者虽难以得到明文密码,但能够通过重放攻击假冒用户登录。
  2. 防止被劫持 在国内运营商劫持、挂广告异常猖獗的网络环境下,普及 HTTPS 非常必要。 注意,要防止被劫持,必须全站都上 HTTPS,不加载任何非 HTTPS 的资源,否则还是可以被劫持。
Read more >>

使用 Capistrano 部署 Rails 应用

Capistrano 是一个远程服务器自动化工具,使用 Ruby 编写。 它是一个通用类型的工具,并非专为 Rails 设计,但对 Rails 支持很好。

Read more >>