原创 三態內容尋址存儲器(TCAM)工作原理

CAM是Content Addressable Memory的縮寫,即“內容尋址存儲器”的意思,它是在傳統的存儲技術的基礎上實現的聯想記憶存儲器,關於CAM的基本操作有三種: 寫操作:輸入地址和數據,將數據寫到指定的地址上,寫入速度與RA

原创 程序員需要知道的SSD基本原理

轉自http://oserror.com/ 引言 SSD是目前商用服務器上非常流行的存儲介質,因此,作爲軟件開發人員,需要了解的SSD基本原理,以便開發時能更好地發揮其優勢,規避其劣勢。本文總結了作爲軟件開發人員需要了解的SSD基本原理,

原创 flask怎麼生成交互式API文檔(swagger)

用 flask_restx https://flask-restx.readthedocs.io/en/latest/index.html

原创 VScode Remote-SSH The active editor cannot provide outline information

需要在server上面安裝一個extension。  

原创 __attribute__((unused)) variable attribute

Normally, the compiler warns if a variable is declared but is never referenced. This attribute informs the compiler tha

原创 password hashing

今天科技助盲遇到Unicode-objects must be encoded before hashing的問題,debug的時候瞭解了一下password hashing,在這裏記錄一下。 服務器在數據庫一般不存儲用戶密碼,只存儲密碼

原创 Linux處理git diff尾部的^M

背景 在vim裏面複製了兩行。 git diff看的時候發現尾部有^M。 vim可以通過vi -b查看尾部的換行符。 經瞭解這是因爲windows用CR LF來換行,而Linux用LF來換行。我應該是打開了之前用windows的編輯的文件

原创 Ctrl+z掛起進程後如何恢復

1. Ctrl+z掛起進程 2. jobs查看被掛起的進程的作業號 3. bg恢復某個job到後臺 4. fg恢復某個job到前臺

原创 C語言部分初始化一個結構體

https://stackoverflow.com/questions/10828294/c-and-c-partial-initialization-of-automatic-structure In C, objects are ne

原创 getline(3) man手冊翻譯

GETLINE(3) 名字 getline, getdelim - delimited string input 概要 #include <stdio.h> ssize_t getline(char **lineptr, size_t *

原创 man 2 gettimeofday 翻譯

名字 gettimeofday, settimeofday - get / set time 概要 #include <sys/time.h> int gettimeofday(struct timeval *tv, struct ti

原创 man 3 system 翻譯

名字 system 執行一個shell命令 概要 #include <stdlib.h> int system(const char *command); 描述 system()庫函數用fork(2)創建一個子進程,這個子進程通過ex

原创 STDARG(3)翻譯

名字 stdarg, va_start, va_arg, va_end, va_copy可變參數列表。 概要 #include <stdarg.h> void va_start(va_list ap, last); type va_a

原创 strtok(3) man手冊翻譯

NAME strtok, strtok_r從字符串中提取符號組 概要 #include <string.h> char *strtok(char *str, const char *delim); char *strtok_r(char

原创 C語言函數參數,內存對齊問題

我們都知道C語言中,struct會做內存對齊,實際分配的內存出現比看上去的多。 C語言函數參數傳遞的時候也會有類似的情形。但這個和struct內存對齊(https://stackoverflow.com/questions/4306186