Linux 判断机器的字节顺序
#include <fcntl.h>
int main(void)
{
typedef union un{
short s;
char c[sizeof(short)];
}un;
un myun;
myun.s = 0x0102;
if(sizeof(short) == 2){
if(myun.c[0] == 1 && myun.c[1] == 2)
printf("big-endian\r\n");
else if(myun.c[0] == 2 && myun.c[1] == 1)
printf("little-endian\r\n");
else
printf("unkown\r\n");
}
return 0;
}
摘自《Unix 网络编程》
相关文档:
最近准备给公司的网站架构做下调整,安装部署新机器的时候遇到一些问题,nginx在安装的时候一直提示未找到openssl
./configure --prefix=/usr/local/nginx
程序代码
./configure: error: the HTTP cache module requires md5 functions from OpenSSL library. You can either disable the module by us ......
转自:http://www.oracle.com/technology/global/cn/pub/articles/calish-find.html
Linux Find 命令精通指南
作者:Sheryl Calish
简单介绍这一无处不在的命令的强大的方面以及混乱的方面。
2008 年 7 月发布
Linux find
命令是所有 Linux 命令中最有用的一个,同时也是最混乱的一个。它很难,因为它的语法与其他 ......
此处vmware版本为6.5 ,主机为windows xp,vmware 安装了redhat linux
1.网络设置:
打开vmware,点vmware->setting->Hardware->Newwork Adapter->Custom - >
VMnet1(host-only)
查看windows网络连接,看到一个VMnet1的连接,设置它的ip与子网掩码。如:IP:192.168.13.1 ,子网掩码 255.255.255.0 ......
原来likely和unlikely是用来编译优化的,其实都可以没有。我们知道很多cpu里面有告诉缓存,且有预读机制,likely和unlikely就是增加执行判断语句时的命中率。
如果是if(lilely(a)),说明a条件发生的可能性大,那么a为真的语句在编译成二进制的时候就应该紧跟在前面程序的后面,这样就会被cache预读取进去,增加程序执行 ......
转载自
http://blog.csdn.net/lyd518/archive/2008/08/19/2797134.aspx
1、
将文件checkout到本地目录
svn checkout
path(path是服务器上的目录)
例如:svn checkout svn:
//
192.168
.
1.1
/
pro
/
domain
简写:svn co
2、
往版本库中添加新的文件
svn
add
file
例如:svn
add
test.php ......