<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TechGuru</title>
	<atom:link href="http://tunps.com/feed" rel="self" type="application/rss+xml" />
	<link>http://tunps.com</link>
	<description>a Process to Niubility</description>
	<lastBuildDate>Wed, 22 Feb 2012 15:45:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>过滤post-format-aside文章</title>
		<link>http://tunps.com/wordpress-post-format-aside-filter</link>
		<comments>http://tunps.com/wordpress-post-format-aside-filter#comments</comments>
		<pubDate>Thu, 09 Feb 2012 07:30:01 +0000</pubDate>
		<dc:creator>tunpishuang</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://tunps.com/?p=7979</guid>
		<description><![CDATA[来自http://tunps.com/wordpress-post-format-aside-filterwordpress在3.X版本中加入了post-format概念，默认是standard，其他的可选的还有aside,gallary,status,video等。 本博客一直使用aside形式来发布一些简短的信息，而且这些信息是“无聊”的，比如“刚吃完饭，好饱啊”之类没有任何价值的信息。所以需要在primary loop中过滤掉，然后在一个“僻静”的地方（比如某个页面）显示出来。 方法很简单，不过我股沟了很久 primary loop中过滤post-format-aside 在主题文件（我用的twentyten）loop.php文件中找到代码：while ( have_posts() ) : the_post();。此行上面添加以下代码： &#60;?php $my =array( 'tax_query' =&#62; array( array( 'taxonomy' =&#62; 'post_format', 'field' =&#62; 'slug', 'terms' =&#62; 'post-format-aside', 'operator' =&#62; 'NOT IN', ) ) ); $my = array_merge( $my , &#8230; <a href="http://tunps.com/wordpress-post-format-aside-filter">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>来自<a href="http://tunps.com/wordpress-post-format-aside-filter">http://tunps.com/wordpress-post-format-aside-filter</a></p><p>wordpress在3.X版本中加入了post-format概念，默认是standard，其他的可选的还有aside,gallary,status,video等。</p>
<p>本博客一直使用aside形式来发布一些简短的信息，而且这些信息是“无聊”的，比如“刚吃完饭，好饱啊”之类没有任何价值的信息。所以需要在primary loop中过滤掉，然后在一个“僻静”的地方（比如某个页面）显示出来。</p>
<p>方法很简单，不过我股沟了很久</p>
<h2 class="section">primary loop中过滤post-format-aside</h2>
<p>在主题文件（我用的twentyten）loop.php文件中找到代码：while ( have_posts() ) : the_post();。此行上面添加以下代码：</p>
<pre>
&lt;?php
$my =array(
	'tax_query' =&gt; array(
		array(
			'taxonomy' =&gt; 'post_format',
			'field' =&gt; 'slug',
			'terms' =&gt; 'post-format-aside',
			'operator' =&gt; 'NOT IN',
		)
	)
);
$my = array_merge( $my , array_filter( $wp_query-&gt;query_vars ) );
query_posts($my);
?&gt;
</pre>
<p>这样primary loop中就不再显示post-format-aside文章。</p>
<h2 class="section">在新建页面（“僻静的地方”）中显示aside文章，并实现分页</h2>
<p>新建一个页面，名字随意。记录下page ID，我的是7856。所以在主题目录下建立page-7856.php，文件代码如下：</p>
<pre>

&lt;?php
get_header(); ?&gt;
		&lt;div id="container"&gt;
			&lt;div id="content" role="main"&gt;

			&lt;?php
			$pp = isset($_GET['pp'])?$_GET['pp']:0;
			
			if(!is_numeric($pp))
				$pp=0;
			$offset = $pp*10;
			$args =array(
				'tax_query' =&gt; array(
					array(
						'taxonomy' =&gt; 'post_format',
						'field' =&gt; 'slug',
						'terms' =&gt; 'post-format-aside'
					)
				),
				'offset' =&gt; $offset
			);
			// The Query
			$the_query = query_posts( $args );
			?&gt;
			
			&lt;?php while (have_posts() ) : the_post(); 
				// The Loop?&gt;
				&lt;div id="post-&lt;?php the_ID(); ?&gt;" &lt;?php post_class(); ?&gt;&gt;

				&lt;?php if (is_search() ) : // Display excerpts for archives and search. ?&gt;
					&lt;div class="entry-summary"&gt;
						&lt;?php the_excerpt(); ?&gt;
					&lt;/div&gt;&lt;!-- .entry-summary --&gt;
				&lt;?php else : ?&gt;
					&lt;div class="entry-content"&gt;
						&lt;?php the_content( __( 'Continue reading &lt;span class="meta-nav"&gt;&rarr;&lt;/span&gt;', 'twentyten' ) ); ?&gt;
						&lt;hr /&gt;
					&lt;/div&gt;&lt;!-- .entry-content --&gt;
				&lt;?php endif; ?&gt;

					&lt;div class="entry-utility"&gt;
						&lt;?php twentyten_posted_on(); ?&gt;
						&lt;span class="meta-sep"&gt;|&lt;/span&gt;
						&lt;span class="comments-link"&gt;&lt;?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?&gt;&lt;/span&gt;
						&lt;?php edit_post_link( __( 'Edit', 'twentyten' ), '&lt;span class="meta-sep"&gt;|&lt;/span&gt; &lt;span class="edit-link"&gt;', '&lt;/span&gt;' ); ?&gt;
					&lt;/div&gt;&lt;!-- .entry-utility --&gt;
				
			&lt;/div&gt;&lt;!-- #post-## --&gt;
				
			&lt;?php endwhile; ?&gt;
			&lt;?php
			// Reset Post Data
			wp_reset_postdata();
			wp_reset_query();

			?&gt;
				&lt;div id="nav-below" class="navigation"&gt;
				&lt;?php
				//pagenation function
					$older = $pp-1;
					$newer = $pp+1;
				?&gt;
				&lt;?php if($pp != 0){?&gt;
					&lt;a href="&lt;?php echo "doing?pp=".$older ?&gt;"&gt;上一页&lt;/a&gt;
				&lt;?php } else { ?&gt;
					上一页
				&lt;?php } ?&gt;
				&lt;a href="&lt;?php echo "doing?pp=".$newer ?&gt;"&gt;下一页&lt;/a&gt;
				&lt;/div&gt;&lt;!-- #nav-below --&gt;
			&lt;/div&gt;&lt;!-- #content --&gt;
			&lt;?php /* Display navigation to next/previous pages when applicable */ ?&gt;
		&lt;/div&gt;&lt;!-- #container --&gt;
&lt;?php get_sidebar(); ?&gt;
&lt;?php get_footer(); ?&gt;
</pre>
<h2 class="section">feed中过滤掉aside文章</h2>
<p>页面上的工作我们完成了，接下来我们要过滤掉feed中的aside文章，也就是不让aside文章在feed中输出。为什么要过滤捏？难道你觉得你的博客订阅用户会对你什么时候吃饭了？吃得是否很饱感兴趣？答案是否定的。方法很简单，我们在主题目录找到functions.php，在末尾添加如下代码即可：</p>
<pre>
//feed filter aside posts
function wp_exclude_category(WP_Query $query) {
	if($query-&gt;is_feed){
		$args = array(
			array(
				'taxonomy' =&gt; 'post_format',
				'field' =&gt; 'slug',
				'terms' =&gt; 'post-format-aside',
				'operator' =&gt; 'NOT IN'
			)
		);
	$query-&gt;set('tax_query',$args);
	}
	return $query;
}
add_filter('pre_get_posts','wp_exclude_category');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tunps.com/wordpress-post-format-aside-filter/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>关于iphone4s和ipad2越狱</title>
		<link>http://tunps.com/iphone4s-ipad2-jb</link>
		<comments>http://tunps.com/iphone4s-ipad2-jb#comments</comments>
		<pubDate>Thu, 09 Feb 2012 07:01:44 +0000</pubDate>
		<dc:creator>tunpishuang</dc:creator>
		
		<guid isPermaLink="false">http://tunps.com/?p=7848</guid>
		<description><![CDATA[来自http://tunps.com/iphone4s-ipad2-jb最近我老妹买了2个iphone4s，一个黑的，一个白的。 正好春节之后greenpois0n就发布了A5核心设备iOS 5.0.1系统的越狱软件Absinthe。最新的Absinthe已经更新到0.3，支持iphone4s ipad2 在越狱之前首选用TinyUmbrella来备份SHSH。给我们的降级留有余地。 首先是一个iphone4s，新加坡版的，应该是无锁版。默认iOS版本号是5.0.1，直接运行Absinthe，点“JailBreak”之后等待Absinthe图标出现在手机桌面上，不要点，进入通用，启用“VPN”，等待报错“VPN配置错误”，然后系统自动重启。这个时候Cydia已经在桌面上了。越狱成功，如果等了很久一直不重启，参见此文 接下来是一台老姐的国行的ipad2，WIFI版，肯定也是无锁的，软件版本是4.3.5。买了很久了，一直待越。 首先必须升级固件到5.0或5.0.1，我选择5.0.1。下载固件到http://iphone.91.com/fw/ 我选择http://appldnld.apple.com/iPhone4/041-3310.20111109.Cfp76/iPad2,1_5.0.1_9A405_Restore.ipsw，接下来打开itunes，连接ipad2到电脑，按住SHIFT的情况下点击“更新”，选择ipsw所在路径的iPad2,1_5.0.1_9A405_Restore.ipsw。在更新固件的时候itunes会连接到apple官方验证什么东西。开始的时候一直报“未知错误”，“联网错误”。一下是我测试的所有可能性： 模式 hosts 按钮 错误 正常 127 更新 错误11 正常 cydia 更新 此时无法更新Ipad"",因为iPad软件更新服务器无法联系或暂不可用 正常 apple 更新 request time out 此时无法更新Ipad"",因为iPad软件更新服务器无法联系或暂不可用 无论gs.apple.com的ip hosts到127.0.0.1交给Tiny Umbrella的SSH Server还是74.208.10.249的Cydia都报错。最后都用#注释掉。连接苹果官方，结果果然是超时了。 C:\Documents and Settings\Administrator>ping gs.apple.com Pinging gs.apple.com.akadns.net [17.171.36.30] with &#8230; <a href="http://tunps.com/iphone4s-ipad2-jb">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>来自<a href="http://tunps.com/iphone4s-ipad2-jb">http://tunps.com/iphone4s-ipad2-jb</a></p><p>最近我老妹买了2个iphone4s，一个黑的，一个白的。</p>
<p>正好春节之后greenpois0n就发布了A5核心设备iOS 5.0.1系统的越狱软件Absinthe。最新的Absinthe已经更新到0.3，支持iphone4s ipad2</p>

<p>在越狱之前首选用TinyUmbrella来备份SHSH。给我们的降级留有余地。</p>

<p>首先是一个iphone4s，新加坡版的，应该是无锁版。默认iOS版本号是5.0.1，直接运行Absinthe，点“JailBreak”之后等待Absinthe图标出现在手机桌面上，不要点，进入通用，启用“VPN”，等待报错“VPN配置错误”，然后系统自动重启。这个时候Cydia已经在桌面上了。越狱成功，如果等了很久一直不重启，参见<a href="http://bbs.weiphone.com/read-htm-tid-3871773.html">此文</a></p>


<p>接下来是一台老姐的国行的ipad2，WIFI版，肯定也是无锁的，软件版本是4.3.5。买了很久了，一直待越。</p>
<p>首先必须升级固件到5.0或5.0.1，我选择5.0.1。下载固件到<a href="http://iphone.91.com/fw/">http://iphone.91.com/fw/</a>
我选择<a href="http://appldnld.apple.com/iPhone4/041-3310.20111109.Cfp76/iPad2,1_5.0.1_9A405_Restore.ipsw">http://appldnld.apple.com/iPhone4/041-3310.20111109.Cfp76/iPad2,1_5.0.1_9A405_Restore.ipsw</a>，接下来打开itunes，连接ipad2到电脑，按住SHIFT的情况下点击“更新”，选择ipsw所在路径的iPad2,1_5.0.1_9A405_Restore.ipsw。在更新固件的时候itunes会连接到apple官方验证什么东西。开始的时候一直报“未知错误”，“联网错误”。一下是我测试的所有可能性：</p>
<pre>
模式	hosts	按钮	错误
正常	127	更新	错误11
正常	cydia	更新	此时无法更新Ipad"",因为iPad软件更新服务器无法联系或暂不可用
正常	apple	更新	request time out 此时无法更新Ipad"",因为iPad软件更新服务器无法联系或暂不可用
</pre>
<p>无论gs.apple.com的ip hosts到127.0.0.1交给Tiny Umbrella的SSH Server还是74.208.10.249的Cydia都报错。最后都用#注释掉。连接苹果官方，结果果然是超时了。</p>
<pre>
C:\Documents and Settings\Administrator>ping gs.apple.com

Pinging gs.apple.com.akadns.net [17.171.36.30] with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.
</pre>
<p>打开WallProxy之后，还是超时。但是点击“更新”后，尽然更新升级到5.0.1。汗。。。。。</p>


]]></content:encoded>
			<wfw:commentRss>http://tunps.com/iphone4s-ipad2-jb/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto Save Image：WordPress远程图片保存/抓取插件</title>
		<link>http://tunps.com/auto-save-image</link>
		<comments>http://tunps.com/auto-save-image#comments</comments>
		<pubDate>Thu, 09 Feb 2012 06:34:02 +0000</pubDate>
		<dc:creator>tunpishuang</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://tunps.com/?p=6948</guid>
		<description><![CDATA[来自http://tunps.com/auto-save-imageAuto Save Image 自定义保存目录 支持设置水印，水印文字大小、内容、透明度、字体、位置 去除站外图片链接 图片id能自动与文章id关联]]></description>
			<content:encoded><![CDATA[<p>来自<a href="http://tunps.com/auto-save-image">http://tunps.com/auto-save-image</a></p><h2 class="section"><a href="http://www.01on.com/a/497.html">Auto Save Image</a></h2>
<ul>
	<li>自定义保存目录</li>
	<li>支持设置水印，水印文字大小、内容、透明度、字体、位置</li>
	<li>去除站外图片链接</li>
	<li>图片id能自动与文章id关联</li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://tunps.com/auto-save-image/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UltraEdit宏一枚</title>
		<link>http://tunps.com/ultraedit-1-macros</link>
		<comments>http://tunps.com/ultraedit-1-macros#comments</comments>
		<pubDate>Thu, 09 Feb 2012 06:21:41 +0000</pubDate>
		<dc:creator>tunpishuang</dc:creator>
				<category><![CDATA[ultraedit]]></category>

		<guid isPermaLink="false">http://tunps.com/?p=7976</guid>
		<description><![CDATA[来自http://tunps.com/ultraedit-1-macros一 有如下文本内容，需要在每个[code]前面添加上从下往上查找的最近的一个日期： [2011.12.12] [code]item 1 [code]item 2 [code]item 3 [code]item 4 [code]item 5 [life]item fdsa [code]item fzzz [code]item fsa [code]item fsa [shit]fsafdsafdsa [code]fdsafdsafd [2011.12.13] [life]fdsafdsaf [code]fdsafdsaf [fuck]fdsafdsaf [code]fdsafdsaf 使用如下宏：（注：运行宏之前将光标移动到第一行，宏内容中的“X箭头”是安装中文版UltraEdit的内容，如果是其他语言版本可能不同。比如英文版“右箭头”就是“RIGHT ARROW”。使用中文版UE写RIGHT ARROW会报宏语法错误。这一点比较坑爹。既然会想到用宏的人，宏脚本还搞本地化就比较蛋疼了。） InsertMode ColumnModeOff HexOff Find " [code]" ToggleBookmark IfFound Find &#8230; <a href="http://tunps.com/ultraedit-1-macros">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>来自<a href="http://tunps.com/ultraedit-1-macros">http://tunps.com/ultraedit-1-macros</a></p><h2 class="section">一</h2>
<p>有如下文本内容，需要在每个[code]前面添加上从下往上查找的最近的一个日期：</p>
<pre>
[2011.12.12]
	[code]item 1
	[code]item 2
	[code]item 3
	[code]item 4
	[code]item 5
	[life]item fdsa
	[code]item fzzz
	[code]item fsa
	[code]item fsa
	[shit]fsafdsafdsa
	[code]fdsafdsafd
[2011.12.13]
	[life]fdsafdsaf
	[code]fdsafdsaf
	[fuck]fdsafdsaf
	[code]fdsafdsaf
</pre>
<p>使用如下宏：（注：运行宏之前将光标移动到第一行，宏内容中的“X箭头”是安装中文版UltraEdit的内容，如果是其他语言版本可能不同。比如英文版“右箭头”就是“RIGHT ARROW”。使用中文版UE写RIGHT ARROW会报宏语法错误。这一点比较坑爹。既然会想到用宏的人，宏脚本还搞本地化就比较蛋疼了。）</p>
<pre>
InsertMode
ColumnModeOff
HexOff
Find "	[code]"
ToggleBookmark
IfFound
Find Up "[201"
StartSelect
Key 右箭头
Key 右箭头
Key 右箭头
Key 右箭头
Key 右箭头
Key 右箭头
Key 右箭头
Key 右箭头
EndSelect
Copy
Clipboard 0
GotoBookMark 1
Key 右箭头
Paste
EndIf
ToggleBookmark
</pre>
<p>运行宏之后的文本内容变为：</p>
<pre>

[2011.12.12]
	[2011.12.12][code]item 1
	[2011.12.12][code]item 2
	[2011.12.12][code]item 3
	[2011.12.12][code]item 4
	[2011.12.12][code]item 5
	[life]item fdsa
	[2011.12.12][code]item fzzz
	[2011.12.12][code]item fsa
	[2011.12.12][code]item fsa
	[shit]fsafdsafdsa
	[2011.12.12][code]fdsafdsafd
[2011.12.13]
	[life]fdsafdsaf
	[2011.12.13][code]fdsafdsaf
	[fuck]fdsafdsaf
	[2011.12.13][code]fdsafdsaf
</pre>

]]></content:encoded>
			<wfw:commentRss>http://tunps.com/ultraedit-1-macros/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>reading 2012.02</title>
		<link>http://tunps.com/reading-2012-02</link>
		<comments>http://tunps.com/reading-2012-02#comments</comments>
		<pubDate>Sun, 05 Feb 2012 14:17:58 +0000</pubDate>
		<dc:creator>tunpishuang</dc:creator>
				<category><![CDATA[reading]]></category>

		<guid isPermaLink="false">http://tunps.com/?p=7855</guid>
		<description><![CDATA[来自http://tunps.com/reading-2012-02非你莫属 20120205 非你莫属 20120212 非你莫属 20120219 非你莫属 20120220 Windows DLL编程中的导入导出：__declspec(dllimport) ，__declspec(dllexport) ， __declspec( dllimport ) __declspec(dllexport) 都是什么意思？ MFC中基于对话框程序快捷键的实现 王立军 VC6中使用CHtmlView在对话框控制中显示HTML文件 CListCtrl 使用技巧 Duilib入门文档 Visual C++ 中操纵 MS Word 123 关闭Visual Studio 2008 实时调试器 电商成黑客敛财新手段 90%电商用户数据外泄？ IDM.UltraEdit.v17.00.0.1041.Incl.Keygen.CHINESE-Lz0.rar 2012哥伦比亚大学中国新年晚会留学生原创群口相声《如此纳贤》 一对鸡翅膀的命运]]></description>
			<content:encoded><![CDATA[<p>来自<a href="http://tunps.com/reading-2012-02">http://tunps.com/reading-2012-02</a></p><p><a href="http://v.youku.com/v_show/id_XMzQ5MzU0MDEy.html">非你莫属 20120205</a></p>

<p><a href="http://v.youku.com/v_show/id_XMzUxODY0NjQ4.html">非你莫属 20120212</a></p>

<p><a href="http://v.youku.com/v_show/id_XMzU0MzgzNjk2.html">非你莫属 20120219</a></p>

<p><a href="http://v.youku.com/v_show/id_XMzU0NzY2MDgw.html">非你莫属 20120220</a></p>

<p><a href="http://blog.csdn.net/stone_kingnet/article/details/3862504">Windows DLL编程中的导入导出：__declspec(dllimport) ，__declspec(dllexport) ，</a></p>

<p><a href="http://topic.csdn.net/t/20021118/11/1185238.html">__declspec( dllimport ) __declspec(dllexport) 都是什么意思？</a></p>

<p><a href="http://www.vckbase.com/document/viewdoc/?id=1788">MFC中基于对话框程序快捷键的实现</a></p>
<p><a href="http://zh.wikipedia.org/wiki/%E7%8E%8B%E7%AB%8B%E5%86%9B#.E7.8E.8B.E7.AB.8B.E5.86.9B.E4.BA.8B.E4.BB.B6">王立军</a></p>
<p><a href="http://www.vckbase.com/document/viewdoc/?id=566">VC6中使用CHtmlView在对话框控制中显示HTML文件</a></p>
<p><a href="http://blog.csdn.net/lixiaosan/article/details/653563">CListCtrl 使用技巧</a></p>
<p><a href="http://blog.csdn.net/wangchyz/article/details/6795419">Duilib入门文档</a></p>
<p><a href="http://www.vckbase.com/document/viewdoc/?id=1174">Visual C++ 中操纵 MS Word 123</a></p>
<p><a href="http://www.cnblogs.com/BoyceLin/archive/2010/08/27/1809810.html">关闭Visual Studio 2008 实时调试器</a></p>
<p><a href="http://news.mydrivers.com/1/216/216446.htm">电商成黑客敛财新手段 90%电商用户数据外泄？</a></p>
<p><a href="http://depositfiles.com/files/hp425cgss/IDM.UltraEdit.v17.00.0.1041.Incl.Keygen.CHINESE-Lz0.rar">IDM.UltraEdit.v17.00.0.1041.Incl.Keygen.CHINESE-Lz0.rar</a></p>
<p><a href="http://www.tudou.com/programs/view/dQE2Id8R0LU/">2012哥伦比亚大学中国新年晚会留学生原创群口相声《如此纳贤》</a></p>
<p><a href="http://www.tudou.com/programs/view/wZmJAetwI9w/">一对鸡翅膀的命运</a></p>]]></content:encoded>
			<wfw:commentRss>http://tunps.com/reading-2012-02/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>找不到附属汇编 Microsoft.VC80.DebugCRT，上一个错误是 参照的汇编没有安装在系统上。</title>
		<link>http://tunps.com/microsoft-vc80-debugcrt</link>
		<comments>http://tunps.com/microsoft-vc80-debugcrt#comments</comments>
		<pubDate>Wed, 01 Feb 2012 14:34:18 +0000</pubDate>
		<dc:creator>tunpishuang</dc:creator>
				<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://tunps.com/?p=7853</guid>
		<description><![CDATA[来自http://tunps.com/microsoft-vc80-debugcrt找不到附属汇编 Microsoft.VC80.DebugCRT，上一个错误是 参照的汇编没有安装在系统上。 使用VC 2005(SP1)开发了一个程序，之后一段时间系统重装了，VC 2005也重装了(没有装SP1)。打开项目正常编译，但是调试提示以下内容： --------------------------- Microsoft Visual Studio --------------------------- 无法启动程序“d:\dev\debug\test.exe”。 由于应用程序配置不正确，未能启动此应用程序。请查看清单文件以查找可能的错误。重新安装该应用程序可能修复此问题。有关更多详细信息，请参见应用程序事件日志。 打开“事件查看器”，“系统”分类下面有3个来源于“SideBySide”的错误，信息分别如下： 找不到附属汇编 Microsoft.VC80.DebugCRT，上一个错误是 参照的汇编没有安装在系统上。 Resolve Partial Assembly 为 Microsoft.VC80.DebugCRT 失败。 参考错误消息: 参照的汇编没有安装在系统上。 Generate Activation Context 为 d:\dev\debug\test.exe 失败。 参考错误消息: 操作成功完成。 在项目的Debug目录下面生成了两个文件 test.exe.embed.manifest 和 test.exe.intermediate.manifest，是所谓的资源清单文件。内容是一样的： &#60;?xml version="1.0" encoding="UTF-8" &#8230; <a href="http://tunps.com/microsoft-vc80-debugcrt">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>来自<a href="http://tunps.com/microsoft-vc80-debugcrt">http://tunps.com/microsoft-vc80-debugcrt</a></p><p>找不到附属汇编 Microsoft.VC80.DebugCRT，上一个错误是 参照的汇编没有安装在系统上。</p>
<p>使用VC 2005(<strong>SP1</strong>)开发了一个程序，之后一段时间系统重装了，VC 2005也重装了(没有装SP1)。打开项目正常编译，但是调试提示以下内容：</p>
<pre>
---------------------------
Microsoft Visual Studio
---------------------------
无法启动程序“d:\dev\debug\test.exe”。
由于应用程序配置不正确，未能启动此应用程序。请查看清单文件以查找可能的错误。重新安装该应用程序可能修复此问题。有关更多详细信息，请参见应用程序事件日志。
</pre>
<p>打开“事件查看器”，“系统”分类下面有3个来源于“SideBySide”的错误，信息分别如下：</p>
<pre>
找不到附属汇编 Microsoft.VC80.DebugCRT，上一个错误是 参照的汇编没有安装在系统上。
</pre>
<pre>
Resolve Partial Assembly 为 Microsoft.VC80.DebugCRT 失败。 参考错误消息: 参照的汇编没有安装在系统上。
</pre>
<pre>
Generate Activation Context 为 d:\dev\debug\test.exe 失败。 参考错误消息: 操作成功完成。
</pre>
<p>在项目的Debug目录下面生成了两个文件 test.exe.embed.manifest 和 test.exe.intermediate.manifest，是所谓的资源清单文件。内容是一样的：</p>
<pre>
&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
&lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&gt;
  &lt;dependency&gt;
    &lt;dependentAssembly&gt;
      &lt;assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"&gt;&lt;/assemblyIdentity&gt;
    &lt;/dependentAssembly&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;dependentAssembly&gt;
      &lt;assemblyIdentity type="win32" name="Microsoft.VC80.DebugMFC" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"&gt;&lt;/assemblyIdentity&gt;
    &lt;/dependentAssembly&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;dependentAssembly&gt;
      &lt;assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"&gt;&lt;/assemblyIdentity&gt;
    &lt;/dependentAssembly&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;dependentAssembly&gt;
      &lt;assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"&gt;&lt;/assemblyIdentity&gt;
    &lt;/dependentAssembly&gt;
  &lt;/dependency&gt;
&lt;/assembly&gt;
</pre>
<p>vs2005的版本号我们需要提及一下：</p>
<a href="http://tunps.com/vs2005-sp1-ver"><p>sp1前：8.0.50727.42(RTM.050727-4200)</p></a>
<p>sp1后：8.0.50727.762(SP.050727-7600)</p>
]]></content:encoded>
			<wfw:commentRss>http://tunps.com/microsoft-vc80-debugcrt/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>qzone api</title>
		<link>http://tunps.com/qzone-api</link>
		<comments>http://tunps.com/qzone-api#comments</comments>
		<pubDate>Mon, 30 Jan 2012 14:16:41 +0000</pubDate>
		<dc:creator>tunpishuang</dc:creator>
		
		<guid isPermaLink="false">http://tunps.com/?p=7852</guid>
		<description><![CDATA[来自http://tunps.com/qzone-api 列表： http://b1.qzone.qq.com/cgi-bin/blognew/blog_output_titlelist2?uin=10000&#38;vuin=10000&#38;verbose=1&#38;pos=0&#38;num=15&#38;sorttype=0&#38;v=1&#38;maxlen=68&#38;bdm=b.qzone.qq.com&#38;rand=0.11542812990956008&#38;g_tk=1595358287&#38;cate=&#38;cateHex=&#38;ref=qzone&#38;v6=1 uin:被访问的Q号 vuin:访问的Q号 verbose:是否显示目录信息（cate_info） pos:第一个的pos的offset num:显示文章数量，1~100 sorttype: 0:pubtime desc排序 按发表时间由新到旧排序 1:replytime desc排序 按最新评论时间由新到旧排序 3:按最后修改时间由新到旧排序 4:按评论数目由多到少排序 v:1 隐藏abstract v:2 显示abstract bdm:b域名 rand:随机数 g_tk:? cate:目录id cateHex:目录hex字符串 ref:引用 v6:1 版本6 内容： http://b1.qzone.qq.com/cgi-bin/blognew/blog_output_data?uin=10000&#38;blogid=1325561159&#38;styledm=ctc.qzonestyle.gtimg.cn&#38;imgdm=ctc.qzs.qq.com&#38;bdm=b.qzone.qq.com&#38;mode=0&#38;numperpage=15&#38;blogseed=0.4479592749848962&#38;property=GoRE&#38;timestamp=1325595249&#38;dprefix=&#38;g_tk=5381&#38;ref=qzone&#38;v6=1 blogid:文章id styledm:样式表域名 imgdm:图片域名 bdm:b域名 mode:? numperpage:每页数量 blogseed:随机输 property:GoRE timestamp:时间戳 &#8230; <a href="http://tunps.com/qzone-api">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>来自<a href="http://tunps.com/qzone-api">http://tunps.com/qzone-api</a></p><pre>
列表：
http://b1.qzone.qq.com/cgi-bin/blognew/blog_output_titlelist2?uin=10000&amp;vuin=10000&amp;verbose=1&amp;pos=0&amp;num=15&amp;sorttype=0&amp;v=1&amp;maxlen=68&amp;bdm=b.qzone.qq.com&amp;rand=0.11542812990956008&amp;g_tk=1595358287&amp;cate=&amp;cateHex=&amp;ref=qzone&amp;v6=1
uin:被访问的Q号
vuin:访问的Q号
verbose:是否显示目录信息（cate_info）
pos:第一个的pos的offset
num:显示文章数量，1~100
sorttype:
0:pubtime desc排序 按发表时间由新到旧排序
1:replytime desc排序 按最新评论时间由新到旧排序
3:按最后修改时间由新到旧排序
4:按评论数目由多到少排序
v:1 隐藏abstract
v:2 显示abstract
bdm:b域名
rand:随机数
g_tk:?
cate:目录id
cateHex:目录hex字符串
ref:引用
v6:1 版本6

内容：
http://b1.qzone.qq.com/cgi-bin/blognew/blog_output_data?uin=10000&amp;blogid=1325561159&amp;styledm=ctc.qzonestyle.gtimg.cn&amp;imgdm=ctc.qzs.qq.com&amp;bdm=b.qzone.qq.com&amp;mode=0&amp;numperpage=15&amp;blogseed=0.4479592749848962&amp;property=GoRE&amp;timestamp=1325595249&amp;dprefix=&amp;g_tk=5381&amp;ref=qzone&amp;v6=1
blogid:文章id
styledm:样式表域名
imgdm:图片域名
bdm:b域名
mode:?
numperpage:每页数量
blogseed:随机输
property:GoRE
timestamp:时间戳
dprefix:
g_tk:?
ref:引用
v6: 版本6

标题128
内容：153600
</pre>]]></content:encoded>
			<wfw:commentRss>http://tunps.com/qzone-api/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debug Assertion Failed! f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\dlgdata.cpp Line: 42</title>
		<link>http://tunps.com/mfc-dlgdata-cpp</link>
		<comments>http://tunps.com/mfc-dlgdata-cpp#comments</comments>
		<pubDate>Tue, 24 Jan 2012 09:17:01 +0000</pubDate>
		<dc:creator>tunpishuang</dc:creator>
				<category><![CDATA[mfc]]></category>

		<guid isPermaLink="false">http://tunps.com/?p=7847</guid>
		<description><![CDATA[来自http://tunps.com/mfc-dlgdata-cppDebug Assertion Failed! f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\dlgdata.cpp Line: 42 --------------------------- Microsoft Visual C++ Debug Library --------------------------- Debug Assertion Failed! Program: d:\dev\debug\Qzone2WP.exe File: f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\dlgdata.cpp Line: 42 For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts. &#8230; <a href="http://tunps.com/mfc-dlgdata-cpp">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>来自<a href="http://tunps.com/mfc-dlgdata-cpp">http://tunps.com/mfc-dlgdata-cpp</a></p><p>Debug Assertion Failed! f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\dlgdata.cpp Line: 42</p>
<pre>
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!

Program: d:\dev\debug\Qzone2WP.exe
File: f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\dlgdata.cpp
Line: 42

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)
---------------------------
终止(A)   重试(R)   忽略(I)   
---------------------------
</pre>
<p>问题的原因是在界面上删除了相应的Control，但是没有删掉相应的DDV
<pre>
void CQzone2WPDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_USERLIST, m_userList); //delete this line!
}
</pre>]]></content:encoded>
			<wfw:commentRss>http://tunps.com/mfc-dlgdata-cpp/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to store UTF-8 encoding data to sqlite3 using Visual C++</title>
		<link>http://tunps.com/how-to-store-utf-8-encoding-data-to-sqlite3-using-visual-c</link>
		<comments>http://tunps.com/how-to-store-utf-8-encoding-data-to-sqlite3-using-visual-c#comments</comments>
		<pubDate>Sat, 07 Jan 2012 13:03:09 +0000</pubDate>
		<dc:creator>tunpishuang</dc:creator>
				<category><![CDATA[charset]]></category>
		<category><![CDATA[iconv]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://tunps.com/?p=7822</guid>
		<description><![CDATA[来自http://tunps.com/how-to-store-utf-8-encoding-data-to-sqlite3-using-visual-c I&#8217;ve created a sqlite database with encoding UTF-8(default). Then I use the following statement to insert data: strcpy(sql,"insert into blog(title) values('呵呵')"); sqlite3_exec(db,sql,0,0,0); then I open the sqlite database with tool called SQLite Developer the value of title field shows &#8230; <a href="http://tunps.com/how-to-store-utf-8-encoding-data-to-sqlite3-using-visual-c">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>来自<a href="http://tunps.com/how-to-store-utf-8-encoding-data-to-sqlite3-using-visual-c">http://tunps.com/how-to-store-utf-8-encoding-data-to-sqlite3-using-visual-c</a></p>        <p>I&#8217;ve created a sqlite database with encoding UTF-8(default).</p>

<p>Then I use the following statement to insert data:</p>

<pre>
strcpy(sql,"insert into blog(title) values('呵呵')");
sqlite3_exec(db,sql,0,0,0);
</pre>

<p>then I open the sqlite database with tool called SQLite Developer the value of <code>title</code> field shows <code>ºǺ�</code> garbage code under Data encoding:<strong>UNICODE</strong>.
then I changed Data encoding to <strong>ANSI</strong>, value of <code>title</code> shows right.</p>

<p>As I know the <code>sqlite3_exec</code> prototype is :</p>

<pre>
int sqlite3_exec(
  sqlite3*,                                  /* An open database */
  const char *sql,                           /* SQL to be evaluated */
  int (*callback)(void*,int,char**,char**),  /* Callback function */
  void *,                                    /* 1st argument to callback */
  char **errmsg                              /* Error msg written here */
);
</pre>

<p>I still try to pass <code>wchar_t</code> type to <code>sql</code>,but still won&#8217;t work it out.</p>

<p>My Visual C++ project already defined <code>UNOCODE</code> &amp; <code>_UNICODE</code>, So my question is: <strong>how to store UTF-8 encoding data to sqlite3 using Visual C++?</strong></p>

<hr />

<p><strong>Update(question solved)</strong></p>

<p>I use <strong>iconv</strong> to convert <strong>GBK</strong> encoding to <strong>UTF-8</strong> inspired by msandiford. Thanks msandiford so much.</p>

<pre>
char* pOut;
char* pIn;
size_t inLen,outLen=2000;
strcpy(sql,"insert into blog(title) values('呵呵')");
string strSQL = sql;
char* sql2 = (char*)malloc(2000);
memset(sql2,0,2000);
pOut = &#038;sql2[0];
inLen = strlen(strSQL.c_str());
pIn = const_cast<char*>(strSQL.c_str());
iconv_t g2u8 = iconv_open("UTF-8","GBK");
iconv(g2u8,(const char**)&#038;pIn,&#038;inLen,&#038;pOut,&#038;outLen);
sqlite3_exec(db,sql2,0,0,0);
</pre>


<p>Collecting comments into answer form:</p>

<p>From the question comments, apparently the source files are not encoded in UTF-8.  Converting to UTF-8 or using the UTF-8 encoding directly seems to work.</p>

<p>Using UTF-8 encoding directly:</p>

<pre>
strcpy(sql,"insert into blog (title) values ('\xE5\x91\xB5\xE5\x91\xB5')");
</pre>

<hr />

<p>You could avoid having to convert all your source files to UTF-8 by doing something like this:</p>

<pre>
sprintf(sql, "insert into blog (title) values('%s')", AnsiToUtf8("呵呵"));
</pre>

<p>Unfortunately the <code>AnsiToUtf8()</code> function is going to be pretty platform specific.</p>

<hr />

<p>Looking further into this, it appears that Visual Studio saves source files in the default encoding for your Windows locale settings.  Based on this, there could potentially be an assortment of encodings if your dev team&#8217;s computers are set up for different locales.</p>

<p>I think it would be quite difficult, if not impossible, to implement an <code>AnsiToUtf8()</code> function that would cope in all the possible cases, especially given that the locale settings for the computer that the code is developed on may not be the same as the computer that ultimately runs the code.</p>

<p>I think the cleanest way to resolve this would be to use UTF-8 encoding uniformly in source files, assuming you want to use code points in string literals outside the areas where the default encoding and Unicode overlap.</p>

<p>Another way would be to internationalise the code so that the source files did not contain extended characters, and use something like <a href="http://www.gnu.org/software/gettext/" rel="nofollow">GNU gettext</a> or similar to handle translations.</p>
<p>via <a href="http://stackoverflow.com/questions/8753812/how-to-store-utf-8-encoding-data-to-sqlite3-using-visual-c">http://stackoverflow.com/questions/8753812/how-to-store-utf-8-encoding-data-to-sqlite3-using-visual-c</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tunps.com/how-to-store-utf-8-encoding-data-to-sqlite3-using-visual-c/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CMake编译pcrecpp静态库</title>
		<link>http://tunps.com/cmake-pcrecpp</link>
		<comments>http://tunps.com/cmake-pcrecpp#comments</comments>
		<pubDate>Fri, 06 Jan 2012 08:57:27 +0000</pubDate>
		<dc:creator>tunpishuang</dc:creator>
				<category><![CDATA[cmake]]></category>
		<category><![CDATA[pcre]]></category>
		<category><![CDATA[pcrecpp]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://tunps.com/?p=7818</guid>
		<description><![CDATA[来自http://tunps.com/cmake-pcrecpp 下载并安装CMake(2.8.6)，解压pcre(最新版本8.21)。 打开CMake GUI，指定”where is the source code:”到D:/dev/pcre-8.21，指定”where to build the binaries:”到D:/dev/pcre-8.21/out，点Configure,然后有很多配置，如果需要支持Unicode，勾选PCRE_SUPPORT_UNICODE_PROPERTIES和PCRE_SUPPORT_UTF8，支持Unicode就不能同时勾选PCRE_EBCDIC，然后点Generate 进入D:\dev\pcre-8.21\out打开PCRE.sln。如果你的project定义了/D “UNICODE”，那么pcrecpp项目也需要这样定义。两者的运行时库也要保持一致（比如都是/MDd）。右击项目，生成。 在项目中引用生成的pcrecppd.lib和pcred.lib(这个也是需要的，否则链接报错)，并加上头文件。 #include &#60;pcrecpp.h&#62; #pragma comment(lib,"D:\\dev\\pcre-8.21\\out\\debug\\pcred.lib") #pragma comment(lib,"D:\\dev\\pcre-8.21\\out\\debug\\pcrecppd.lib") 在项目“于处理器定义”中加上PCRE_STATIC。 Over.]]></description>
			<content:encoded><![CDATA[<p>来自<a href="http://tunps.com/cmake-pcrecpp">http://tunps.com/cmake-pcrecpp</a></p><ol>
	<li>下载并安装<a href="http://www.cmake.org/cmake/resources/software.html">CMake(2.8.6)</a>，解压<a href="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/">pcre</a>(最新版本8.21)。</li>
	<li>打开CMake GUI，指定”where is the source code:”到<strong>D:/dev/pcre-8.21</strong>，指定”where to build the binaries:”到<strong>D:/dev/pcre-8.21/out</strong>，点<strong>Configure</strong>,然后有很多配置，如果需要支持Unicode，勾选<strong>PCRE_SUPPORT_UNICODE_PROPERTIES</strong>和<strong>PCRE_SUPPORT_UTF8</strong>，支持Unicode就不能同时勾选<strong>PCRE_EBCDIC</strong>，然后点<strong>Generate</strong></li>
	<li>进入<strong>D:\dev\pcre-8.21\out</strong>打开<strong>PCRE.sln</strong>。如果你的project定义了<strong>/D “UNICODE”</strong>，那么pcrecpp项目也需要这样定义。两者的运行时库也要保持一致（比如都是<strong>/MDd</strong>）。右击项目，生成。</li>
	<li>在项目中引用生成的pcrecppd.lib和pcred.lib(这个也是需要的，否则链接报错)，并加上头文件。
<pre>#include &lt;pcrecpp.h&gt;
#pragma  comment(lib,"D:\\dev\\pcre-8.21\\out\\debug\\pcred.lib")
#pragma  comment(lib,"D:\\dev\\pcre-8.21\\out\\debug\\pcrecppd.lib")</pre>
</li>
<li>
在项目“于处理器定义”中加上<strong>PCRE_STATIC</strong>。
</li>
<li>
Over.
</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://tunps.com/cmake-pcrecpp/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

