摘要: 简单的说 log4j2 是log4j的升级版,解决了部分性能和死锁问题,其使用方式与使用配置与log4j相同。 建议使用maven依赖直接使用log4j2 <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log 阅读全文
posted @ 2017-05-17 00:00 haiyupeter 阅读(2857) 评论(0) 推荐(0) 编辑
摘要: 1、反向代理 反向代理是指想访问目标机器,但无法直接访问,此时,可以通过与目标机器相同网络段的机器做桥接,通过访问桥接机器,访问目标机器,称为反向代理。 vi httpd.conf 将代理配置开放: LoadModule proxy_module modules/mod_proxy.so LoadM 阅读全文
posted @ 2015-01-14 10:22 haiyupeter 阅读(187) 评论(0) 推荐(0) 编辑
摘要: default:构建(Build) validate:验证项目是否正确,所有必需的信息是否可用。 compile:编译项目中的代码。 test:用相关的单元测试框架测试编译后的代码,这些运行的测试并不会随项目打包和布署。 package:将编译后的代码打包成相应的格式文件,如jar包。 integr 阅读全文
posted @ 2015-01-07 08:41 haiyupeter 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 模板定义函数模板:template <typename T> T fun_name(const T&, const T&);类模板:template <typename T> class class_name { public: T t; void test(const T& t); }模板规则类模板作用域在模板定义的整个过程类模板不能重复可以只声明,不定义 形参必需带上typename 或者 class实例化int a = fun_name(3, 4);class_name<int> c1;实例化时机在函数调用或者类实例构建时实例化 阅读全文
posted @ 2012-09-15 00:28 haiyupeter 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 重载操作符重载操作符的定义重载操作符是具有特殊名称的函数:保留字operator后接需定义的操作符符号。如:Sales_item operator+(const Sales_item&, const Sales_item&);class Sales_item{public: Sales_item operator+(const Sales_item & s1, const Sales_item s2) { Sales_item item; item.age = s1.age + s2.age; return item; }private:}重载操作符设计原则1.不要重载 阅读全文
posted @ 2012-09-14 00:48 haiyupeter 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 结构体结构体声明 struct 结构体标签{ 成员变量; } 结构体变量;结构体定义#include <stdio.h>#include <string.h>struct user { int count; char name[20];}leader[3]={0, "Li", 0, "Zhang", 0, "Fun"};int main(int argc, char *args[]) { int i; for (i = 0; i < 3; i++) { printf("%s\n", l 阅读全文
posted @ 2012-09-09 17:18 haiyupeter 阅读(503) 评论(0) 推荐(0) 编辑
摘要: 转载来源:http://www.cppblog.com/prayer/archive/2009/06/01/86402.html####################################### Copyright (c) 1997 George Foot (george.foot@merton.ox.ac.uk)# All rights reserved.#######################################目标(可执行文档)名称,库(譬如stdcx,iostr,mysql等),头文件路径DESTINATION := testLIBS :=INCLUDES 阅读全文
posted @ 2012-09-07 00:39 haiyupeter 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 指针概念 程序运行的数据存储于内存中,以唯一的地址编号标识存储,称为内存地址。指针变量是指的是存储了内存地址的变量。指针声明 int *temp; int *temp;中的temp是变量名,*temp这样代表的是temp所指向的值(*:指针运算符,取其指向的内容)指针定义 int count = 5; temp = &count; (&表示取变量的地址符) 不可以将变量直接赋值给指针,比如int *temp = 5;报错指针类型 指向变量 前面的指针声明与定义已经说明 数组指针 数组名表示数组中首元素的地址。 如:int a[10]; 那么a表示首元素地址,即... 阅读全文
posted @ 2012-09-07 00:34 haiyupeter 阅读(179) 评论(0) 推荐(0) 编辑
摘要: C的位处理包括6类:& 按位与|按位或~非^异或<< 左移>> 右移& 按位与:相应位数含0,则该位置0 00101110 & 01100101结果00100100| 按位或:相应位数含1,则该位置1 00101110 | 01100101结果01101111~ 非:若位数为1,则置为0;若为0,则置1 ~00101110结果11010001^ 异或:不同位置1,相同位置0 00101110 | 01100101结果01001011<< 左移:缺少位数补000101110 << 1结果01011100>> 右移 阅读全文
posted @ 2012-09-05 10:32 haiyupeter 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 动态库头文件:sales_item.h 编译动态链接库 sales_item.cpp: #编译源文件 g++ -c sales_item.cpp -o bin/sales_item.obj #编译动态链接库 g++ -shared -o bin/sales_item.so bin/sales_ite 阅读全文
posted @ 2012-09-04 20:40 haiyupeter 阅读(270) 评论(0) 推荐(0) 编辑