Requests (http 請求庫)
pip install requests
Selenium (web 應用程序測試工具)
pip install selenium
瀏覽器驅動
Requests (http 請求庫)
pip install requests
Selenium (web 應用程序測試工具)
pip install selenium
瀏覽器驅動
安裝 docker (參考)
sudo apt-get update
1. 安裝允許 apt 通過 https 協議使用存儲庫
sudo apt-get install apt-transport-https
sudo apt-get install ca-certificates
sudo apt-get install curl
sudo apt-get install gnupg-agent
sudo apt-get install software-properties-common
2. 添加 docker 官方的 gpg 密鑰
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
確認密鑰添加成功
abc@ubuntu:/extspace/src$ sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) <docker@docker.com>
sub rsa4096 2017-02-22 [S]
添加 Stable 版本的存儲庫
sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
or
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
安裝 Docker CE
sudo docker pull registry.cn-hangzhou.aliyuncs.com/steamboat/steamboat:sp1
sudo docker pull registry.cn-hangzhou.aliyuncs.com/steamboat/steamboat:sp2
sudo docker pull registry.cn-hangzhou.aliyuncs.com/steamboat/steamboat:sp3
abc@ubuntu:/extspace/src/python_bug$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest d1165f221234 10 months ago 13.3kB
registry.cn-hangzhou.aliyuncs.com/steamboat/steamboat sp1 9b5cc6bd42d0 2 years ago 111MB
registry.cn-hangzhou.aliyuncs.com/steamboat/steamboat sp3 5c75ec9ef2b6 2 years ago 936MB
registry.cn-hangzhou.aliyuncs.com/steamboat/steamboat sp2 0487eb7998d9 2 years ago 936MB
開 port
event.stopPropagation() 為了阻止事件繼續冒泡
event.preventDefault() 停止事件的默認動作
stopImmediatePropagation() 讓其他同一層級的 listener 也不要被執行
input 停止輸入 key
主要加上 evt.preventDefault()
=============================================
checkSkipKey(evt) {
let time = new Date().getTime()
let key = evt.keyCode
if((REPEAT_KEY_TIME > (time - this._timeStamp)) && (key == this._previousKey)) {
this.log.show(this.debug_info,'skip key time - this._timeStamp:', time - this._timeStamp)
return true
}
this._previousKey = key
this._timeStamp = time
return false
}
if(this.checkSkipKey(evt)) {
if (!!evt) {
evt.preventDefault()
if(typeof evt.stopImmediatePropagation === 'function') {
evt.stopImmediatePropagation()
} else {
evt.stopPropagation()
}
}
return
}
=============================================
简化一些 C++ 编程任务的执行,还有一些任务,如动态内存分配,没有指针是无法执行的
&
不要都念成 and,涉及指標操作的時候,要讀為 “address of”
在 開發工具和規格標準 篇提過參考第一手資料的重要性,以下 ISO/IEC 9899 (簡稱 “C99”)和指標相關的描述:
規格書 (PDF) 搜尋 “object”,共出現 735 處
&
不要都念成 and,涉及指標操作的時候,要讀為 “address of”
C99 [3.14] object
C99 [6.2.5] Types
注意到術語!這是 C 語言只有 call-by-value 的實證,函式的傳遞都涉及到數值
這裡的 “incomplete type” 要注意看,稍後會解釋。要區分char []
和char *
注意 “scalar type” 這個術語,日後我們看到
++
,--
,+=
,-=
等操作,都是對 scalar (純量)
[來源] 純量只有大小,它們可用數目及單位來表示(例如溫度 = 30oC)。純量遵守算數和普通的代數法則。注意:純量有「單位」(可用
sizeof
操作子得知單位的「大小」),假設ptr
是個 pointer type,對ptr++
來說,並不是單純ptr = ptr + 1
,而是遞增或遞移 1 個「單位」
這是 C/C++ 常見的 forward declaration 技巧的原理,比方說我們可以在標頭檔宣告
struct GraphicsObject;
(不用給細部定義) 然後struct GraphicsObject *initGraphics(int width, int height);
是合法的,但struct GraphicsObject obj;
不合法
這句話很重要,貌似三個不相關的術語「陣列」、「函式」,及「指標」都歸類為 derived declarator types,讀到此處會感到驚訝者,表示不夠理解 C 語言
int main() {
typedef void (*funcptr)();
(* (funcptr) (void *) 0)();
}
What is the last (int)
doing?
Consider the signal()
function from the C standard:
void ( *signal(int sig, void (*handler)(int)) ) (int);
The whole thing declares a function called signal
:
signal
takes an int and a function pointerint
and returns void
signal
returns a function pointerint
and returns a void
That's where the last int
comes in.
signal -- signal
signal( ) -- is a function
signal( sig ) -- with a parameter named sig
signal(int sig, ) -- of type int
signal(int sig, handler ) -- and a parameter named handler
signal(int sig, *handler ) -- which is a pointer
signal(int sig, (*handler)( )) ) -- to a function
signal(int sig, (*handler)(int)) ) -- taking an int parameter
signal(int sig, void (*handler)(int)) ) -- and returning void
*signal(int sig, void (*handler)(int)) ) -- returning a pointer
( *signal(int sig, void (*handler)(int)) )( ) -- to a function
( *signal(int sig, void (*handler)(int)) )(int) -- taking an int parameter
void ( *signal(int sig, void (*handler)(int)) )(int); -- and returning void
You can use the spiral rule to make sense of such declarations, or the program cdecl(1)
If you write:
typedef void (*SignalHandler)(int signum);
then you can instead declare
signal()
as:
extern SignalHandler signal(int signum, SignalHandler handler);
科技公司面試題:
void **(*d) (int &, char **(*)(char *, char **));
上述宣告的解讀:
- d is a pointer to a function that takes two parameters:
- a reference to an int and
- a pointer to a function that takes two parameters:
- a pointer to a char and
- a pointer to a pointer to a char
- and returns a pointer to a pointer to a char
- and returns a pointer to a pointer to void
【n8n免費本地端部署】Windows版|程式安裝x指令大補帖 【一鍵安裝 n8n】圖文教學,獲得無限額度自動化工具&限時免費升級企業版功能