algorithm
二维数组矩阵的宽高变换
public int[][] matrixReshape(int[][] nums, int r, int c) {
int rows = nums.length;
int columns = 0;
if (rows > 0) {
columns = nums[0].length;
}
// illegal
if (rows * columns != r * c) {
return nums;
}
int[][] ret = new int[r][c];
int index = 0;
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++) {
index = i * columns + j;
ret[index / c][index % c] = nums[i][j];
}
}
return ret;
}
review
How to Fix a Lock Wait Timeout Exceeded Error in MySQL mysql获取锁超时语句执行失败的处理机制
share
基于Lock wait timeout exceeded; try restarting transaction问题,去查了mysql处理的办法,reviw中的blog是收获最大的,share基本是基于reviw中的blog去总结的
mysql的innodb_rollback_on_timeout