Given a collection of distinct integers, return all possible permutations.
Example:
Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2],
[3,2,1]
]
func permute(nums []int) [][]int {
if len(nums) == 0 {
return nil
}
ans := make([][]int, 0)
backtrack(nums, nil, &ans)
return ans
}
func backtrack(nums []int, prev []int, ans *[][]int) {
if len(nums) == 0 {
*ans = append(*ans, append([]int{}, prev...))
return
}
for i := 0; i < len(nums); i++ {
backtrack(append(append([]int{}, nums[0:i]...), nums[i+1:]...),
append(prev, nums[i]),
ans)
}
}
介绍一个 client-server 架构的 crash report & analysis 设计方案。

Client 端的 crash reporting 借助于 Breakpad 或 Crashpad 实现。
Breakpad is a set of client and server components which implement a crash-reporting system.
Crashpad is the latest open-source crash reporting tool built by Google. It is the successor to the popular Breakpad crash reporter.
Server 端则是用 Backtrace.io。
To create a FTP server
docker run -d --name ftpd_server \
-e FTP_USER_NAME=ftp_user \
-e FTP_USER_PASS=123456 \
-e FTP_USER_HOME=/home/ftp_user \
-e "ADDED_FLAGS=-d -d" \
-e PUBLICHOST=localhost \
-p 21:21 -p 30000-30009:30000-30009 stilliard/pure-ftpd:hardened
To create a SFTP server
docker run --name sftp -p 22:22 -d atmoz/sftp ftp_user:passwd:::upload
什么才是真正的以客户为中心?🤔🤔