写在前面:
最近在写前端,感觉代码在页面不断堆积,以后维护和扩展也是一件头疼的事,对于做过几年后端开发的我来说,不合理的代码组织就像乱糟糟的房间一样看的难受,现在有必要学习这个框架了.
写在前面:
最近在写前端,感觉代码在页面不断堆积,以后维护和扩展也是一件头疼的事,对于做过几年后端开发的我来说,不合理的代码组织就像乱糟糟的房间一样看的难受,现在有必要学习这个框架了.
The multiprocessing library gives each process its own Python interpreter and each their own GIL(Global Interpreter Lock).
allows you to create programs that can run concurrently (bypassing the GIL)
use the entirety of your CPU core
import multiprocessing
def concurrent_multi_process():
dids = []
with concurrent.futures.ProcessPoolExecutor() as executor:
results = executor.map(call_out_data, dids)
def call_out_data(did):
requests.adapters.DEFAULT_RETRIES = 5
url = "http://202.205.91.21:60001/nrmv/canInfo"
headers = {
'Content-Type': 'application/json'
}
payload = json.dumps(
{
'appId': "",
"did": did,
"startTime": 'test',
"endTime": '20220610000000',
"limit": 1000000000,
"nextPageStartRowKey": "",
"reverse": 'false',
"showColumns": ["`did`", "`3014`", "`2602`", "`2603`", "`2204`"],
"token": ""
})
response = requests.request("POST", url, headers=headers, data=payload)
print(response)
if (response.status_code == 200 and 'data' in response.json()):
data = response.json()['data']
return data
it’s perfect for I/O operations such as web scraping because the processor is sitting idle waiting for data.
import threading
def thread_process():
dids = []
with concurrent.futures.ThreadPoolExecutor() as executor:
results = executor.map(call_out_data, dids)
pip install XXX
pip3 install XXX
sudo pip3 install XXX
python -m pip install XXX
python3 -m pip install XXX
conda install -c anaconda XXX
sudo pip3 install XXX
If the “No module named ‘XXX’” error persists, try restarting your IDE and development server / script.
You can check if you have the XXX package installed by running the pip show XXX command.
pip3 show XXX
python3 -m pip show XXX
The pip show XXX command will either state that the package is not installed or show a bunch of information about the package, including the location where the package is installed.
If the package is not installed, make sure your IDE is using the correct version of Python.
If you have multiple Python versions installed on your machine, you might have installed the XXX package using the incorrect version or your IDE might be setup to use a different version.
For example, In VSCode, you can press CTRL + Shift + P or (⌘ + Shift + P on Mac) to open the command palette.
Then type “Python select interpreter” in the field.
Your IDE should be using the same version of Python (including the virtual environment) that you are using to install packages from your terminal.
pip3 show XXX
python3 -m pip show XXX
pip3 uninstall XXX
python3 -m pip uninstall XXX
pip3 install XXX
python3 -m pip install XXX
A E I O U 五个 vowel sound 的 long 和 short 发音规则和区别,特别要注意 short i 的发音规则
L 发音要注意的问题,注意 L 在单词不同位置的发音区别
B & P 发音的发音区别
Th 发音练习
V 发音练习
Word | A | E | I | O | U |
---|---|---|---|---|---|
Long | late [leɪt] | Feet [fiːt] | Fight [faɪt] | Phone [fon] | Cute [kjuːt] |
Short | Bat [bæt] | Bet [bet] | bit [bɪt] | bot [bɑt] | but [bʌt] |
Long VS Short:
1 | ship[ʃɪp] vs sheep[ʃip] |
1 | Long I: |
1 | It’s a very short i sound. It should only last a second or less. |
L 音可以是 Light L (一般在一个单词的前面),比如:Love, like, life,还可以是 Dark L(一般在单词的后面),比如:apple,feel,special,real, health, style, tall, girl
Light L:
I like to learn languages.
Lisa loves Lary a lot.
This is a long Blog about Learning.
Dark L:
It is a really good deal.
he small ball fell in the cool pool.
The small ball fell in the cool pool.
call the tall girl.
Light L & Dark L:
please leave the whole glass of milk on the table.
look at the really little flag.
I will list all of the final details in my letter.
Please send the last email to my family.
Th ð 音常见的单词有: This, That, Those, Other
Th θ 音(Unvoiced sound),首先 TH $\neq$ S
发音不对可能造成的误解,比如:
Think VS Sink
Thing VS Sing
Faith VS Face
比如单词相似发音区别很大的音
Breathe VS Breath
Bath VS Bath
Clothe VS Cloth
tips:
1 | 首先 Voiced 和 Unvoiced 区别在于手放到脖子上是否震动的感觉,而Unvoiced 气息 |
Voiced: Big, Boy, By,Th ð 音
Unvoiced:Pig, Pay,Pie,Th θ 音
Voiced | Big | Buy | Bear | Bet | Bill | Cub | Bland | Bride | Pub | Robe | Cab |
---|---|---|---|---|---|---|---|---|---|---|---|
Unvoiced | Pig | Pie | Pear | Pet | Pill | Cup | Planned | Pride | Pup | Rope | Cap |
有个简单的绕口令和 W 音进行区分,:Kiss your W’s(么么哒的姿势),Bite your V’s(上齿能碰到下嘴唇,下唇和下齿相平行)
V 音 | Very | Vine | Vent | Vest | Verse | Vin |
---|---|---|---|---|---|---|
W 音 | Wary | Wine | Whale | West | Worse | Win |
tips:
1
V 音不管在单词哪个位置(前中后)的发音都是一样
破损类型 | 外观描述 | 破损程度 | 换算系数 |
---|---|---|---|
横向裂缝 | 轻:少分支、缝隙小、缝壁无散落; 中:少分支、缝隙较小、缝壁散落轻微; 重:少分支、缝隙较大 |
轻/中/重 | 0.6/0.8/1.0 |
纵向裂缝 | 轻:少分支、缝隙小、缝壁无散落; 重:少分支多、缝隙较大、缝壁散落严重 |
轻/重 | 0.2/ 0.4 |
网状裂缝 | 轻:缝细、缝壁无散落、变形不明显; 重:网格众多、缝壁散落严重、缝隙较大 |
轻/重 | 0.4/0.6 |
块状裂缝 | 轻:缝细、缝壁无散落、块状大; 重:缝宽、缝壁散落严重、块状小 |
轻/重 | 0.2/0.4 |
$$g(x,y)=\frac{Y_{b}-Y_{a}}{X_{b}-X_{a}}\left[f(x,y) - X_{a}\right] + Y_{a}$$
#### 直方图均衡化利用图像直方图对对比度进行调整,在路面裂缝图像中,路面背景与裂缝的对比度相对较为接近。直方图均衡化对图像进行非线性拉伸,重新分配图像像素值,而把给定的直方图分布变成均匀分布的直方图。在相对信息量较大的图像中,通过将图像的对比度增强达到数据图像清晰度增加的目的。该方法较为直观,而且操作具有可逆性,可以恢复原始的直方图。
#### 中值滤波对噪声有良好的滤除作用,能够有效的保护信号的边缘。在路面裂缝图像采集过程中,由于各种各样噪声的影响不仅不利于影响了训练速度的提升也严重干扰了图像的特征提取。中值滤波是基于排序统计理论的一种能有效抑制噪声的非线性信号处理方法,能够很好地抑制图像中的噪声。
#### 形态学图像处理方法可以有效的解决形状识别、抑制噪声、纹理分析、边缘检测、图像压缩等问题,主要以几何结构为基础,且提取的边缘较为光滑,断点少,可以有效的保持原始图像,而能否有效的提取信息的关键在于结构元的选择,结构元的选择必须比原图像要简单并且有边界。路面裂缝图像经过灰度变换、直方图均衡化和中值滤波处理后仍然会存在孤立的噪声点或者细小的裂缝,为了减弱噪声点和细小裂缝对路面图像特征提取的影响需要使用形态学处理方法消除这些噪声点和连接细小裂缝。
[1] MOHAN A, POOBAL S. Crack detection using image processing: a critical review and analysis[J]. Alexandria Engineering Journal
[2] JIANG Ming-hu, GIELEN G, DENG Bei-xing, et al. A fast learning algorithm for time-delay neural networks[J].Information Science,2002,148(1-4):27-39
创建一个 Service 层的 class 并且在应用中高效的使用
暴露出一个用 Service 层做的 API
下面介绍的这个方法展示了使用 service 利用 discount 来建立一组 discount
1 | public with sharing class OpportunitiesService |