原创 常用容器的erase函數
測試環境是vs2013和gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 vector c++98 iterator erase (const_iterator position); iterator
原创 golang defer總結
A "defer" statement invokes a function whose execution is deferred to the moment the surrounding function returns, eit
原创 redis4.0.11整數集
typedef struct intset { uint32_t encoding; uint32_t length; int8_t contents[]; } intset; 結構體中定義了編碼大小、數據長度以
原创 redis4.0.11字符串
typedef char *sds; 雖然它是char指針類型,但是它可以存儲非打印字符。sdshdr一共有5個結構體,其中sdshdr5因爲可以存儲的內容太少不利於擴展,基本上是不用的。一開始看代碼的時候就想到一個問題,爲什麼要有5個
原创 redis4.0.11字典
typedef struct dictEntry { void *key; union { void *val; uint64_t u64; int64_t s64;
原创 redis4.0.11雙向鏈表
typedef struct listNode { struct listNode *prev; struct listNode *next; void *value; } listNode; typedef
原创 golang 構造函數
package main import ( "fmt" ) type test struct { a int b string } func newTest1(a int, b string) *test { t := n
原创 redis5.0.7zskiplist
typedef struct zskiplistNode { sds ele; double score; struct zskiplistNode *backward; struct zskiplist
原创 linux手動安裝apache服務器
網上很多人都寫過類似的文章,之前安裝過一次,這次第二次安裝還是總結一下 依賴1:apr 下載地址:http://apr.apache.org/download.cgi 解壓縮:tar -jxvf apr-1.5.2.tar.bz2 ./c
原创 hdu 1010 Tempter of the Bone
Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submiss
原创 hdu 1009 FatMouse' Trade
Sample Input 5 3 7 2 4 3 5 2 20 3 25 18 24 15 15 10 -1 -1 Sample Output 13.333 31.500 #include <iostream> #include <vec
原创 hdu 1008 Elevator
#include <iostream> #include <vector> using namespace std; class Elevator { public: void initialize(); void readCas
原创 linux手動安裝screen
今天聽說了screen工具,網上找了一下相關資料,感覺還不錯,就裝起來玩玩,剛剛開始接觸這個工具並不怎麼會用 http://ftp.gnu.org/gnu/screen/ 從這個網站上下載最新的screen,但是在安裝的過程中發現no t
原创 erlang 聊天室
服務端 -module(chatServer). -export([start/1]). start(Port) -> {ok, Listen} = gen_tcp:listen(Port, [binary, {active,
原创 簡單工廠
#include <iostream> using namespace std; class Operation { public: Operation() {} Operation(const double& dNumberOn