CV肉饼王

Talk is cheap. Show me the code.

0%

前端是一个追求美的行当:漂亮的交互、丰富的特效、灵活多变的呈现形态,似乎总是能很好得迎合用户的喜欢和口味。但凡事都有两面性,追求美往往是有代价的。

阅读全文 »

1.consts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
export const DEFAULT_OPTIONS = { reconnectionAttempts: 10, transports: ["websocket"] };

export const STATUS_CODE = {
SUCCESS: "SUCCESS",
RECONNECTING: "RECONNECTING",
TIMEOUT: "TIMEOUT",
REPEAT: "REPEAT",
FAIL: "FAIL"
};

export const STATUS_MSG = {
SUCCESS: "连接成功",
RECONNECTING: "连接错误,重连中:",
REPEAT: "连接已存在,可直接复用",
TIMEOUT: "连接超时,请检查服务",
FAIL: "重连失败"
};
阅读全文 »

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# build stage
FROM python:3.10-slim

# copy files
COPY pyproject.toml pdm.lock /project/
WORKDIR /project

# install PDM
RUN pip install -U pip setuptools wheel
RUN pip install pdm

# install dependencies
RUN pdm install
COPY . .

# Install Doppler CLI
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg && \
curl -sLf --retry 3 --tlsv1.2 --proto "=https" 'https://packages.doppler.com/public/cli/gpg.DE2A7741A397C129.key' | apt-key add - && \
echo "deb https://packages.doppler.com/public/cli/deb/debian any-version main" | tee /etc/apt/sources.list.d/doppler-cli.list && \
apt-get update && \
apt-get -y install doppler
ARG DOPPLER_TOKEN
ENV DOPPLER_TOKEN=$DOPPLER_TOKEN
EXPOSE 8000
CMD ["pdm", "run", "start"]
阅读全文 »

一、*符号

1.解包所有可迭代对象,比如list、tuple、string

1
2
3
4
num_list = [1, 2, 3, 4, 5]
num_list_2 = [6, 7, 8, 9, 10]
new_list = [*num_list, *num_list_2]
print(new_list) # [1,2,3,4,5,6,7,8,9,10]
阅读全文 »

1.参数的默认值

1
2
3
def search4letters(phrase: str, letters: str = 'aeiou') -> set:
"""在指定字符串中找到输入的字母"""
return set(letters) & set(phrase)
阅读全文 »

一、语法

1
lambda argument_list:expersion

注意1:lambda函数体只能写一句话

注意2:不支持赋值语句,如下代码报错

1
func01 = lambda p: p = 10
阅读全文 »

文/雨令

有的人在十年前买了好几套房,结果成了千万富翁,有的人在前几年进了股市,结果却一贫如洗。

有的人顺风顺水步步高升一路躺赢,也有的人忙忙碌碌东奔西走依然举步维艰。

每个人一路走来,都在做着这样或那样的选择,你选择上学,他选择出国,你选择上班,他选择创业,那些看似不经意的选择,总是会在往后很长的一段时间里左右着我们的命运起伏。

阅读全文 »

今天是大年初一,虽然一个多礼拜没洗澡了,但身上的水痘好多了,趁着有大块的空闲时间,来写写年终总结。

阅读全文 »

Some differences from dict still remain:

  • The regular dict was designed to be very good at mapping operations. Tracking insertion order was secondary.
  • The OrderedDict was designed to be good at reordering operations. Space efficiency, iteration speed, and the performance of update operations were secondary.
  • The OrderedDict algorithm can handle frequent reordering operations better than dict. As shown in the recipes below, this makes it suitable for implementing various kinds of LRU caches.
  • The equality operation for OrderedDict checks for matching order.
    阅读全文 »