樹狀資料在儲存的設計上需要考慮如何取得, 假設有足夠的資源 LDAP 是我覺得比較輕鬆的解決方案, LDAP 的資料儲存本身就是針對樹狀資料去做設計, 像是公司部門, 分支, 人員組織, etc. 都很適合用 LDAP.

但如果爭取不到 LDAP 就需要採用像安德魯介紹的這種方式, 去思考跟設計, 各有優缺.

OpenLDAP 的工具

我會推薦 Apache Directory

OpenLDAP 的資安問題

在一些比較敏感的客戶, 會要求 LDAP 的操作權限管控, 可以考慮開源的 bitnami/openldap 的 images 作為解決方案.

在資料移轉上, 只要把 LDAP persisted 的 /data 目錄下的 *.mdb, 備份移轉到新的 persisted volume (docker container)底下就可以了。


-

Callable

A callable instance can return a result.

Callable<Object> callable = new Callable() {
@Override
public Object call() throws Exception {
return doSomething();
}
}

Lambda expressions

// doSomething return an Object
Callable<Object> callable = () -> doSomething();

Runnable

A runnable instance just executes and has no return.

Runnable runnable =…

Almost all the GUI tools support, that you can execute the query and save it to CSV file.

select atc.TABLE_NAME,
atcs.COMMENTS,
atc.COLUMN_NAME,
atc.DATA_TYPE,
atc.NULLABLE,
ucc.COMMENTS
from ALL_TAB_COLUMNS atc
left join USER_COL_COMMENTS ucc
on ucc.TABLE_NAME = atc.TABLE_NAME
and ucc.COLUMN_NAME = atc.COLUMN_NAME
left join ALL_TAB_COMMENTS atcs
on atcs.TABLE_NAME = atc.TABLE_NAME
where atc.OWNER = '{db-owner}'
and atcs.OWNER = '{db-owner}'
order by atc.TABLE_NAME, atc.COLUMN_ID asc;

Memo the git-svn mapping :)

Install

brew install svn

Command-line

| git                  | svn                  |
|----------------------|----------------------|
| git clone <project> | svn co <project> |
| git pull / git fetch | svn update |
| git add | svn add |
| git push | svn commit <message> |
| git diff | svn diff |

Recently upgrade my DBeaver (a very powerful GUI for the database), but that language setting had been changed… some wording is not suitable, and English is better.

Preferences > User Interface > Language


Clean architecture, from Diagram by Robert C. Martin

依賴注入

依賴, 翻譯就是沒有 ooo 就無法做 xxx, oo 你的 xx.

注入, 翻譯就是透過物件初始化 constructor, method paramers 來將依賴的物件(元件) 放到程式碼的流程裡.

圖中的箭頭, 是依賴的方向,

  • Use Case(案例) 依賴 Entities(業務實體)
  • Controller (REST API 接口) 依賴 …

https://sdkman.io/

自從 Oracle 改變了 JDK 相關的 licences 之後, JDK 的版本就進入了大亂鬥的時代, 大亂鬥就是有各式各樣的 Open JDK 版本, 像是…


My IntelliJ is 2019.3. When I executed maven clean and install and they succeeded, but the IDE stills show me the “red highlighting” problems (some import packages are Not found symbol).

I found the solution is ref from
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003445760-Intellij-not-resolving-maven-dependencies?page=1#comments

Try close the IDE, delete the /Users/abrmagp/Library/Caches/IntelliJIdea2019.1/ directory, start IDE and re-import project from scratch as Maven project as advised. Make sure the import process competed successfully and that you can build the project by IDE (Build | Rebuild Project action).


1. 大致上的特性跟 HashTable 差不多, 但沒有 synchronized 保證, 也允許 null key 與 value.

2. 在操作 get, put 時, 操作的時間是一個 constant-time performance 操作, 這邊牽涉到一個 factor 0.75 的設計, 非常深… Orz

3. 官方文件解釋說 .75 是一 …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store