linux下lamp的apache2相关配置
直接通过System => Administration => Synaptic Package Manager安装好lamp包后基本不用做什么配置,把网站文件夹link (ln) 或者直接copy (cp) 到/var/www文件夹下。
添加默认字符编码方式:
在/etc/apache2.conf内
添加
AddDefaultCharset GBK
AddDefaultCharset GB2312
重启apache2:
sudo /etc/init.d/apache2 restart
另外一条虽然和lamp无关但很有用的命令,改变文件/文件夹权限:
sudo chmod [-R] xxx filename
-R 用于改变文件夹权限。
openCV生成灰度图像示例
临时用到,对openCV还不熟,慢慢研究。
#include "cxcore.h"
IplImage* pImg = cvCreateImage( cvSize( width, height ), 8, 1 );
cvZero( pImg );
for (int i = 0; i < width; ++i)
for (int j = 0; j < height; ++j)
{
CvPoint pt = cvPoint(i, j);
uchar* temp = &((uchar*)(pImg->imageDate /* +distance */))[pt.x];
temp[0] = static_cast<int>( value(0~255) );
}
cvSaveImage( filename, pImg);
cvReleaseImage(&pImg);
iterator assert after inserting in the vector
When I try to use iterator to insert elements in a vector continuously, the iterator becomes invalid and it displays a dialog box at run time. The reason is as following. (see the original)
VC++”C1859”预编译头文件错误
继上回VC++”PRJ0008″or”C2471″or”C1083″or”D8022”or"LINK1103″等编译错误的解决方法,今天又遇到“C1859”预编译头文件错误。详细的解释及处理方法见这里。下文转自msdn的blog。不过实际上我在补丁无法更新后索性重启然后发现就没问题了,比较诡异。建议首先尝试reboot。原文中的comments里有些有价值的信息。
转Google和各种网站的IPv6服务的hosts
#Google和各种网站的IPv6服务hosts
#利用IPv6技术翻墙,保证Google服务可用,校园网用户使用 IPv6应该不收取上网费用(至少我们学校如此)
#最下方有各种网站的IPv6hosts列表
#本文的发布地址:http://docs.google.com /View?id=dfkdmxnt_61d9ck9ffq
#本文的共享链 接:http://docs.google.com /Doc?docid=0ARhAbsvps1PlZGZrZG14bnRfNjFkOWNrOWZmcQ&hl=zh_CN
#表格版的host列表地 址:http://spreadsheets.google.com /ccc?key=0AhhAbsvps1PldEVXVzBkR3hBaWFnbEQ0OWIwMU5ycmc&hl=zh_CN
# 大幅更新!请往下 看!所有GoogleIPv6地址变更!支持https加密!
VC++”PRJ0008″or”C2471″or”C1083″or”D8022″or”LINK1103″等编译错误的解决方法
google“没有”,你会发现……
有消息称4月10日左右google将撤离中国市场,下周可能会发布一个声明。本人平常学习工作对google的依赖性还是很强的,使用百度往往是在娱乐类新闻的时候,或者看看某所谓百科,贴吧的时候信息比较简单易懂。如果只是撤离了cn还可以接受,但如果google.com被GFW了,那确实让人比较麻烦。
至于google “没有”,会有什么结果……

