08 2013 档案
摘要:http://www.nubaria.com/en/blog/?p=289#pragma execution_character_set("utf-8")
阅读全文
摘要:与C++,C#不同,java的写入字节顺序是从高到低(左低到右高)例如 内存数据:{ 0x67,0x45,0x23,0x01} ,java int值是:0x6745231 而C++是:0x1234567这种差异会导致 非java客户端 解释 mina TCP header 时, 出现长度错误 ,所以要把java int长度转换成c++的int cppInt=0x04000000;byte[] targets = new byte[4];targets[0] = (byte) (res & 0xff);// 最低位targets[1] = (byte) ((res >> 8)
阅读全文
摘要:URL_MODEL=2下。官方的:app.conf不能用,害人呀。。留意以下红色部分,正则要分开来写,坑爹的正确的配置:handlers:handlers: - expire : .jpg modify 10 years - expire : .swf modify 10 years - expire : .png modify 10 years - expire : .gif modify 10 years - expire : .JPG modify 10 years - expire : .ico modify 10 years - url : (.*\.(ico|css|htm|js|
阅读全文
摘要:在Linux(以Redhat Linux Enterprise Edition 5.3为例)下,有时需要编写Service。Service也是程序,一般随系统启动用户不干预就不退出的程序,可以称为Service。Linux下的Service一般称为Daemon。以上是广义的Service的定义。Linux下的服务一般放在/etc/init.d文件夹下。浏览一下这个文件夹下的文件,可以发现在Linux下编写Service一般遵循的原则。Linux下编写Service一般遵循的原则1)真正运行的Service一般放在某个bin目录下(/bin,/usr/bin,etc)。2)/etc/init.d
阅读全文
摘要:配置log4j注意事项:Log4J 1.2users:slf4j-api.jar,slf4j-log4j12.jar, andLog4J1.2.xslf4j-log4j*.jar 要对应Log4J的版本
阅读全文
摘要:Mysql 5.1 遇到的信息包过大问题 用客户端导入数据的时候,遇到错误代码: 1153 - Got a packet bigger than 'max_allowed_packet' bytes 终止了数据导入。当MySQL客户端或mysqld服务器收到大于max_allowed_packet字节的信息包时,将发出“信息包过大”错误,并关闭连接。对于某些客户端,如果通信信息包过大,在执行查询期间,可能会遇到“丢失与MySQL服务器的连接”错误。客户端和服务器均有自己的max_allowed_packet变量,因此,如你打算处理大的信息包,必须增加客户端和服务器上的该变量。一
阅读全文
摘要:如果直接这样写:std::vector> intvec;gcc编译器会把">>"当成operator,报错:boost vector error: ‘>>’ should be ‘> >’ within a nested template argument list正确做法是加上空格:std::vector > intvec;不过VS2010测试下不加空格也可以的。
阅读全文
摘要:JSON(JavaScript Object Notation)跟xml一样也是一种数据交换格式,了解json请参考其官网http://json.org,本文不再对json做介绍,将重点介绍c++的json解析库的使用方法。json官网上列出了各种语言对应的json解析库,作者仅介绍自己使用过的两种C++的json解析库:jsoncpp(v0.5.0)和Boost(v1.34.0)。一. 使用jsoncpp解析jsonJsoncpp是个跨平台的开源库,首先从http://jsoncpp.sourceforge.net/上下载jsoncpp库源码,我下载的是v0.5.0,压缩包大约107K,解压
阅读全文
摘要:how do I install all developer tools such as GNU GCC C/C++ compilers, make and others, after installing CentOS or RHEL or Fedora Linux from a shell prompt?You need to install 'Development Tools' group. These tools include core development tools such as automake, gcc, perl, python, and debugg
阅读全文
摘要:Mysql镜像机制配置过程主服务器: 192.168.0.25从服务器: 192.168.0.26MYSQL版本:mysql-5.0.22.tar.gz安装日期:2010年5月14日一、镜像机制简单介绍镜像机制是一种能够让运行在不同计算机上的两个或多个Mysql 服务器保持同步变化的机制。不同的数据库系统采用了不同的方法来建立镜像机制。mysql目前只支持“主-从”镜像关系,这种镜像关系的特点是:只有一台主控系统(可读/可写),所有的数据修改操作都必须在这台系统系统上进行,有一台或多台从属系统(只读),他们有着与主控系统完全一样的数据,主控系统在经过一个短暂的延迟后也将发生在他们身上;主从镜像
阅读全文
摘要:1、前言 目前从事于linux下程序开发,涉及到多个文件,多个目录,这时候编译文件的任务量比较大,需要写Makefile。关于Makefile的详细内容可以参考网上流传非常广泛的《跟我一起写Makefile》http://blog.csdn.net/haoel/article/details/2886/,作者是个大牛,非常佩服。2、简单测试 测试程序在同一个文件中,共有func.h、func.c、main.c三个文件,Makefile写法如下所示: 1 CC = gcc 2 CFLAGS = -g -Wall 3 4 main:main.o func.o 5 $(CC) mai...
阅读全文
摘要:# Disallow anonymous connections. Only allow authenticated users.NoAnonymous yes# If you want simple Unix (/etc/passwd) authentication, uncomment thisUnixAuthentication yes
阅读全文
摘要:sudo apt-get install mysql-server mysql-client指定mysql-lib位置:./configure --with-mysql-lib=/usr/lib/i386-linux-gnu/makesudo make install
阅读全文
摘要:sudo apt-get install libmysqlcppconn-dev
阅读全文
摘要:下面这个错误通常是因为链接选项里漏了-lrt,但有时发现即使加了-lrt仍出现这个问题,使用nm命令一直,会发现-lrt最终指向的文件 没有包含任何symbol,这个时候,可以找相应的静态库版本librt.a,看看它里面是否存在`clock_gettime'。/data1/mooon/run/lib/libsys.a(lock.o): In function `sys::CLock::timed_lock(unsigned int)':/data1/mooon/src/common_library/src/sys/./lock.cpp:101: undefined refere
阅读全文
摘要://*********list class.h**********class tdate {private:int month;int day;int year;public:tdate();tdate(int t_month, int t_day, int t_year) {……}//tdate(const tdate &obj)//{}void display();};//********list class.c++:************#include "class.h"void tdate::display() {int main(){tdate t1(
阅读全文
摘要:由于是Linux新手,所以现在才开始接触线程编程,照着GUN/Linux编程指南中的一个例子输入编译,结果出现如下错误:undefined reference to 'pthread_create'undefined reference to 'pthread_join'问题原因:pthread 库不是 Linux 系统默认的库,连接时需要使用静态库 libpthread.a,所以在使用pthread_create()创建线程,以及调用 pthread_atfork()函数建立fork处理程序时,需要链接该库。问题解决: 在编译中要加 -lpthread参数 g
阅读全文
摘要:gcc编译安装过程1.先安装三个库 gmp mprc mpc 这三个库的源码要到官网去下载1)安装gmp:首 先建立源码同级目录 gmp-build,输入命令,第一次编译不通过,发现缺少一个叫m4的东西 于是就用apt-get下载了一个,继续编译,没有报错。make的时候出现大量信息并且生成一些文件在当前文件夹下,之后用make check检查一下,最后用make install安装2)安装mpfr:首先建立源码文件夹同级目录mpfr-build然后进入该目录输入../mpfr-2.4.2/configure --prefix=/usr/local/mpfr-2.4.2 --with-gmp=
阅读全文
摘要:Fromthis answerto "Install gcc 4.7 on CentOS [6.x]", the easiest way to getg++4.7, and the required tools and libraries, for CentOS 5.x is via thedevtoolspackage:cd /etc/yum.repos.dwget http://people.centos.org/tru/devtools/devtools.repo yum --enablerepo=testing-devtools-5 install devtools
阅读全文
摘要:首先需要准备需要材料:gcc4.4.2版需要安装gmp4.2.0+和mpfr2.3.0+,到GMP的网站(http://gmplib.org/)上下载gmp-4.3.1.tar.gz 和mprf的网站(http://www.mpfr.org/)上下载mpfr-2.4.2.tar.gz分别解压缩tar zxvf gmp-4.3.1.tar.gztar zxvf mpfr-2.4.2.tar.gz解压之后, 文件夹名称为gmp-4.3.1和mpfr-2.4.2,按照下面步骤安装。1. 安装gmp:#cd gmp-4.3.1# ./configure# make# make check这一步用来查看
阅读全文
摘要:About Linux SwappingLinux RAM is composed of chunks of memory called pages. To free up pages of RAM, a “linux swap” can occur and a page of memory is copied from the RAM to preconfigured space on the hard disk. Linux swaps allow a system to harness more memory than was originally physically availabl
阅读全文
摘要:linux修改默认语言编辑/etc/sysconfig/i18n这个文件(不存在就新建一个),原内容如下:LANG="en_US.UTF-8"SYSFONT="latarcyrheb-sun16"
阅读全文
浙公网安备 33010602011771号