原创 c++ json cpp 解析
const char* str = "{\"jsonrpc\": \"2.0\",\"method\": \"find\",\"params\": [\"1 \"]}"; auto readerBuilder = Jso
原创 paxos 算法筆記
介紹:略 算法基本思路 角色解釋: proposer : 提議發起者 acceptor : 提議批准者 基本流程。 proposer 發起提議,寫入某一個值。 acceptor 接受值, 並返回接受或者失敗
原创 共識算法總結
共識名稱 介紹 優點 缺點 代表 proof of work,pow,工作量證明 帶計算的數據+隨機數進行 sha256 計算,得到一個結果,判斷前面0的個數。根據全網調節難度。 系統穩定,當全網算力高不易被被攻擊。 記賬成本高,
原创 boost 測試組件
1.測試代碼部分 #define BOOST_TEST_MODULE test_game_net #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_SUITE(test_net
原创 macos autogen.sh PKG_PROG_PKG_CONFIG macro not found
macos autogen.sh PKG_PROG_PKG_CONFIG macro not found 未找到文件: export ACLOCAL_PATH=/usr/local/Cellar/pkg-config/0.29.2/sha
原创 筆記 boost:: multi_index_container , lower_bound
#include <string> #include <iostream> #include <boost/multi_index_container.hpp> #include <boost/multi_index/member.hp
原创 ubuntu clang 8.0 編譯安裝
1.github 獲取最新源碼 https://github.com/llvm-mirror 2.獲取llvm。clang 到本地 3.先編譯llvm mkdir build cmake -DCMAKE_BUILD
原创 git 使用錯誤remote: Permission to xxx.git denied to xxxx
1.記錄git使用錯誤 看到錯誤原因, 估摸着應該是權限問題。 清空用戶目錄下配置的全局用戶名和密碼就可以。~/.gitconfig 重新push, 就會提示輸入用戶名和密碼了。
原创 c++ 不定參數模板, 待續
1.使用不定參數, 實現c++反射, 初步#include <boost/any.hpp> #include <map> #include <iostream> class test{ public: void add(int
原创 隨筆 獲取類型的名稱
#include <boost/core/demangle.hpp> namespace zero{ class test{ public: test(){} }; } int main
原创 筆記 linux tar命令行打包
1.解壓tar -zxvf xxx.tar2.壓縮tar -zcvf xxx.tar.gz folder
原创 筆記 git 使用
1.倉庫轉移代git clone http://urlgit push --mirror http://192.xxxxxgit clone http://192.xxxx2.commitgit commit -m "modify"3.p
原创 c++ boost 正則表達式驗證中文字符
boost::regex rg("^[a-zA-Z0-9_\u4e00-\u9fa5]+$"); boost::smatch sm; if(boost::regex_match( name, sm, rg )){
原创 筆記:代碼加載mainStory board
1.名稱和info.plist配置 UIStoryboard *board = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]]; UIView
原创 筆記 c++ mysql 數據庫連接
1.下載mysql 驅動 2.example code 。 Mysql 官網地址 int main(int argc, char *argv[]){ try { sql::mysql::MySQL_Drive