Skip to content

Commit

Permalink
[arts] 2024.06.24
Browse files Browse the repository at this point in the history
  • Loading branch information
iEverX committed Jun 30, 2024
1 parent 6c7e36f commit dabbb88
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
90 changes: 90 additions & 0 deletions content/arts/2024/06.24.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
+++
title = "ARTS 2024.06.24"
date = 2024-06-24

[taxonomies]
tags = ["ARTS"]
+++

## Algorithm

[1309. 解码字母到整数映射](https://leetcode.cn/problems/decrypt-string-from-alphabet-to-integer-mapping/description/)

简单题,反向遍历字符串。注意字母和数字的对应关系,`a` 对应的是`1` 而不是`0`

```java
class Solution {
public String freqAlphabets(String s) {
int len = s.length();
char[] seq = new char[len];
int pos = len;

int i = len - 1;
while (i >= 0) {
char c = s.charAt(i);
int r;
if (c == '#') {
r = s.charAt(i-1) - '0';
r += 10 * (s.charAt(i-2) - '0');
i -= 3;
} else {
r = c - '0';
i--;
}
seq[--pos] = (char) ('a' + r - 1);
}

return new String(Arrays.copyOfRange(seq, pos, len));
}
}
```

## Review

<https://dev.mysql.com/doc/refman/8.4/en/create-table-generated-columns.html>
<https://dev.mysql.com/doc/refman/8.4/en/create-table-secondary-indexes.html#json-column-indirect-index>

MySQL 的 Generated column,是知识盲区。

- 建表时可以建立 Generated column,但有一定的限制
- 两种类型,virtual 和 stored,stored 类型占用存储空间
- 可以建立索引

## Tips

github clone不下来怎么办?

~/.config/git/config 或者 ~/.gitconfig 文件,增加一行,表示使用 ssh 替代 https

```toml
[url "ssh://git@github.com"]
insteadOf = https://github.com
```

~/.ssh/config 文件,增加配置

```python
Host github.com
Hostname ssh.github.com
Port 443
User git
IdentityFile ~/.ssh/id_xxx
```

## Share

[我做系统架构的一些原则 | 酷 壳 - CoolShell](https://coolshell.cn/articles/21672.html)

左耳朵耗子的文章,是其个人经验和想法总结。这些原则的整体思路是,重视业务、遵循优秀的实践经验、考虑长期。

1. 原则一:关注于真正的收益而不是技术本身
1. 原则二:以应用服务和 API 为视角,而不是以资源和技术为视角
1. 原则三:选择最主流和成熟的技术
1. 原则四:完备性会比性能更重要
1. 原则五:制定并遵循服从标准、规范和最佳实践
1. 原则六:重视架构扩展性和可运维性
1. 原则七:对控制逻辑进行全面收口
1. 原则八:不要迁就老旧系统的技术债务
1. 原则九:不要依赖自己的经验,要依赖于数据和学习
1. 原则十:千万要小心 X – Y 问题,要追问原始需求
1. 原则十一:激进胜于保守,创新与实用并不冲突
4 changes: 4 additions & 0 deletions content/arts/2024/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
+++
transparent = true
render = false
+++

0 comments on commit dabbb88

Please sign in to comment.