<?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"
	>

<channel>
	<title>DEAN LEE:/DEV/BLOG &#187; Programming</title>
	<atom:link href="http://www.deanlee.cn/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.deanlee.cn</link>
	<description>mount /dev/brain &#124;&#124; tail -f /var/log/thoughts &#62;&#62; /pub/www</description>
	<pubDate>Fri, 30 Dec 2011 13:27:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
	<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>MongoDB: Optimize index to avoid the scanAndOrder operation</title>
		<link>http://www.deanlee.cn/programming/mongodb-optimize-index-avoid-scanandorder/</link>
		<comments>http://www.deanlee.cn/programming/mongodb-optimize-index-avoid-scanandorder/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 07:06:00 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[indexes]]></category>

		<category><![CDATA[mongodb]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/programming/mongodboptimizing-index-to-avoid-scanandorder/</guid>
		<description><![CDATA[Recently,I’ve got a performance issue with MongoDB index,it confused me and took me awhile to figure it out.let me try to get this issue straight:I have a compound index on multiple fields,but always result in a slow scan and order operation when performing a range query ,which means that the index is not being used [...]]]></description>
			<content:encoded><![CDATA[<p>Recently,I’ve got a performance issue with <a href="http://www.mongodb.org/display/DOCS/Indexes#Indexes-CompoundKeysIndexes" target="_blank">MongoDB index</a>,it confused me and took me awhile to figure it out.<font color="#000000">let me try to get this issue straight:I have a compound index on multiple fields,but always result in a slow scan and order operation when performing a range query ,which means that the index is not being used for sorting.</font></p>
<p>For example,if I have an index <em><strong>“{a:1, b:1, c:-1}”</strong></em>,it works well for<strong><em> find({a:1,b:2}).sort({c:-1})</em>,</strong> but&#160; very slowly for<em> <strong>find( {a:{$in:[1,2,3]}, b:4}).sort({c:-1})</strong></em>,here&#8217;s the output of the explain plan:</p>
<p>  <span id="more-1376"></span>
<pre clsss="prettyprint">{
	&quot;Cursor:BtreeCursor&quot; : a_1_b_1_c_-1,
	&quot;nscanned&quot; : 13567
       	...
	&quot;scanAndOrder&quot; : true,
	...
}</pre>
<p><font color="#000000">There are many documents said that the sort column should be the last column used in the index,but it’s not always true,especailly if you are doing a range query, such as<em><strong> $lt,$in</strong></em> and etc.it&#160; does complicate the query processing and make it hard to use the index to satisfy the sort conditions.indeed,in this case,you should put the sort field before range query field in your index,for example,<em> <strong>“{c:-1,a:1,b:1}”</strong>&#160;</em> in this case.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/programming/mongodb-optimize-index-avoid-scanandorder/feed/</wfw:commentRss>
		</item>
		<item>
		<title>repoze.who: perform login programmatically</title>
		<link>http://www.deanlee.cn/programming/repoze-who-perform-login-programmatically/</link>
		<comments>http://www.deanlee.cn/programming/repoze-who-perform-login-programmatically/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 11:50:49 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[python repoze.who]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/programming/repoze-who-perform-login-programmatically/</guid>
		<description><![CDATA[It took me a while to find out how to perform programmatic login using repoze.who.here is the source code:

rememberer = request.environ['repoze.who.plugins']['cookie']
identity = {'repoze.who.userid': user.username}
response.headerlist = response.headerlist + \
	rememberer.remember(request.environ, identity) 
]]></description>
			<content:encoded><![CDATA[<p>It took me a while to find out how to perform programmatic login using <a href="http://static.repoze.org/whodocs/">repoze.who</a>.here is the source code:</p>
</p>
<pre class="prettyprint">rememberer = request.environ['repoze.who.plugins']['cookie']
identity = {'repoze.who.userid': user.username}
response.headerlist = response.headerlist + \
	rememberer.remember(request.environ, identity) </pre>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/programming/repoze-who-perform-login-programmatically/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Happy birthday,sweet little EQ</title>
		<link>http://www.deanlee.cn/programming/happy-birthday-to-eq/</link>
		<comments>http://www.deanlee.cn/programming/happy-birthday-to-eq/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 06:40:48 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[eq]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/programming/happy-birthday-to-eq/</guid>
		<description><![CDATA[No words can express how much I love you from the day you were born until now,you have held a special place in my heart, one that is irreplaceable and invaluable.

Happy birthday, My sweet little EQ.
]]></description>
			<content:encoded><![CDATA[<p>No words can express how much I love you from the day you were born until now,you have held a special place in my heart, one that is irreplaceable and invaluable.</p>
<p><a href="http://www.deanlee.cn/wp-content/uploads/2009/12/35eq.jpg" rel="lightbox"><img alt="35eq" border="0" src="http://www.deanlee.cn/wp-content/uploads/2009/12/35eq_thumb.jpg" style="border-width: 0px; display: inline;" title="35eq" /></a></p>
<p>Happy birthday, My sweet little <a href="http://eq.35.com" target="_blank">EQ</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/programming/happy-birthday-to-eq/feed/</wfw:commentRss>
		</item>
		<item>
		<title>基于Wu-Manber算法的快速多关键词搜索</title>
		<link>http://www.deanlee.cn/programming/wu-manber-com/</link>
		<comments>http://www.deanlee.cn/programming/wu-manber-com/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 16:10:57 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[wu-manber]]></category>

		<category><![CDATA[关键词]]></category>

		<category><![CDATA[搜索]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/programming/wu-manber-com/</guid>
		<description><![CDATA[很多应用都需要高性能的多关键词搜索功能，网络&#8221;扫黄&#8221;开始后更是如此，如何在文本内容中快速地搜索出敏感关键字变得越来越重要。
Wu-Manber算法是一个不错的解决方案，尤其是针对包含有大量关键词的搜索。Wu-Manber算法的C语言实现非常丰富，为了方便如C#，VB.net等编程语言使用该算法，我用C/C++写了一个基于改进的Wu-Manber算法的多关键词搜索组件：wu-manber-com。
Download wu-manber-com
使用方法
以vb.net/c#为例，使用前，先运行regsvr32 stringsearch.dll注册该组件，然后将stringsearch.dll添加到项目引用中。调用示例代码如下：
StringSearchLib.WuManber s = new StringSearchLib.WuManber();
s.AddPatterns("keyword1,keyword2,keyword3", ",", false);
int index = s.Search("... some text for searching...");
Console.WriteLine(index);
该控件不会搜寻所有存在的关键词，碰到第一个匹配的关键词，即返回该匹配的关键词在原文中的位置索引,没有找到则返回-1。
]]></description>
			<content:encoded><![CDATA[<p>很多应用都需要高性能的多关键词搜索功能，网络&rdquo;扫黄&rdquo;开始后更是如此，如何在文本内容中快速地搜索出敏感关键字变得越来越重要。</p>
<p><a href="http://webglimpse.net/pubs/TR94-17.pdf" target="_blank">Wu-Manber算法</a>是一个不错的解决方案，尤其是针对包含有大量关键词的搜索。Wu-Manber算法的C语言实现非常丰富，为了方便如C#，VB.net等编程语言使用该算法，我用C/C++写了一个基于改进的<a href="http://webglimpse.net/pubs/TR94-17.pdf" target="_blank">Wu-Manber算法</a>的多关键词搜索组件：<a href="http://code.google.com/p/wu-manber-com/" target="_blank">wu-manber-com</a>。</p>
<p class="download"><a href="http://wu-manber-com.googlecode.com/files/StringSearch_1.01.zip">Download wu-manber-com</a></p>
<p><strong>使用方法</strong></p>
<p>以vb.net/c#为例，使用前，先运行regsvr32 stringsearch.dll注册该组件，然后将stringsearch.dll添加到项目引用中。调用示例代码如下：</p>
<pre class="prettyprint">StringSearchLib.WuManber s = new StringSearchLib.WuManber();
s.AddPatterns("keyword1,keyword2,keyword3", ",", false);
int index = s.Search("... some text for searching...");
Console.WriteLine(index);</pre>
<p>该控件不会搜寻所有存在的关键词，碰到第一个匹配的关键词，即返回该匹配的关键词在原文中的位置索引,没有找到则返回-1。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/programming/wu-manber-com/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Compile with /MP flag on my system</title>
		<link>http://www.deanlee.cn/programming/compile-with-mp-flag-on-my-system/</link>
		<comments>http://www.deanlee.cn/programming/compile-with-mp-flag-on-my-system/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 04:50:28 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[/MP]]></category>

		<category><![CDATA[compile]]></category>

		<category><![CDATA[vc2008]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/programming/compile-with-mp-flag-on-my-system/</guid>
		<description><![CDATA[The most interesting feature I like in VC 2008 is the parallel build capability.
The /MP option can reduce the total time to compile the source files on the command line. The /MP option causes the compiler to create one or more copies of itself, each in a separate process. Then these copies simultaneously compile the [...]]]></description>
			<content:encoded><![CDATA[<p>The most interesting feature I like in VC 2008 is the parallel build capability.</p>
<blockquote><p>The <strong>/MP</strong> option can reduce the total time to compile the source files on the command line. The <strong>/MP</strong> option causes the compiler to create one or more copies of itself, each in a separate process. Then these copies simultaneously compile the source files. Consequently, the total time to build the source files can be significantly reduced.</p>
</blockquote>
<p> <span id="more-970"></span>
<p>and here is the screenshot when compiled with /MP flag on an 8 core processor system:</p>
<p><a href="http://www.deanlee.cn/wp-content/uploads/2009/09/image.png" rel="lightbox"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.deanlee.cn/wp-content/uploads/2009/09/image_thumb.png" width="401" height="423" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/programming/compile-with-mp-flag-on-my-system/feed/</wfw:commentRss>
		</item>
		<item>
		<title>QT/VC2008:Project is rebuilt every time even though I didn&#8217;t make any modifications</title>
		<link>http://www.deanlee.cn/programming/qt_vc_project_is_out_of_date/</link>
		<comments>http://www.deanlee.cn/programming/qt_vc_project_is_out_of_date/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 04:24:10 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[4.5.2]]></category>

		<category><![CDATA[moc]]></category>

		<category><![CDATA[out of date]]></category>

		<category><![CDATA[projects]]></category>

		<category><![CDATA[QT]]></category>

		<category><![CDATA[VC 2008]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/technology/qt_vc_project_is_out_of_date/</guid>
		<description><![CDATA[I have encountered problem when attempting to compile VC projects created by QT 4.5.2,VC always rebuilds the whole project when I start to run or build the project, even though I didn&#8217;t make any modifications to the code.the project is always “out of date”.
that is because the custom build step generated by QT for each [...]]]></description>
			<content:encoded><![CDATA[<p>I have encountered problem when attempting to compile VC projects created by <a href="http://qt.nokia.com/products/" target="_blank">QT 4.5.2</a>,VC always rebuilds the whole project when I start to run or build the project, even though I didn&#8217;t make any modifications to the code.the project is always “out of date”.</p>
<p>that is because the custom build step generated by QT for each header files that contain the Q_OBJECT macro are dependent on mocinclude.tmp,which being created every time the project is built,the mocinclude.tmp’s date is later than the header files,so the custom build rule will be run every time.</p>
<p>to solve this problem,open %QTDIR%/makespecs/features/moc.prf,comment out&#160; these two lines(add ‘#&#8217;’ at the start of line):</p>
<pre class="prettyprint">!isEmpty(INCLUDETEMP):moc_source.depends += $$INCLUDETEMP
......
!isEmpty(INCLUDETEMP):moc_header.depends += $$INCLUDETEMP</pre>
<p>and run qmake –tp vc again to regenerate the project files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/programming/qt_vc_project_is_out_of_date/feed/</wfw:commentRss>
		</item>
		<item>
		<title>LogMicroscope:boost performance for logging system by 43%</title>
		<link>http://www.deanlee.cn/programming/logmicroscope-boost-logging-performance/</link>
		<comments>http://www.deanlee.cn/programming/logmicroscope-boost-logging-performance/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 08:56:38 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[logging]]></category>

		<category><![CDATA[logmicroscope]]></category>

		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/programming/logmicroscope-boost-logging-performance/</guid>
		<description><![CDATA[Recently,I have rewritten the logging engine for LogMicroscope,using circular-buffer in log writing threads,and WriteFileGather in file writing thread to gathers up the data from these discrete buffers in memory and transfers them &#34;in place&#34; as a single operation.
with WriteFIleGather, the disk is always keep busy without entering and leaving from kernel mode. log data can [...]]]></description>
			<content:encoded><![CDATA[<p>Recently,I have rewritten the logging engine for <a href="http://lm.35.com" target="_blank">LogMicroscope</a>,using <a href="http://en.wikipedia.org/wiki/Circular_buffer" target="_blank">circular-buffer</a> in log writing threads,and <a href="http://msdn.microsoft.com/en-us/library/aa365749%28VS.85%29.aspx" target="_blank">WriteFileGather</a> in file writing thread to gathers up the data from these discrete buffers in memory and transfers them &quot;in place&quot; as a single operation.</p>
<p>with WriteFIleGather, the disk is always keep busy without entering and leaving from kernel mode. log data can be written to disk at a rate that approaches the limits of the physical characteristics of the hardware device.that’s really boost the I/O performance.</p>
<p>because the CPU is mostly idle during write operation,to maximum the performance,I have compressed the data before writing to the disk to reduce the amount of data to be written,the compress is always faster than the I/O operation,so that I get the compression for “free”.</p>
<p>after these changes,the performance for logging system has increased by over 43%.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/programming/logmicroscope-boost-logging-performance/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Moved OpenSSL for windows to google code</title>
		<link>http://www.deanlee.cn/programming/moved-openssl-for-windows-to-google-code/</link>
		<comments>http://www.deanlee.cn/programming/moved-openssl-for-windows-to-google-code/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 12:14:03 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[openssl]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/programming/moved-openssl-for-windows-to-google-code-2/</guid>
		<description><![CDATA[Due to the bandwidth limitation and the lack of issue tracking system,I have moved OpenSSL for windows to google code: http://code.google.com/p/openssl-for-windows/
if you have any questions/issues,please submit an issue at http://code.google.com/p/openssl-for-windows/issues/list
]]></description>
			<content:encoded><![CDATA[<p>Due to the bandwidth limitation and the lack of issue tracking system,I have moved <a target="_blank" href="http://www.deanlee.cn/programming/openssl-for-windows/">OpenSSL for windows</a> to google code: <a href="http://code.google.com/p/openssl-for-windows/" title="http://code.google.com/p/openssl-for-windows/" class="external">http://code.google.com/p/openssl-for-windows/</a></p>
<p>if you have any questions/issues,please submit an issue at <a href="http://code.google.com/p/openssl-for-windows/issues/list" title="http://code.google.com/p/openssl-for-windows/issues/list" class="external">http://code.google.com/p/openssl-for-windows/issues/list</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/programming/moved-openssl-for-windows-to-google-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>rOptiPng:an modification to OptiPNG to support recursive directory optimization</title>
		<link>http://www.deanlee.cn/programming/roptipng/</link>
		<comments>http://www.deanlee.cn/programming/roptipng/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 17:05:41 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[projects]]></category>

		<category><![CDATA[lossless]]></category>

		<category><![CDATA[optimization]]></category>

		<category><![CDATA[optipng]]></category>

		<category><![CDATA[png]]></category>

		<category><![CDATA[roptipng]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/programming/roptipngmodify-optipng-to-support-optimization-of-an-entire-directory-with-subdirectory-recursion/</guid>
		<description><![CDATA[rOptiPng,hosted on google code, is an modification to OptiPNG to support the optimization of multiple directories with recursion,making it easier to use,especially when optimizing many image files in different directories,such as a website.
Download roptipng
To optimization of multiple directories recursively with rOptiPng,simply by using the ** wildcard in file path.    for examples:  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/roptipng/" target="_blank">rOptiPng,hosted on google code</a>, is an modification to <a href="http://optipng.sourceforge.net/" target="_blank">OptiPNG</a> to support the optimization of multiple directories with recursion,making it easier to use,especially when optimizing many image files in different directories,such as a website.</p>
<p class="download"><a href="http://code.google.com/p/roptipng/downloads/list">Download roptipng</a></p>
<p>To optimization of multiple directories recursively with rOptiPng,simply by using the ** wildcard in file path.    <br />for examples:     <br />roptipng **/*.png     <br />roptipng c:\photos\**\*.png     <br />roptipng c:\photos\**\*.png d:\website\**\*.png     <br />roptipng c:\photos\**\image8.png</p>
<p><a href="http://www.deanlee.cn/wp-content/uploads/2009/07/image8.png" rel="lightbox"><img title="image" style="display: inline" height="237" alt="image" src="http://www.deanlee.cn/wp-content/uploads/2009/07/image_thumb4.png" width="473" /></a> </p>
<p>if you find it useful, a time saver,or even just mildly interesting,then my effort was worth it.    <br />if you have any suggestions on how to improve it, I’d love to hear it.</p>
<p>Enjoy:)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/programming/roptipng/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Online JavaScript Compressor</title>
		<link>http://www.deanlee.cn/programming/online-javascript-compressor/</link>
		<comments>http://www.deanlee.cn/programming/online-javascript-compressor/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 03:56:30 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[compressor]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/programming/online-javascript-compressor-2/</guid>
		<description><![CDATA[I have written an online JavaScript compressor using JsMin,It typically reduces filesize by half, resulting in faster downloads.

Feel free to use this tool and give me feedback if you have any.
]]></description>
			<content:encoded><![CDATA[<p>I have written an <a href="http://www.deanlee.cn/jsmin/">online JavaScript compressor</a> using <a href="http://www.crockford.com/javascript/jsmin.html">JsMin</a>,It typically reduces filesize by half, resulting in faster downloads.</p>
<p><a href="http://www.deanlee.cn/wp-content/uploads/2009/07/image4.png" rel="lightbox"><img height="213" width="351" title="image" style="display: inline;" alt="image" src="http://www.deanlee.cn/wp-content/uploads/2009/07/image_thumb.png" /></a></p>
<p>Feel free to use this tool and give me feedback if you have any.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/programming/online-javascript-compressor/feed/</wfw:commentRss>
		</item>
		<item>
		<title>英汉翻译机器人:en-cn@35.cn(Jabber translator bot)</title>
		<link>http://www.deanlee.cn/programming/translator_bot_for_jabber/</link>
		<comments>http://www.deanlee.cn/programming/translator_bot_for_jabber/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 13:13:24 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[bot]]></category>

		<category><![CDATA[jabber]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/programming/translator_bot_for_jabber/</guid>
		<description><![CDATA[en-cn@35.cn是一个英汉/汉英翻译机器人，你可以用任何支持Jabber/xmpp的客户端，比如Gtalk,将机器人添加为好友，然后就能通过与他聊天来获得英汉单词、短句的翻译。目前还不支持全文翻译，下个版本我会增加这个功能：

]]></description>
			<content:encoded><![CDATA[<p><a href="mailto:en-cn@35.cn">en-cn@35.cn</a>是一个英汉/汉英翻译机器人，你可以用任何支持Jabber/xmpp的客户端，比如Gtalk,将机器人添加为好友，然后就能通过与他聊天来获得英汉单词、短句的翻译。目前还不支持全文翻译，下个版本我会增加这个功能：</p>
<p><a href="http://www.deanlee.cn/wp-content/uploads/2009/07/image7.png" rel="lightbox"><img title="image" style="display: inline" height="215" alt="image" src="http://www.deanlee.cn/wp-content/uploads/2009/07/image_thumb3.png" width="407" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/programming/translator_bot_for_jabber/feed/</wfw:commentRss>
		</item>
		<item>
		<title>inffas32.asm: error A2070: invalid instruction operands</title>
		<link>http://www.deanlee.cn/windows/inffas32asm-error-a2070-invalid-instruction-operands/</link>
		<comments>http://www.deanlee.cn/windows/inffas32asm-error-a2070-invalid-instruction-operands/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 17:28:32 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Windows]]></category>

		<category><![CDATA[a2070]]></category>

		<category><![CDATA[compile]]></category>

		<category><![CDATA[inffas32.asm]]></category>

		<category><![CDATA[vs2005]]></category>

		<category><![CDATA[zlib]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/?p=805</guid>
		<description><![CDATA[I got the following errors while compiling zlib on windows with Visual studio 2005:

1>inffas32.asm(649) : error A2070: invalid instruction operands
1>inffas32.asm(663) : error A2070: invalid instruction operands
1>inffas32.asm(720) : error A2070: invalid instruction operands
these errors are due to an issue with Microsoft Macro Assembler ,included with Visual C++ 2005.it refuses to assemble a MOVD instruction with a [...]]]></description>
			<content:encoded><![CDATA[<p>I got the following errors while compiling <a href="http://www.zlib.net/" target="_blank">zlib </a>on windows with Visual studio 2005:</p>
<pre class="prettyprint">
1>inffas32.asm(649) : error A2070: invalid instruction operands
1>inffas32.asm(663) : error A2070: invalid instruction operands
1>inffas32.asm(720) : error A2070: invalid instruction operands</pre>
<p>these errors are due to an issue with Microsoft Macro Assembler ,included with Visual C++ 2005.it refuses to assemble a MOVD instruction with a memory operand with an implied size, and requires that &quot;dword ptr&quot; prefix the memory operand.</p>
<p>to fix these problems,simply adding<span style="font-style: italic;">&#8221;</span><em>DWORD PTR&#8217; before</em> the operands:</p>
<pre class="prettyprint">
movd mm5,dword ptr [esp+4](649)
movd mm7,dword ptr [esi](663)
movd mm7,dword ptr [esi](720)
</pre>
<p><span id="more-805"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/windows/inffas32asm-error-a2070-invalid-instruction-operands/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

