<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="0.92">
<channel>
	<title>浏忙大爆炸</title>
	<link>http://blog.waterlin.org</link>
	<description>源于理工科男的烂笔头情结</description>
	<lastBuildDate>Sat, 26 May 2012 06:30:50 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	<!-- generator="WordPress/3.1.3" -->

	<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/xml" href="http://feeds.feedburner.com/WaterDrop" /><feedburner:info uri="waterdrop" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>C# 应用程序里内嵌网页服务器(Embed server)方法汇总</title>
		<description>最近在用 C# 做一个应用，并且想在这个应用程序里内嵌一个网页服务器，这样用户可以直接通过网页地址来访问相关的功能。 调研了一下，以下几种方法比较流行： cassinidev System.Net.HttpListener 用 IIS Express 综合感觉了一下，我选用第2种方法，应用起来更灵活，还可以回味一下写代码的快感^_^&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WaterDrop?a=8SZaDIG4NRw:sFtaCmPnPzA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WaterDrop?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WaterDrop/~4/8SZaDIG4NRw" height="1" width="1"/&gt;</description>
		<link>http://feedproxy.google.com/~r/WaterDrop/~3/8SZaDIG4NRw/c-sharp-embeded-server.html</link>
			<feedburner:origLink>http://blog.waterlin.org/articles/c-sharp-embeded-server.html</feedburner:origLink></item>
	<item>
		<title>SSE2 instruction set not enabled</title>
		<description>在 Linux 下用 GCC 编译 C++ 代码，提示类似 SSE2 instruction set not enabled 这样的错误，则可以在 GCC 里添加参数来完成编译： -msse2&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WaterDrop?a=gl05WGGGK4U:mZQrwsSCR9g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WaterDrop?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WaterDrop/~4/gl05WGGGK4U" height="1" width="1"/&gt;</description>
		<link>http://feedproxy.google.com/~r/WaterDrop/~3/gl05WGGGK4U/sse2-instruction-set-not-enabled.html</link>
			<feedburner:origLink>http://blog.waterlin.org/articles/sse2-instruction-set-not-enabled.html</feedburner:origLink></item>
	<item>
		<title>Mac 绝对是装B利器</title>
		<description>电视剧里都是这样，Mac是用来装的，而不是用的~~ 事实证明，拍电视还是用 Mac 的外观抢眼，但是配置嘛，还是用 Windows 部署比较方便剧组人员~~ 看《夫妻那些事》第26集21分49秒~~&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WaterDrop?a=Aj5kJo4MhHM:s8EsanLj_j0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WaterDrop?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WaterDrop/~4/Aj5kJo4MhHM" height="1" width="1"/&gt;</description>
		<link>http://feedproxy.google.com/~r/WaterDrop/~3/Aj5kJo4MhHM/using-mac-to-zhuang-b.html</link>
			<feedburner:origLink>http://blog.waterlin.org/articles/using-mac-to-zhuang-b.html</feedburner:origLink></item>
	<item>
		<title>说说对新浪微博和水木社区的两个看法</title>
		<description>昨天总算把最近要交的项目忙完了，今天可以闲下来琢磨一下其它好玩的东西了。今天先围绕自己天天要上的新浪微博和水木社区，说说最近自己的两个看法。 1. 新浪微博能否自定义页面？ 现在上班必玩微博，没办法，这个东西刷新快，最适合上班看笑话、看NBA战报之类的。可是，当你关注的对象多了之后，会发现你首页里的内容繁杂，对于一些需要特别关注的人的信息，往往会忽略。朋友发布的信息，往往是更加应该重点关注的，因为内容少、与自己密切相关。但是在你关注了大量的名人、栏目之后，朋友的信息混杂在里面，往往都错过了。 目前，我的办法是，在自己的关注列表里，找到某个朋友，然后去他的微博看。这种做法的缺点是：1. 朋友资讯获取不够及时；2. 在自己忙的时候，不会去点朋友的微博；3. 有若干个朋友，要一个一个点，得点到啥时候？一点效率都没有。 如果新浪微博可以提供一个自定义页面功能就好了！我可以把我的若干个朋友放到一个页面里，这个页面只浏览他们发布的微博；我也可以把我的同事放到一个页面里，这样，刷新这个页面的时候，看到的只是和同事有关的信息。通过这样，我还可以把经济相关、人文相关的关注对象，放到一起，方便分类阅读资讯。即，单个的关注对象粒度太细，而同一属性的关注对象则属于比较好控制的阅读粒度。 不知道有没有类似的插件或是工具？如果有，请推荐给我。 2. 水木社区的 @ 功能 水木社区绝对是一个人声鼎沸的地方，哈，我喜欢在里面的技术版块里转悠，当然，也喜欢里面的八卦版面。以前你在水木里面提问，如果你要查找别人的回复，那相对来说还蛮麻烦的：你需要找到原帖，然后同主题阅读。这个步骤看似轻松，操作起来却很繁琐，如果在 telnet 下还略算方便，但是在 Web 界面下，抱歉，我实在懒得去折腾。 现在水木与时俱进了，添加了 @ 功能：当有人回复你的文章，或是直接在发文的时候用 @ 加上你的名字，你就可以收到这个回复。这看起来像不像是微博功能的移植？ 水木的这个功能不错，希望水木多多改进，在如今网络社区化的战场里，依然保有鲜活的生命力。毕竟，水木社区留下来的用户，具备很多其它社区所不具备的素质，的确是最宝贵的财富。&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WaterDrop?a=OpCeMV6F0TA:vsb_xRwes1E:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WaterDrop?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WaterDrop/~4/OpCeMV6F0TA" height="1" width="1"/&gt;</description>
		<link>http://feedproxy.google.com/~r/WaterDrop/~3/OpCeMV6F0TA/two-options-about-newsmth-and-weibo.html</link>
			<feedburner:origLink>http://blog.waterlin.org/articles/two-options-about-newsmth-and-weibo.html</feedburner:origLink></item>
	<item>
		<title>C# 引用 C++ 链接库</title>
		<description>最近在尝试用新的方式来写一个新的 Windows 客户端，当作练习。主要是用 C++ 把复杂的算法写成链接库，然后用 C# 做界面前端，从 C# 调用用 C++ 写好的非托管代码。 尝试通过这种方式解决两个问题： C# 的计算效率问题，虽然从各种资料来看，好像 C# 的托管代码对效率的影响并没有想象的夸张，但不管怎么样，有些东西用 C++ 写就是方便一些； 用 C++ 可以方便地链接现有的代码库、算法库。 其实，这种架构可以看成是一种 C/S 架构的简化版，但是省去了 Socket 通信这一层。 我采用的是最简单的 P/Invokes 的方式来实现 C# 调用 C++ 链接库，详细的教程，可以看一下 Using dumpbin.exe as an Aid for Declaring P/Invokes 这篇文章。 这里先简单说说两点和代码无关的问题 如果 C++ 链接库的计算很耗时，一定要在 C# 客户端里开一个线程来处理，否则容易造成死机，这和 MFC 之类的原理一样。 为了测试你从 C# 链接 C++ 链接库是否成功，可以用 [...]&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WaterDrop?a=toCHovXXHSc:uRBnm6Im4uo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WaterDrop?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WaterDrop/~4/toCHovXXHSc" height="1" width="1"/&gt;</description>
		<link>http://feedproxy.google.com/~r/WaterDrop/~3/toCHovXXHSc/link-cpp-dll-from-csharp.html</link>
			<feedburner:origLink>http://blog.waterlin.org/articles/link-cpp-dll-from-csharp.html</feedburner:origLink></item>
	<item>
		<title>C/C++ 多线程参数需要尽量采用动态分配的方式来分配</title>
		<description>在 C/C++ 多线程编程下，如果不注意，采用普通变量传递参数值给线程会有一些误区，需要特别小心。 下面浏忙绪绪就举两个例子来说明一下。 char* 参数在多线程下出现的怪异现象 最近在用 Boost 库写多线程程序时，需要启动若干个线程，这些线程分别处理不同的事情，线程会获取一个字符串参数，用来标识内容。在编写代码的时候，出现了一个很怪异的现象，例子代码如下： const int tNum = 4;//并发线程数 vector&amp;#60;boost::thread*&amp;#62; tBox; for (int i=0; i &amp;#60; tNum; i++ ) { char strThread[20]; sprintf(strThread, "thread%d",i); //strThread 字符串是传入的 const char* 类型 boost::thread* thread_0 = new boost::thread( StreamProcesser, param1, param2, strThread); tBox.push_back(thread_0); boost::xtime xt; boost::xtime_get(&amp;#38;xt, boost::TIME_UTC); xt.sec += 2; boost::thread::sleep(xt); } for (int [...]&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WaterDrop?a=LJaCcW2DQXU:LrmqVlCbehE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WaterDrop?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WaterDrop/~4/LJaCcW2DQXU" height="1" width="1"/&gt;</description>
		<link>http://feedproxy.google.com/~r/WaterDrop/~3/LJaCcW2DQXU/cpp-multi-thread-passing-params-problems.html</link>
			<feedburner:origLink>http://blog.waterlin.org/articles/cpp-multi-thread-passing-params-problems.html</feedburner:origLink></item>
	<item>
		<title>Log4Cxx 0.10.0 在 Linux 下退出程序时导致程序中断</title>
		<description>最近在写 Linux 程序的时候，碰到这样的问题：Log4Cxx 0.10.0 在 Linux 下退出程序时导致程序中断，即提示出现 segmentation fault 错误。 如果你用 gdb 调试，会提示如下信息： Program received signal SIGSEGV, Segmentation fault. 0x02fa68f3 in apr_vformatter () from /usr/lib/libapr-1.so.0 原因是因为 Log4Cxx 在退出时有非法的资源释放。 有一个解决办法：可以在程序退出时，显示地关闭 Log4Cxx 对象。 I have the same problem if I use log4cxx.AsyncAppender. I fixed the problem by calling log4cxx::LogManager::shutdown(); before the end of the process. It's not [...]&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WaterDrop?a=3VDZGa_Qo04:aizL3Kv9lPo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WaterDrop?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WaterDrop/~4/3VDZGa_Qo04" height="1" width="1"/&gt;</description>
		<link>http://feedproxy.google.com/~r/WaterDrop/~3/3VDZGa_Qo04/log4cxx-10-exit-error-under-linux.html</link>
			<feedburner:origLink>http://blog.waterlin.org/articles/log4cxx-10-exit-error-under-linux.html</feedburner:origLink></item>
	<item>
		<title>编写跨平台的 C++ 代码</title>
		<description>最近都在写一些跨 Windows 和 Linux 平台的 C++ 代码，略有心得，整理成文，备忘一下。 有关预编译指令 Visual Studio 会自动在源代码里添加 #pragma once 这个指令，在 Linux Gcc 编译器下应该怎么样处理类似的情况呢？ 维基百科上有一个权威说法： http://en.wikipedia.org/wiki/Pragma_once 所以，在编写跨平台的 C++ 代码时，最好使用下面这种方式来获得跨平台的特性： #pragma once #ifndef GRANDFATHER_H #define GRANDFATHER_H struct foo { int member; }; #endif /* GRANDFATHER_H */ 有关链接库工程的跨平台 Windows 下使用 __declspec(dllexport) 来标明一个动态链接库的函数接口，而在 Linux 下，则完全没有这个必要。 这个时候，如果动态链接库代码需要跨平台，应该怎么处理呢？ 你可以用如下宏来进行区分： #ifdef WIN32 #define EXPORT_XX __declspec(dllexport) #else #define EXPORT_XX [...]&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WaterDrop?a=_PjsfL7uXqQ:oBcE6yuUZF4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WaterDrop?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WaterDrop/~4/_PjsfL7uXqQ" height="1" width="1"/&gt;</description>
		<link>http://feedproxy.google.com/~r/WaterDrop/~3/_PjsfL7uXqQ/writing-cross-platform-cpp-code.html</link>
			<feedburner:origLink>http://blog.waterlin.org/articles/writing-cross-platform-cpp-code.html</feedburner:origLink></item>
	<item>
		<title>log4cxx0.10.0 版本在 Linux 无法输出中文的问题</title>
		<description>最近在 Linux 下使用 log4cxx 库，使用的 log4cxx 版本为 0.10.0，结果无法显示中文日志信息。 这可怎么办呢？我不可能把中文日志全部一行一行替换为英文的，这可是一个非常傻B的举动。 经过研究，终于知道需要经过如下步骤才能让 log4cxx 在 Linux 下正常显示中文日志： 你可以先 locale 检查一下 Linux 终端环境是不是 zh_CN ； $ locale 如果你的是 en_US 之类的编码，则需要把 locale 设置为简体中文： $ export LC_ALL="zh_CN.UTF-8" 如果你的系统提示说没有安装本字符集，则需要用命令进行安装： $ sudo apt-get install language-pack-zh-hans 在程序里设置应用程序的 locale 和终端一样： LoggerPtr logger; log4cxx::PropertyConfigurator::configure("./log4cxx.properties"); logger= Logger::getLogger("test") ; logger-&amp;#62;info(("Start logging")); setlocale(LC_ALL, "zh_CN.UTF-8"); 关键是最后这一句 setlocale，要设置得和终端一样，都是 zh_CN.UTF-8。 这样，你的程序就可以用 log4cxx0.10.0 [...]&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WaterDrop?a=y3nuWTD0ix8:_Bj-irpgHaE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WaterDrop?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WaterDrop/~4/y3nuWTD0ix8" height="1" width="1"/&gt;</description>
		<link>http://feedproxy.google.com/~r/WaterDrop/~3/y3nuWTD0ix8/log-chinese-logs-on-linux-using-log4cxx.html</link>
			<feedburner:origLink>http://blog.waterlin.org/articles/log-chinese-logs-on-linux-using-log4cxx.html</feedburner:origLink></item>
	<item>
		<title>Ubuntu 11.10 下 OpenCV2.2 及更低版本无法读取视频的问题</title>
		<description>今天在 Ubuntu 下使用 OpenCV 来读取一个视频，碰到了下述问题： 自己手动安装的 OpenCV2.2.0 无法正确读取视频内容，用函数 cvCaptureFromAVI() 及 cvGetCaptureProperty() 均提示说失败： 所有的测试视频在 Windows 下用 OpenCV2.2.0 是可以正常读取的，应该是 ffmpeg 安装不完全或是不正确。 从源里安装 OpenCV2.1 后，可以打开视频读取数据，可是在读取视频帧内容的时候，却提示如下错误： [swscaler @ 0x94b3e80]No accelerated colorspace conversion found from yuv420p to bgr24. 这个问题应该是 OpenCV 在用 ffmpeg 解压 yuv420 数据时出错。 对于上述问题，可以采用下面的办法来解决： 重新安装 ffmpeg x264：Install and use the latest FFmpeg and x264 再重新安装 OpenCV，经测试，可以正确安装 OpenCV 2.3.1 [...]&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WaterDrop?a=mUjVIJuDeJ8:TfkiJuxPrEE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WaterDrop?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WaterDrop/~4/mUjVIJuDeJ8" height="1" width="1"/&gt;</description>
		<link>http://feedproxy.google.com/~r/WaterDrop/~3/mUjVIJuDeJ8/ubuntu-opencv-read-video-problem.html</link>
			<feedburner:origLink>http://blog.waterlin.org/articles/ubuntu-opencv-read-video-problem.html</feedburner:origLink></item>
</channel>
</rss>

