原创 通用單向鏈表和雙向鏈表

單鏈表 /*** module: singly linked list */ #ifndef __SLIST_H__ #define __SLIST_H__ typedef struct s_entry_s { struct s_e

原创 C語言提取字符串中的內容

int main() { char *src = "1998-08-09"; char year[10]; char month[10]; char day[10]; sscanf(src, "%[^-]-%[^-]-%

原创 【數據結構】如何寫好面試中的鏈表【上】

相信很多剛找工作時的同學,都遇到過面試時被問鏈表的情景,有些面試官還喜歡直接要你在紙上寫。今天,就給大家詳細講解下鏈表。 鏈表實現了物理存儲上非連續,可以通過當前節點索引下一個節點,最後一個元素爲空,在C語言實現上,用指針來索引下

原创 android 編譯 tassl

#!/bin/bash # Cross-compile environment for Android on ARMv7 # # Contents licensed under the terms of the OpenSSL lice

原创 boot.asm OS引導程序

直接上源代碼了。   org 0x7c00 start: mov ax, cs ;; 實模式 cs 爲 零 mov ss, ax ;; mo

原创 scl cmap 的實現

數組bucket_array掛鏈表的形式,數組的每個下標當着一個hash 值。 一個鍵hash 完之後,與 數組大小進行取餘,得到的數字就是數組的小標,新的節點就往下掛載節點。 #ifndef __CMAP_H__ #define

原创 nginx-1.12.1代碼移植

提取代碼中的數據結構,用於自身的項目。 代碼地址: https://gitee.com/jesson-deng/nginx1.12.1-transplant

原创 cmake 模板

不斷更新中 https://github.com/jxdeng3264/cmake-module

原创 nginx 自定義 etag算法爲文件md5

這裏有篇關於 etag 的文章。https://www.cnblogs.com/yangguoe/p/8462566.html 實現代碼如下: https://github.com/jxdeng3264/nginx-static-etag

原创 nginx疑問

1. ngx_log_error  write 之後爲什麼不用 close ? 2.

原创 nginx源碼閱讀

1. 模塊是怎麼加載的 2. log 日誌是怎麼處理的 3. 連接是怎麼產生的 4.怎麼連接後臺業務服務器的 5.

原创 mac 下編譯 tassl,arm64 armv7 armv7s 架構

由於官方都沒有相應的編譯腳本,自己也摸索了好久,特意記錄下來。 源碼目錄  TASSL-xx 腳本文件  compile-v7.sh  compile-v7s.sh  compile-arm64.sh 內容如下: #!/bin/bash

原创 [nginx] 編譯

這裏提到的代碼和腳本都是在 倉庫 https://gitee.com/jesson-deng/nginx-1.12.2-code-reading.git 中。 ./configure: error: ngx_http_lua_m

原创 開門與關門人HDOJ

題目鏈接 http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=1&sectionid=3&problemid=7 #include <iostream> using

原创 一段簡單高效的冒泡排序代碼

這段代碼思路是一個朋友在羣裏分享的,我簡單看了下,發現思路真的很好。 下面是我的簡化版,先給貼出代碼。 void bubble_sort(vector<int> &vec) { int i = 0; while (i < ve