自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 LRUCache

#include #include #include #include #include #include #if 0typedef struct lru_data{ int key; int val; lru_data(int k, int v) : key(k), val(v) { }}lru_data_t;class is_key_equa

2014-01-21 10:37:06 10332

原创 mysql远程登录

新装的mysql,默认是不能远程登录的,首先检查网络相关netstat -an | grep 3306tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN说明其邦定的是回路ip,将/etc/mysql/my.cnf  里的bind-address           = 127.0.

2014-01-11 09:37:17 494

原创 有关ulimit命令

ulimit与当前shell对话打开的文件数目相关,>ulimit -n :可以查询最大的数目。如1024如果打开的文件数太多,会报错误:too many open files 。临时修改此值:ulimit -n 2048但是一般用户没有权限设置较大的值。在root用户下可以设置的最大值是:1048576(ulimit  -n 1048576)在linux下要注意,

2013-12-29 23:11:55 788

原创 U盘安装ubuntu-12.04.2-server-amd64

1、用一种工具将 ubuntu-12.04.2-server-amd64.iso写进U盘,工具有很多种,如unetbootin-windows-583.exe。2、将U盘插入电脑,并由U盘启动。3、安装过程与光盘过程类似。4、到检测光盘这一步时会报错,此时将U盘拨出,重新插入。5、重新检测光盘。6、直到结束,安装成功。

2013-12-23 15:27:42 1412

原创 根据域名获取IP地址

#include #include #include /* See NOTES */#include #include #include #include #include #include #include #include int main(){ struct hostent* host = gethostbyname("www.o

2013-12-20 18:17:36 589

原创 WinSock I/O 模型

1、select 模型int select( _In_ int nfds, _Inout_ fd_set *readfds, _Inout_ fd_set *writefds, _Inout_ fd_set *exceptfds, _In_ const struct timeval *timeout); eg:获取读集fd_se

2013-11-14 16:57:51 895

原创 SYSTEMTIME相关

最近写了一些SYSTEMTIME相关的程序,贴上来,欢迎拍砖。#include #include #include #include bool String2SystemTimeW(const WCHAR* pszstring23, SYSTEMTIME& st){ int nLen = wcslen(pszstring23); int nYear, nMonth,

2013-11-14 14:37:18 1586

原创 3byte特定格式小数转换成double

有个同事最近在测试硬件的性能,获取到一系列的字节流,要我把其转换成10进制实数,让他方便对这些数据进行研究。于是乎,写了此文。刚开通博客,就搬上来了。 该系列字节流,3位一体,前3bit表示实数的整数部分,后21bit表示小数部分,其数值范围为[0, 8)。如 1F 62 40 ,表示的数值为:0.980743408203125000000。 如果将此数直接对齐到float,这

2013-11-14 10:21:13 1796

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除