原创 VS 編譯lua庫
自己瞎倒騰半天,不如去看看別人怎麼做 http://m.blog.csdn.net/article/details?id=52401807
原创 centos安裝redis問題
裝redis,make test後報錯。網上查了下原因,發現不能用root賬戶make test。後面用普通用戶make test,用root用戶 make install。不再報錯安裝成功。
原创 C++標準庫利用仿函數爲map提供排序規則
#include <iostream> #include <iomanip> #include <map> #include <string> #include <altorithm> using namespace std; class
原创 SINGLETON宏定義淺析
強弱引用 singleton模式的宏定義 factory模式 單例類的使用 #include "boost/shared_ptr.hpp" #include "boost/make_shared.hpp
原创 字符設備 register_chrdev_region()、alloc_chrdev_region() 和 register_chrdev()
1. 字符設備結構體 內核中所有已分配的字符設備編號都記錄在一個名爲 chrdevs 散列表裏。該散列表中的每一個元素是一個 char_device_struct 結構,它的定義如下: static struct char_d
原创 private_data
http://tsecer.blog.163.com/blog/static/15018172012225103242956/ 一、epoll實現原理及回調機制epoll是對select系統調用的改善,適用於同時關注文件比較多的時
原创 用new來分配在棧上的空間
首先傳入了T1類型的一個指針。new(p) T1();的意思是從p地址開始new出空間構造T1對象,因爲p地址是在棧上,所以當離開p的函數作用域,new出來的空間就自動解析掉了。相當於用new在棧上分配了空間。看着像雜技哈。
原创 一個實現智能指針的例子《還不完善》
#ifndef COUNTED_PTR_HPP #define COUNTED_PTR_HPP templete <class T> class CountedPtr{ private: T * ptr;
原创 mongo 圖形客戶端解決無法添加拷貝數據庫問題
首先在admin數據庫驗證db.auth(“yonghuming”,”mima”) 然後添加添加用戶對要操作數據庫的權限 db.grantRolesToUser( “yonghuming”, [“readWrite”,{role:
原创 開始學設計模式啦。
設計模式。