<?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>ELLY66</title>
	<atom:link href="http://www.elly66.com/rss/feed.xml" rel="self" type="application/rss+xml" />
	<link>http://www.elly66.com</link>
	<description>MATHS,LOGIC,FUN</description>
	<lastBuildDate>Fri, 08 Jul 2011 08:40:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>使用Matlab符号工具箱中MuPAD画带阴影的示意图</title>
		<link>http://www.elly66.com/computer/matlab-mupad/</link>
		<comments>http://www.elly66.com/computer/matlab-mupad/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 08:40:05 +0000</pubDate>
		<dc:creator>Elly66</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://www.elly66.com/?p=673</guid>
		<description><![CDATA[<h3>MuPad介绍</h3>
<p style="font-size:14px;text-indent:28px;">据<a href="http://en.wikipedia.org/wiki/MuPAD" target="_blank">Wikipedia</a>,&#160;MuPad是一个计算机代数系统。最初由德国帕德博恩大学(University of Paderborn) 的MuPAD研究小组开发而成。之后，由该研究小组，SciFace Software公司和其他大学的合作伙伴共同开发。2008年9月SciFace被Matlab的东家Mathworks收购，因而，MuPad被整合进Matlab中的符号工具箱。</p>
<p style="font-size:14px;text-indent:28px;">以上是MuPad的历史，了解这个有两个用处：第一，Matlab2009以后才有这个功能；第二，MuPad中的语法和Matlab的语法是不一样的。</p>
<h3>一个例子</h3>
<p style="font-size:14px;text-indent:28px;">这个例子是我最近写论文时要画得一个示意图。除了阴影部分，其他都可以用Matlab的常规画图命令画出来；而要画阴影部分，则必须用到MuPAD</p>
<p style="font-size:14px;text-indent:28px;">成果图：</p>
<p><img class="aligncenter" src="http://img.elly66.com/muPAD.png" width="400" /></p>]]></description>
			<content:encoded><![CDATA[<h3>MuPad介绍</h3>
<p style="font-size:14px;text-indent:28px;">据<a href="http://en.wikipedia.org/wiki/MuPAD" target="_blank">Wikipedia</a>,&nbsp;MuPad是一个计算机代数系统。最初由德国帕德博恩大学(University of Paderborn) 的MuPAD研究小组开发而成。之后，由该研究小组，SciFace Software公司和其他大学的合作伙伴共同开发。2008年9月SciFace被Matlab的东家Mathworks收购，因而，MuPad被整合进Matlab中的符号工具箱。</p>
<p style="font-size:14px;text-indent:28px;">以上是MuPad的历史，了解这个有两个用处：第一，Matlab2009以后才有这个功能；第二，MuPad中的语法和Matlab的语法是不一样的。</p>
<h3>如何打开MuPad</h3>
<p style="font-size:14px;text-indent:28px;">打开Matlab--&gt;单击左下角的Start--&gt;Toolboxes--&gt;Symbolic Math--&gt;MuPAD</p>
<p style="font-size:14px;text-indent:28px;">然后会出现一个新的窗口：</p>
<p><img class="aligncenter" src="http://www.mathworks.com/help/toolbox/symbolic/blank_notebook.png" width="487" /></p>
<h3>一个例子</h3>
<p style="font-size:14px;text-indent:28px;">这个例子是我最近写论文时要画得一个示意图。除了阴影部分，其他都可以用Matlab的常规画图命令画出来；而要画阴影部分，则必须用到MuPAD</p>
<p style="font-size:14px;text-indent:28px;">成果图：</p>
<p><img class="aligncenter" src="http://img.elly66.com/muPAD.png" width="400" /></p>
<p style="font-size:14px;text-indent:28px;">分析一下图片：一个长方形的框、四条线（两条实线、两条虚线）、两条实线中间的阴影部分。</p>
<p style="font-size:14px;text-indent:28px;">在MuMAD中画图用plot。如果要画多个图，也只需要一个plot命令。比如，<span style="font-family:'Courier New'; font-size:11pt; color:#ff0000;">plot(sin(x), cos(x), tan(x), cot(x))</span>因此，我们只需要把图片的每个部分定义好，最后再用plot命令即可。</p>
<p style="font-size:14px;text-indent:28px;"><span class="Apple-style-span">从最简单的长方形开始。画长方形的代码为：<span style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">plot::Rectangle(0.95..1.05,1..1.1,LineColor=RGB::Black)</span>其中，</span><span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">0.95..1.05</span><span class="Apple-style-span">定义的是长方形横坐标的范围，</span><span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">1..1.1</span>定义的纵坐标的范围，<span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">LineColor=RGB::Black</span> 定义的是边的颜色。</p>
<p style="font-size:14px;text-indent:28px;">之后，我们说一下虚线的画法。代码为：<span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">plot::Function2d(0.98/x,x=0.95 .. 0.98,LineColor=RGB::Black,LineStyle=Dashed)</span>其中，<span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">0.98/x</span>是线条的解析式；<span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">x=0.95 .. 0.98</span>是定义域；<span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">LineColor=RGB::Black</span>是线条的颜色；<span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">LineStyle=Dashed</span>是线条的样式。要画实线的话把LineStyle去掉即可。</p>
<p style="font-size:14px;text-indent:28px;"><span class="Apple-style-span">最后就是阴影区域。代码为：<span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">plot::Hatch(f1,</span></span><span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">f2</span><span class="Apple-style-span"><span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">,x=0.95 .. 1.01,FillColor=RGB::Black)</span>其中，</span><span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">f1</span><span class="Apple-style-span">和</span><span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">f2</span>必须之前用<span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">plot::Function2d</span>定义过。<span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">FillColor=RGB::Black</span>定义阴影线条的颜色。在这里f1，也就是图片中阴影部分的下面一条曲线，我们用分段函数表示，否则阴影部分会缺少一块。我们要得分段函数是当x&lt;0.99时，y=0.99/x；当x&gt;=0.99是，y=1。代码为：<span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: 'Courier New'; font-size: 15px; ">p1:=piecewise([x&lt;0.99,0.99/x],[x&gt;=0.99,1])</span></p>
<p style="font-size:14px;text-indent:28px;">全部代码如下：</p>
<p><span style="font-family:'Courier New'; font-size:11pt; color:#ff0000;">p1:=piecewise([x&lt;0.99,0.99/x],[x&gt;=0.99,1]):<br />
	f1:=plot::Function2d(p1,x=0.95 .. 1.01,LineColor=RGB::Black):<br />
	f2:=plot::Function2d(1.01/x,x=0.95 .. 1.01,LineColor=RGB::Black):<br />
	f3:=plot::Function2d(0.98/x,x=0.95 .. 0.98,LineColor=RGB::Black,LineStyle=Dashed):<br />
	f4:=plot::Function2d(1.02/x,x=0.95 .. 1.02,LineColor=RGB::Black,LineStyle=Dashed):<br />
	g:=plot(f1,f2,f3,f4,plot::Hatch(f1,f2,x=0.95 .. 1.01,FillColor=RGB::Black),<br />
	plot::Rectangle(0.95..1.05,1..1.1,LineColor=RGB::Black)):</span></p>
<p style="font-size:14px;text-indent:28px;">说明：</p>
<ul style="font-size:14px;">
<li>在输入命令时，如果需要换行，按Ctrl+Enter；直接按Enter的话，就输出结果。</li>
<li>Matlab中，通过&quot;=&quot;赋值；MuPAD中，通过&quot;:=&quot;赋值。</li>
<li>如果一次要运行多个命令，需用&quot;:&quot;把命令分隔开。</li>
</ul>
<h3>导出图像</h3>
<p style="font-size:14px;text-indent:28px;">右键图片--&gt;Export Graphics...--&gt;Next--&gt;选择Export current image of animation only--&gt;Next--&gt;选择图片格式和文件保存路径--&gt;Export</p>
<p style="font-size:14px;text-indent:28px;">图片可保存为png, gif, bmp, tiff, jped, wmf, eps, svg, pdf, jvx, jvd. 如果要用于Latex的话，就存成eps格式的矢量图。</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://www.elly66.com/blog/">ELLY66</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.elly66.com/computer/matlab-mupad/ ">使用Matlab符号工具箱中MuPAD画带阴影的示意图</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elly66.com/computer/matlab-mupad//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何使用Apache HtmlComponents提交表单</title>
		<link>http://www.elly66.com/computer/how-to-use-htmlcomponents/</link>
		<comments>http://www.elly66.com/computer/how-to-use-htmlcomponents/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 09:25:13 +0000</pubDate>
		<dc:creator>Elly66</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.elly66.com/?p=658</guid>
		<description><![CDATA[<p style="text-indent:28px; font-size:14px">某日，我哥请求我帮他写一个可以从&#8220;<a href="http://www.dce.com.cn/portal/cate?cid=1261730308135&#38;result=Pu00011_search" target="_blank">大连商品交易所</a>&#8221;下载数据的程序。他说，如果按照传统的方法，必须输入一个日期，在点一下按钮。如果要下载上白天的数据，这种方法实在太枯燥冗长了。（果然，什么样的妹妹就有什么样的哥哥。）</p>
<p style="text-indent:28px; font-size:14px">我用Java+Apache HtmlComponents实现的。整个过程其实并不复杂。但是，我在学做的时候发现，HtmlComponents的帮助文档实在是不利于初学者理解。网上大多实例是用Html Client3.0，而不是4.0。（Html Client 3.0也是Apache的，不过被抛弃了。Apache重新写了HtmlComponents，由HtmlCore和HtmlClient组成，我是用HtmlClient做的）所以，我还是花了不少时间在Google的。</p>]]></description>
			<content:encoded><![CDATA[<p style="text-indent:28px; font-size:14px">某日，我哥请求我帮他写一个可以从&ldquo;<a href="http://www.dce.com.cn/portal/cate?cid=1261730308135&amp;result=Pu00011_search" target="_blank">大连商品交易所</a>&rdquo;下载数据的程序。他说，如果按照传统的方法，必须输入一个日期，在点一下按钮。如果要下载上白天的数据，这种方法实在太枯燥冗长了。（果然，什么样的妹妹就有什么样的哥哥。）</p>
<p style="text-indent:28px; font-size:14px">我用Java+Apache HtmlComponents实现的。整个过程其实并不复杂。但是，我在学做的时候发现，HtmlComponents的帮助文档实在是不利于初学者理解。网上大多实例是用Html Client3.0，而不是4.0。（Html Client 3.0也是Apache的，不过被抛弃了。Apache重新写了HtmlComponents，由HtmlCore和HtmlClient组成，我是用HtmlClient做的）所以，我还是花了不少时间在Google的。</p>
<p style="text-indent:28px; font-size:14px">首先，干这种事，第一步是分析网页的源代码。这是非常重要的一件事情。通过&ldquo;大连商品交易所&rdquo;下载数据的过程很简单。打开网页--&gt;填写日期--&gt;单击&ldquo;下载文本格式&rdquo;。所以我们主要也是看这一块内容的代码。如果用chrome浏览器的话，鼠标移到下图所示区域，右键点击view frame source.&nbsp;</p>
<p><img class="aligncenter" src="http://img.elly66.com/dalian.png" /></p>
<p style="text-indent:28px; font-size:14px">先要找到form标签。</p>
<p><font class="Apple-style-span" color="#000000" face="monospace" size="3"><span class="Apple-style-span" style="white-space: pre-wrap;">&lt;form target=&quot;_blank&quot; name=&quot;form1&quot; action=&quot;/PublicWeb/MainServlet&quot; method=&quot;post&quot; onSubmit=&quot;return formcheck(this);&quot;&gt;</span></font></p>
<p style="text-indent:28px; font-size:14px">然后找到&lt;form&gt;...&lt;/form&gt;中所有的input, select, textarea标签。</p>
<p style="text-indent:28px; font-size:14px">本例中有：</p>
<p><span style="color:#800080;">&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;Pu00011_result&quot;&gt;</span></p>
<p><span style="color:#800080;">&lt;input name=&quot;Pu00011_Input.trade_date&quot; type=&quot;text&quot; size=&quot;8&quot; maxlength=&quot;8&quot;&gt;&nbsp;</span></p>
<p><span style="color:#800080;">&lt;select name=&quot;Pu00011_Input.variety&quot;&gt;</span></p>
<p><span style="color:#800080;">&nbsp; &nbsp; &nbsp; &lt;option selected value=&quot;all&quot;&gt;全部&lt;/option&gt;</span></p>
<p><span style="color:#800080;">&nbsp; &nbsp; &nbsp; &lt;option value=&quot;a&quot;&gt;豆一&lt;/option&gt;&nbsp;</span></p>
<p><span style="color:#800080;">&nbsp; &nbsp; &nbsp;......</span></p>
<p><span style="color:#800080;">&lt;/select&gt;</span></p>
<p><span style="color:#800080;">&lt;input name=&quot;Pu00011_Input.trade_type&quot; type=&quot;radio&quot; value=&quot;0&quot; checked&gt;</span></p>
<p><span style="color:#800080;">&lt;input name=&quot;Submit&quot; type=&quot;submit&quot; class=&quot;button&quot; value=&quot;查 询&quot; onClick=&quot;document.form1.action.value=&#39;Pu00011_result&#39;;document.form1.target=&#39;_blank&#39;;&quot;&gt;<br />
	</span></p>
<p><span style="color:#800080;">&lt;input name=&quot;Submit2&quot; type=&quot;submit&quot; class=&quot;downbutton&quot; value=&quot;下载文本格式&quot; onClick=&quot;document.form1.action.value=&#39;Pu00012_download&#39;;document.form1.target=&#39;_self&#39;;&quot;&gt;<br />
	</span></p>
<p><span style="color:#800080;">&lt;input name=&quot;Submit2&quot; type=&quot;submit&quot; class=&quot;button&quot; value=&quot;打 印&quot; onClick=&quot;document.form1.action.value=&#39;Pu00011_result&#39;;document.form1.target=&#39;_blank&#39;;&quot;&gt;</span></p>
<p>&nbsp;</p>
<p style="text-indent:28px; font-size:14px">整个表单提交过程是：我把日期赋给name为Pu00011_Input.trade_date的input的value。然后当我按按钮的时候，出发onclick事件，修改了form1.action.value的值。（这里的action指的是form1里嵌套的name为action的input标签，并不是action属性。）然后服务器端通过type为submit的input标签的name和value，以及form1.action.value来执行相应的动作。</p>
<p style="text-indent:28px; font-size:14px">下面是java代码。就写了主要的部分。</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Crawler <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
		HttpClient httpClient <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DefaultHttpClient<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		HttpPost httpost <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HttpPost<span style="color: #009900;">&#40;</span>
				<span style="color: #0000ff;">&quot;http://www.dce.com.cn/PublicWeb/MainServlet&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		List<span style="color: #339933;">&lt;</span>namevaluepair<span style="color: #339933;">&gt;</span> nvps <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ArrayList<span style="color: #339933;">&lt;</span>namevaluepair<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		nvps.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> BasicNameValuePair<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;action&quot;</span>,<span style="color: #0000ff;">&quot;Pu00012_download&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		nvps.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> BasicNameValuePair<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Pu00011_Input.trade_date&quot;</span>,<span style="color: #0000ff;">&quot;20110629&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		nvps.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> BasicNameValuePair<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Pu00011_Input.variety&quot;</span>,<span style="color: #0000ff;">&quot;all&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		nvps.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> BasicNameValuePair<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Pu00011_Input.trade_type&quot;</span>,<span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		nvps.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> BasicNameValuePair<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Submit2&quot;</span>,<span style="color: #0000ff;">&quot;下载文本格式&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		httpost.<span style="color: #006633;">setEntity</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> UrlEncodedFormEntity<span style="color: #009900;">&#40;</span>nvps, <span style="color: #0000ff;">&quot;GBK&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		HttpResponse response <span style="color: #339933;">=</span> httpClient.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>httpost<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		HttpEntity entity <span style="color: #339933;">=</span> response.<span style="color: #006633;">getEntity</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>response.<span style="color: #006633;">getStatusLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>entity.<span style="color: #006633;">getContentLength</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>entity.<span style="color: #006633;">getContentType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">File</span> storeFile <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;C:/test.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">FileOutputStream</span> output <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileOutputStream</span><span style="color: #009900;">&#40;</span>storeFile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">InputStream</span> input <span style="color: #339933;">=</span> entity.<span style="color: #006633;">getContent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">byte</span> b<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> j <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span>j <span style="color: #339933;">=</span> input.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span>b<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!=-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		output.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>b,<span style="color: #cc66cc;">0</span>,j<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		output.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>namevaluepair<span style="color: #339933;">&gt;&lt;/</span>namevaluepair<span style="color: #339933;">&gt;</span></pre></div></div>

<p style="text-indent:28px; font-size:14px">解释一下。</p>
<ul style="text-indent:28px; font-size:14px">
<li>HttpPost httpost = new HttpPost(&quot;http://www.dce.com.cn/PublicWeb/MainServlet&quot;); 括号中的地址是form标签中，action属性的地址。</li>
<li>nvps.add(new BasicNameValuePair(&quot;action&quot;,&quot;Pu00012_download&quot;)); 这之后都是加参数。注意，所有的input,select,textarea都要一一写。BasicNameValuePair第一个参数是name,第二哥参数是value. 对于select标签，value写你所选择的option的标签。关于最后的三个type为submit的标签，只需要写你想点击的按钮的name和value。在这里我们选择的是第二个按钮。&ldquo;下载文本文件&rdquo;。</li>
</ul>
<p style="text-indent:28px; font-size:14px">这样一来，如果要下载很多天的数据的话，很简单就可以加一个for循环了。</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://www.elly66.com/blog/">ELLY66</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.elly66.com/computer/how-to-use-htmlcomponents/ ">如何使用Apache HtmlComponents提交表单</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elly66.com/computer/how-to-use-htmlcomponents//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vim+xml快速摘抄单词释义</title>
		<link>http://www.elly66.com/computer/vimxml%e5%bf%ab%e9%80%9f%e6%91%98%e6%8a%84%e5%8d%95%e8%af%8d%e9%87%8a%e4%b9%89/</link>
		<comments>http://www.elly66.com/computer/vimxml%e5%bf%ab%e9%80%9f%e6%91%98%e6%8a%84%e5%8d%95%e8%af%8d%e9%87%8a%e4%b9%89/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 05:44:40 +0000</pubDate>
		<dc:creator>Elly66</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Vim]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSL]]></category>

		<guid isPermaLink="false">http://www.elly66.com/?p=641</guid>
		<description><![CDATA[<p style="text-indent: 28px; font-size: 14px;">考虑到Evernote改改格式什么的实在太慢了。我就想为什么不用vim呢？本来想研究一样怎么用python和evernote 的api直接把vim里写下的东西加入notebook.但是evernote api不支持python 3.我又不大想下python 2。。。于是折中了一下。我用vim创建一个html文件，然后用firefox打开，再用evernote 的firefox插件直接往evernote里加笔记。</p>
<p style="text-indent: 28px; font-size: 14px;">由于我想做的是类似生词本一样的东西。所以我觉得用xml比较合适，可以自定义标签。词条用&#60;entry&#62;，单词用&#60;word&#62;，音标用&#60;pron&#62;，解释用&#60;def&#62;，例句用&#60;ex&#62;. 然后我写了一个xsl文件，把xml按照一定格式转换成html（xsl之于xml，就像css之于html。）。只要写这么一个xsl文件，以后加单词的格式就再也不用操心了，只需要编辑xml文件即可。我就是喜欢这种内容和样式分离的感觉。</p>
<p style="text-indent: 28px; font-size: 14px;">但是编辑xml文件也是很繁琐的事情。我要写&#60;word&#62;&#60;/word&#62;,&#60;ex&#62;&#60;/ex&#62;,&#60;pron&#62;&#60;/pron&#62;什么的。这个时候强大的vim来了。通过vim的记录宏可以大大简化你的操作。</p>]]></description>
			<content:encoded><![CDATA[<p style="text-indent: 28px; font-size: 14px;">考虑到Evernote改改格式什么的实在太慢了。我就想为什么不用vim呢？本来想研究一样怎么用python和evernote 的api直接把vim里写下的东西加入notebook.但是evernote api不支持python 3.我又不大想下python 2。。。于是折中了一下。我用vim创建一个html文件，然后用firefox打开，再用evernote 的firefox插件直接往evernote里加笔记。</p>
<p style="text-indent: 28px; font-size: 14px;">由于我想做的是类似生词本一样的东西。所以我觉得用xml比较合适，可以自定义标签。词条用&lt;entry&gt;，单词用&lt;word&gt;，音标用&lt;pron&gt;，解释用&lt;def&gt;，例句用&lt;ex&gt;. 然后我写了一个xsl文件，把xml按照一定格式转换成html（xsl之于xml，就像css之于html。）。只要写这么一个xsl文件，以后加单词的格式就再也不用操心了，只需要编辑xml文件即可。我就是喜欢这种内容和样式分离的感觉。</p>
<p style="text-indent: 28px; font-size: 14px;">但是编辑xml文件也是很繁琐的事情。我要写&lt;word&gt;&lt;/word&gt;,&lt;ex&gt;&lt;/ex&gt;,&lt;pron&gt;&lt;/pron&gt;什么的。这个时候强大的vim来了。通过vim的记录宏可以大大简化你的操作。</p>
<p style="text-indent: 28px; font-size: 14px;"><strong>创建宏的方式：<br />
	</strong></p>
<p style="text-indent: 28px; font-size: 14px;">宏的名字可用a-z，（注意不能用大写字母！否则会很悲剧！）比如说我要创建名为a的宏。那我就在正常模式下按qa然后开始输入命令最后按q退出。当你要用a这个宏的时候只要按@a即可。</p>
<p style="text-indent: 28px; font-size: 14px;">如果你想在a这个宏之后在加点操作。就按qA，然后敲命令。这个命令会加到a宏的后面。最后按q退出录制。（我一开始不知道就毁了我一个辛辛苦苦建立的很复杂的宏。怨念！）</p>
<p style="text-indent: 28px; font-size: 14px;">当然对于一下不是很复杂的操作。完全可以用：let @a=&quot;你想输入的命令&ldquo;来添加。如果要在已有的宏之后添加，只需要:let @A=&rdquo;你想添加的操作命令&quot;。</p>
<p style="text-indent: 28px; font-size: 14px;"><strong>我创建了以下一些宏：</strong></p>
<p style="text-indent: 28px; font-size: 14px;"><strong>@c</strong>：清除&lt;entry&gt;里内嵌的除&lt;word&gt;之外的所有标签。这个宏比较复杂。首先是gg 把光标移到第一行，再来是替换命令，再来gg把光标移到第一行，最后：nohlsearch 去掉高亮。</p>
<p style="text-indent: 28px; font-size: 14px;">这个替换命令是:%s+\(&lt;\/word&gt;\)\(\_.\{-}\)\(&lt;\/entry&gt;\)+\1\r\3</p>
<p style="text-indent: 28px; font-size: 14px;">解释一下：</p>
<p style="text-indent: 28px; font-size: 14px;">%全文选择符。</p>
<p style="text-indent: 28px; font-size: 14px;">+分隔搜索部分和替换部分。</p>
<p style="text-indent: 28px; font-size: 14px;">搜索：&lt;/word&gt;和&lt;entry&gt;之间的任意字符（包括首尾的&lt;/word&gt;和&lt;entry&gt;）。&quot;\_.&quot;表示任意字符。加&quot;\{-}&quot;是因为，xml中有很多&lt;/word&gt;&lt;entry&gt;，我要找的是&lt;/word&gt;和之后第一个出现的&lt;entry&gt;之间的字符。</p>
<p style="text-indent: 28px; font-size: 14px;">替换：我要留着&lt;/word&gt;和&lt;entry&gt;，但是把中间的字符删除。因此需要在搜索时进行分组。\(和\)干的就是分组这个事情。\r是回车的意思。</p>
<p style="text-indent: 28px; font-size: 14px;"><strong>@w</strong>：查找&rsquo;&lt;word&gt;&lsquo;并把光标移到&rsquo;&gt;&lsquo;之后的一个字符上。（这样，通过cw命令我就可以<strong>c</strong>hange a <strong>w</strong>ord了） 其实就是一个搜索命令。/&lt;word&gt;/e+1。（我一般都是先输入所有生词的。这样就可以通过n移到下一个单词上，再按cw改词了）</p>
<p style="text-indent: 28px; font-size: 14px;"><strong>@p：</strong>添加&lt;pron&gt;&lt;/pron&gt;，并在标签中间粘贴来自系统剪贴板的文字（这里是音标）。我这里用了一个插件是<a href="http://www.vim.org/scripts/script.php?script_id=1397" target="_blank">xml.vim</a>。输入&ldquo;&lt;pron&gt;&gt;&rdquo;可以得到三行。第一行&lt;pron&gt;,第三行&lt;/pron&gt;,光标在第二行，在插入状态。<br />
	粘贴来自系统剪贴板的文字，在windows下可以直接使用Ctrl+v，但是不知道为什么，我每次按Ctrl+v，之后还要多按一次回车。所以我就使用&rdquo;+gp命令。&ldquo;+是寄存器，放的是系统剪贴版里的东西。</p>
<p style="text-indent: 28px; font-size: 14px;"><strong>@d：</strong>与@p类似，只不过是对&lt;def&gt;进行操作。</p>
<p style="text-indent: 28px; font-size: 14px;"><strong>@e：</strong>与@p和@d类似，对&lt;ex&gt;进行操作。</p>
<hr />
<p style="text-indent: 28px; font-size: 14px;">创建完宏以后，就感觉这个录入速度飞快无比。省了很多重复工作。而且很好记。一开始整个xml文件要clean一下，按@c；改word用@w，加音标（pronunciation）@p，加解释（definition）用@d，加例句（example）用@e。</p>
<p style="text-indent: 28px; font-size: 14px;">写完以后，我又用&rdquo;,r&quot;，直接让firefox打开这个xml。首先这个功能也很简单。把下面的代码存成xml_run.vim放到vimfiles/ftplugin文件夹中。然后，firefox上绿色的evernote按钮一按，就往Evernote新增了一个note。</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #804040;">map</span> <span style="color: #668080;">&lt;silent&gt;</span> <span style="color: #000000;">&lt;</span>buffer<span style="color: #000000;">&gt;</span> ,r <span style="color: #000000;">:</span><span style="color: #804040;">call</span> RunFile<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #668080;">&lt;CR&gt;</span>
&nbsp;
	<span style="color: #804040;">function</span><span style="color: #000000;">!</span> RunFile<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
	w
&nbsp;
	<span style="color: #000000;">!</span>start C<span style="color: #000000;">:</span>\Program Files\Mozilla Firefox\firefox<span style="color: #000000;">.</span><span style="color: #804040;">exe</span> <span style="color: #C5A22D;">&quot;%:p&quot;</span>
&nbsp;
	endfunction</pre></div></div>

<hr />
<p style="text-indent: 28px; font-size: 14px;">说明：（1）如果html使用css的话，复制到evernote后样式会不见的。因此，必须使用&lt;font&gt;,&lt;b&gt;,&lt;u&gt;这些标签来定义格式。</p>
<p style="text-indent: 28px; font-size: 14px;">（2）对xml和xsl不熟悉的同学：<a href="http://www.w3school.com.cn/x.asp" target="_blank">xml 教程</a>&nbsp; <a href="http://www.w3school.com.cn/xsl/xsl_languages.asp" target="_blank">xsl 教程</a></p>
<p style="text-indent: 28px; font-size: 14px;"><strong>附截图：</strong></p>
<p style="text-indent: 28px; font-size: 14px;"><img alt="" height="301" src="http://img.elly66.com/evernote.PNG" width="300" /></p>
<p style="text-indent: 28px; font-size: 14px;"><strong>附xsl代码：</strong>vocabulary.xsl</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;ISO-8859-1&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:stylesheet</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">xmlns:xsl</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/XSL/Transform&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;list/entry[1]/word&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>: <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;list/entry[2]/word&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
&nbsp;
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;entry&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;font</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#eb0073&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;b<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;u<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;word&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/u<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/b<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;br</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/font<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;font</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#328712&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;pron&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/font<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;br</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;def&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;br</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:for-each</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;ex&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;font</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#1c3387&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/font<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:for-each<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hr</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:stylesheet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://www.elly66.com/blog/">ELLY66</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.elly66.com/computer/vimxml%e5%bf%ab%e9%80%9f%e6%91%98%e6%8a%84%e5%8d%95%e8%af%8d%e9%87%8a%e4%b9%89/ ">vim+xml快速摘抄单词释义</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elly66.com/computer/vimxml%e5%bf%ab%e9%80%9f%e6%91%98%e6%8a%84%e5%8d%95%e8%af%8d%e9%87%8a%e4%b9%89//feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>使用Evernote后感</title>
		<link>http://www.elly66.com/computer/after-using-evernote/</link>
		<comments>http://www.elly66.com/computer/after-using-evernote/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 03:49:33 +0000</pubDate>
		<dc:creator>Elly66</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Evernote]]></category>

		<guid isPermaLink="false">http://www.elly66.com/?p=634</guid>
		<description><![CDATA[<p class="aligncenter" style="text-indent: 28px; font-size: 14px;"><img alt="" height="49" src="http://www.evernote.com/about/media/img/logo.png" width="196" /></p>
<p style="text-indent: 28px; font-size: 14px;">几个月前，我再次看到了网上推荐使用Evernote，一时冲动就去下了，顺便怂恿我一个同学也去下了。（之前看到过Evernote的介绍，当时因为种种原因，没有受到引诱。）用了真是爱不释手。Evernote分免费用户和付费用户。不过免费用户一个月可以传60MB的数据到服务器端。（我开始用的时候一个月45MB）。注意注意，是一个月60MB。我一开始以为是一个账户45MB，后来才发现月末会清零的。（我现在一共有523个notes，最大的一个note是2.5MB，最小的199B）这对于一般的文本资料和图片已经足够了。另外，Evernote有Android版，iphone版等等。非智能手机只要有浏览器也可以访问自己的notes。</p>
<p style="text-indent: 28px; font-size: 14px;"><strong>我用Evernote干什么：</strong>]]></description>
			<content:encoded><![CDATA[<p class="aligncenter" style="text-indent: 28px; font-size: 14px;"><img alt="" height="49" src="http://www.evernote.com/about/media/img/logo.png" width="196" /></p>
<p style="text-indent: 28px; font-size: 14px;">几个月前，我再次看到了网上推荐使用Evernote，一时冲动就去下了，顺便怂恿我一个同学也去下了。（之前看到过Evernote的介绍，当时因为种种原因，没有受到引诱。）用了真是爱不释手。Evernote分免费用户和付费用户。不过免费用户一个月可以传60MB的数据到服务器端。（我开始用的时候一个月45MB）。注意注意，是一个月60MB。我一开始以为是一个账户45MB，后来才发现月末会清零的。（我现在一共有523个notes，最大的一个note是2.5MB，最小的199B）这对于一般的文本资料和图片已经足够了。另外，Evernote有Android版，iphone版等等。非智能手机只要有浏览器也可以访问自己的notes。</p>
<p style="text-indent: 28px; font-size: 14px;"><strong>我用Evernote干什么：</strong></p>
<p style="text-indent: 28px; font-size: 14px;">Evernote可以做的事情很多。而且不需要担心你的资料是否杂乱无章。Evernote里有notebook，notebook可以嵌套notebook。你可以靠notebook来对你的note进行分大类。另外Evernote还有tags，tag可以套tag。tag的话可以对note分小类。Evernote的搜索功能可以找某个notebook里的有某个tag包含某个字词的note。</p>
<p style="text-indent: 28px; font-size: 14px;">1.存一些东西，可以用手机看</p>
<p style="text-indent: 28px; font-size: 14px;">有的时候，一些东西在电脑上没看完的。我会放到Evernote里。闲着无聊的时候看看。</p>
<p style="text-indent: 28px; font-size: 14px;">2. readling-list</p>
<p style="text-indent: 28px; font-size: 14px;">看到牛人推荐书单。下完pdf后，我会把书单存着，把评论存着。我的电子书已经多到，读的速度永远赶不上下的速度。哪天想起来要读了，还能知道当初为什么会下这本书的。</p>
<p style="text-indent: 28px; font-size: 14px;">2.&nbsp; 写论文找资料：</p>
<p style="text-indent: 28px; font-size: 14px;">Evernote干这个是最方便的。它有浏览器的插件。只要一按，就可以把当前页面保存进Evernote。你也可以只选择一部分保存。而且保存起来的note的标题是自动的。最重要的是：自动保存链接。天晓得，在写参考文献的时候，忘记你的资料是哪来的了，这是多么恶心的事情啊。</p>
<p style="text-indent: 28px; font-size: 14px;">3. 和别人分享 notes</p>
<p style="text-indent: 28px; font-size: 14px;">其实协作，倒不是Evernote的强项。免费版用户不可以修改别人分享给我的notebook，只能看看。而且客户端程序也是看不了分享的notebook。只能通过浏览器。但是小组合作时，用Evernote分享找到的资源还是不错的。（虽然我非常喜欢Google Doc，但是，你知道的。。。）</p>
<p style="text-indent: 28px; font-size: 14px;">4. 做生词本：</p>
<p style="text-indent: 28px; font-size: 14px;">我讨厌背单词。我讨厌按字母顺序背单词。单词表的作用应该只是为了复习，而不是为了学新的单词。词汇量的提升是要靠海量阅读还有整理。我以前拿过小本子抄录新的单词和词义。小本子可以让我随时能翻翻。不过感觉抄多了，手太酸，很难坚持。抄的太慢，能抄的单词太少。</p>
<p style="text-indent: 28px; font-size: 14px;">由于我大量的英语阅读都是在电脑上进行的，词典用的是灵格斯词霸。我灵格斯词霸里装了很多词典，如朗文当代、柯林斯高级英语学习词典、剑桥高级英语词典、牛津高阶英语词典、Wordnet Online、韦氏、麦克米兰&hellip;&hellip;之后单词整理的工作就电子化了。基本上，就是复制粘贴。有点偷懒了。但是有个缺点。我不会随身带着电脑。所以放在电脑里的单词，随身看不了。背单词，就应该在零零碎碎的时间背。大段大段的时间我可舍不得拿来背单词。</p>
<p style="text-indent: 28px; font-size: 14px;">用Evernote的话，我既可以在电脑上整理单词，又可以在手机上看。手机是随身带的了。不妨牺牲一点看小说的时间背背单词。</p>
<p style="text-indent: 28px; font-size: 14px;">Evernote里有一个saved searches对于造生词本还是很有好处的。比如我可以搜索我在一天前的加入的，两天前加入的，一周前加入的。创建saved search是一件很简单的事情。</p>
<p style="text-indent: 28px; font-size: 14px;"><strong>如何创建Saved Search：<br />
	</strong></p>
<p style="text-indent: 28px; font-size: 14px;">最简单的办法。选一下notebook，点点左边的tag，搜搜一个字词。然后按那个放大镜一样的图标，输入名称即可。好了，左边一栏中，Saved Searches下就有了刚刚你创建了的search。</p>
<p style="text-indent: 28px; font-size: 14px;">如果你要高级一点的，也可以。比如我要搜索，前天创建的，放在Vocabulary的，有一个名为Analogy的tag的note。</p>
<p style="text-indent: 28px; font-size: 14px;">在左栏Saved Search右击--&gt;Create Saved Search...</p>
<p style="text-indent: 28px; font-size: 14px;">在Query中输入notebook:Vocabulary created:day-2 -created:day-1 tag:Analogy</p>
<p style="text-indent: 28px; font-size: 14px;">&quot;noebook&quot;和&ldquo;tag&rdquo;很好理解。&ldquo;created&rdquo; 是指&quot;created since&ldquo;。&ldquo;day&ldquo;是指今天，&quot;day-2&quot;就是2天前。&rdquo;-created&ldquo;是指&rdquo;created before&ldquo; 。如果没有&rdquo;-created&ldquo;， 那么搜索出来的是前天、昨天和今天创建出来的符合条件的note。</p>
<p style="text-indent: 28px; font-size: 14px;">还可以搜索具有某些特征的note：比如带有图片，通过email添加，通过手机添加。具体参数是什么。我就不详细说了。你可以通过傻瓜式创建一个saved search然后右键点击Properties，看看Query中什么。</p>
<p style="text-indent: 28px; font-size: 14px;">&nbsp;</p>
<p style="text-indent: 28px; font-size: 14px;"><strong>缺点：</strong></p>
<p style="text-indent: 28px; font-size: 14px;">Evernote的文本编辑器功能是小弱的。如果要用Evernote做生词本的话，对格式肯定有要求的。比如生词的颜色，音标的颜色，例句的颜色，解释的颜色。但是Evernote里改格式，通通得鼠标操作。这对于喜欢Vim的我来说，是一件很残忍的事情。</p>
<p style="text-indent: 28px; font-size: 14px;">好在Evernote的api是开放的，网上已经有开发者把evernote整合进vim了。可惜他用的是ruby，我电脑里没装额。貌似该插件还有一些问题。我也下了Evernote的api，本来想用Python捣鼓捣鼓的。可以那个api不支持python 3。。。我很郁闷。。。</p>
<p style="text-indent: 28px; font-size: 14px;">之后我会介绍，我如何用vim+xml+xsl加速Evernote的录入速度。</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://www.elly66.com/blog/">ELLY66</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.elly66.com/computer/after-using-evernote/ ">使用Evernote后感</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elly66.com/computer/after-using-evernote//feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Vim、Python、Matlab互相调用</title>
		<link>http://www.elly66.com/computer/vim-python-matlab/</link>
		<comments>http://www.elly66.com/computer/vim-python-matlab/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 15:31:55 +0000</pubDate>
		<dc:creator>Elly66</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Matlab]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://www.elly66.com/?p=626</guid>
		<description><![CDATA[<p style="text-indent: 28px; font-size: 14px;">Vim,Python,Matlab之间有6=3*2中关系。我们这里只说，vim调Python, vim调matlab, python调matlab三种情况。vim可以编辑.py,和.m文件，也有语法高亮。如果能在编辑完文档后按个什么键，就能执行程序是在好不过的了。matlab强是强在科学计算，矩阵计算，但是它的数据结构很单一，字符串处理上稍显不足。因此python调用matlab的情况也是有可能的。python毕竟是一样很强大的语言。（官网上通篇英语，确有两个汉字&#8220;下载&#8221;）！</p>]]></description>
			<content:encoded><![CDATA[<p style="text-indent: 28px; font-size: 14px;">Vim,Python,Matlab之间有6=3*2中关系。我们这里只说，vim调Python, vim调matlab, python调matlab三种情况。vim可以编辑.py,和.m文件，也有语法高亮。如果能在编辑完文档后按个什么键，就能执行程序是在好不过的了。matlab强是强在科学计算，矩阵计算，但是它的数据结构很单一，字符串处理上稍显不足。因此python调用matlab的情况也是有可能的。python毕竟是一样很强大的语言。（官网上通篇英语，确有两个汉字&ldquo;下载&rdquo;）！</p>
<p style="font-size: 14px;">1. Vim调用Python</p>
<p style="text-indent: 28px; font-size: 14px;">从最简单的说吧。vim执行python代码，极其简单。</p>
<p style="text-indent: 28px; font-size: 14px;">：py+{python代码}，执行python2的代码。（+与｛｝不用输入）</p>
<p style="text-indent: 28px; font-size: 14px;">：py3+{python代码}，执行python3的代码。（+与｛｝不用输入）这种方式适合写只有一行的代码，也非常适合在编写vim插件时引用python代码。</p>
<p style="text-indent: 28px; font-size: 14px;">：pyfile+{xxx.py}, 执行python的代码，代码写在文件中。（+与｛｝不用输入）</p>
<p style="text-indent: 28px; font-size: 14px;">：py3file+{xxx.py}, 执行python3的代码。（+与｛｝不用输入）</p>
<p style="text-indent: 28px; font-size: 14px;">因此，编译当前的.py文件只需要输入:py3file+文件名 即可。每次打这几个字也挺反的，统一起见就用&ldquo;,r&rdquo;来执行代码。（和<a href="http://www.elly66.com/computer/vim-edit-latex/" target="_blank">之前的文章</a>中提到的用vim编译tex时的按键设成一样）代码如下：</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #804040;">map</span> <span style="color: #668080;">&lt;silent&gt;</span> <span style="color: #000000;">&lt;</span>buffer<span style="color: #000000;">&gt;</span> ,r <span style="color: #000000;">:</span>w<span style="color: #000000;">&lt;</span>CR<span style="color: #000000;">&gt;:</span>py3file <span style="color: #000000;">%&lt;</span>CR<span style="color: #000000;">&gt;&lt;</span>silent<span style="color: #000000;">&gt;&lt;</span>buffer<span style="color: #000000;">&gt;&lt;</span>cr<span style="color: #000000;">&gt;&lt;</span>cr<span style="color: #000000;">&gt;&lt;/</span>cr<span style="color: #000000;">&gt;&lt;/</span>cr<span style="color: #000000;">&gt;&lt;/</span>buffer<span style="color: #000000;">&gt;&lt;/</span>silent<span style="color: #000000;">&gt;</span></pre></div></div>

<p style="text-indent: 28px; font-size: 14px;">存在$vim\vimfiles\ftplugin\python.vim中，这其实就是filetype-plugin，因此打开.py以后按&ldquo;,r&rdquo;和打开.tex以后按&ldquo;,r&rdquo;,执行的代码是不同的。代码中%表示的就是现在编辑的文件的完整路径。&lt;CR&gt;表示回车。这里其实有两个命令，保存和编译。</p>
<p style="font-size: 14px;">2. Python调用Matlab</p>
<p style="text-indent: 28px; font-size: 14px;">在这里，我们要用到matlab的com。所以Python需要用到win32com.client模块。木有的话，就要下载一下了。（我用的是python 3，谢天谢地，这个模块在3里也能用）。我们这里举一个简单的例子。</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> win32com.<span style="color: black;">client</span> 
<span style="color: #ff7700;font-weight:bold;">try</span>:
	h=win32com.<span style="color: black;">client</span>.<span style="color: black;">GetActiveObject</span><span style="color: black;">&#40;</span><span style="color: #66cc66;">&amp;</span><span style="color: #808080; font-style: italic;">#39;matlab.desktop.application&amp;#39;)</span>
<span style="color: #ff7700;font-weight:bold;">except</span>:
	h=win32com.<span style="color: black;">client</span>.<span style="color: black;">Dispatch</span><span style="color: black;">&#40;</span><span style="color: #66cc66;">&amp;</span><span style="color: #808080; font-style: italic;">#39;matlab.desktop.application&amp;#39;)</span>
h.<span style="color: black;">Execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;f=8;&quot;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span>h.<span style="color: black;">GetVariable</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;f&quot;</span>,<span style="color: #483d8b;">&quot;base&quot;</span><span style="color: black;">&#41;</span></pre></div></div>

<p style="text-indent: 28px; font-size: 14px;">这个地方try和catch的作用主要是，如果已经有了一个matlab的server的话，就去用那个Server。&#39;matlab.desktop.application&#39;这里主要是开matlab的完整版窗口。如果不想开完整版，可以用&#39;matlab.application&#39;开command window。这里有一个问题。如果你是先通过双击桌面上的图标开matlab的话，在执行这个程序会在开一个窗口。</p>
<p style="text-indent: 28px; font-size: 14px;">其实，python不光可以连matlab，用这种方法，word,ie,excel,access，iTunes统统可以连接。代码中h的方法，是需要到matlab里查的。所以如果你连到word,ie,excel，access的话，你要到微软家去查了。我这里用了两个方法，一个是Execute,顾名思义，就是执行代码的。另一个是GetVariable，是可以进行数据传输的，实行数据传输的含有其他函数，比如GetFullMatrix,PutFullMatrix等等。</p>
<p style="text-indent: 28px; font-size: 14px;">如何用python调用.m文件，请看下节。</p>
<p style="font-size: 14px;">3. Vim调用Matlab</p>
<p style="text-indent: 28px; font-size: 14px;">Vim调用.m文件，本质上就是用Python调用.m文件的。代码如下：</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #804040;">function</span><span style="color: #000000;">!</span> RunMatlab<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
py3 <span style="color: #000000;">&lt;&lt;</span> EOF
import win32com<span style="color: #000000;">.</span>client 
<span style="color: #804040;">try</span><span style="color: #000000;">:</span>
	h=win32com<span style="color: #000000;">.</span>client<span style="color: #000000;">.</span>GetActiveObject<span style="color: #000000;">&#40;</span><span style="color: #000000;">&amp;</span>#<span style="color: #000000; font-weight:bold;">39</span>;matlab<span style="color: #000000;">.</span>desktop<span style="color: #000000;">.</span>application<span style="color: #000000;">&amp;</span>#<span style="color: #000000; font-weight:bold;">39</span>;<span style="color: #000000;">&#41;</span>
except<span style="color: #000000;">:</span>
	h=win32com<span style="color: #000000;">.</span>client<span style="color: #000000;">.</span>Dispatch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&amp;</span>#<span style="color: #000000; font-weight:bold;">39</span>;matlab<span style="color: #000000;">.</span>desktop<span style="color: #000000;">.</span>application<span style="color: #000000;">&amp;</span>#<span style="color: #000000; font-weight:bold;">39</span>;<span style="color: #000000;">&#41;</span>
import vim
h<span style="color: #000000;">.</span>Execute<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;temppath=&amp;#39;&quot;</span><span style="color: #000000;">+</span>vim<span style="color: #000000;">.</span><span style="color: #25BB4D;">eval</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&amp;</span>#<span style="color: #000000; font-weight:bold;">39</span>;expand<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;%:p:h&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&amp;</span>#<span style="color: #000000; font-weight:bold;">39</span>;<span style="color: #000000;">&#41;</span><span style="color: #000000;">+</span><span style="color: #C5A22D;">&quot;&amp;#39;&quot;</span><span style="color: #000000;">&#41;</span>
h<span style="color: #000000;">.</span>Execute<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;cd(temppath)&quot;</span><span style="color: #000000;">&#41;</span>
h<span style="color: #000000;">.</span>Execute<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;clear temppath&quot;</span><span style="color: #000000;">&#41;</span>
h<span style="color: #000000;">.</span>Execute<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;rehash path&quot;</span><span style="color: #000000;">&#41;</span>
print <span style="color: #000000;">&#40;</span>h<span style="color: #000000;">.</span>Execute<span style="color: #000000;">&#40;</span>vim<span style="color: #000000;">.</span><span style="color: #25BB4D;">eval</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&amp;</span>#<span style="color: #000000; font-weight:bold;">39</span>;expand<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;%:t:r&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&amp;</span>#<span style="color: #000000; font-weight:bold;">39</span>;<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
EOF
endfunction
<span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;win32&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&amp;&amp;</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;python3&quot;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #804040;">map</span> <span style="color: #668080;">&lt;silent&gt;</span> <span style="color: #000000;">&lt;</span>buffer<span style="color: #000000;">&gt;</span> ,r <span style="color: #000000;">:</span>w<span style="color: #000000;">&lt;</span>CR<span style="color: #000000;">&gt;:</span><span style="color: #804040;">call</span> RunMatlab<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #668080;">&lt;CR&gt;</span>
<span style="color: #804040;">endif</span></pre></div></div>

<p style="text-indent: 28px; font-size: 14px;">和前面一样用&quot;,r&quot;调用函数。先保存在编译。由于是vim插件，所以用py3 &lt;&lt; EOF {我的代码}EOF来执行多行python代码。注意第二个EOF前面不能有缩进。里面的python语句和上一节的差不多。不过在执行代码前，先修改了一下matlab的路径。在vim中执行python代码，可以用vim模块。vim.eval(&#39;expand(&quot;%:p:h&quot;)&#39;)就是输出当前编辑的文件所在文件夹的路径。</p>
<p style="text-indent: 28px; font-size: 14px;">h.Execute(&quot;rehash path&quot;)这句话一开始，我没有加。结果导致了什么呢？就是当我修改了.m文件，再次编译时，matlab执行的仍旧是修改以前的代码。一开始我感到什么诡异,会不会是没保存呢？可是&ldquo;,r&rdquo;的第一个动作就是保存。后来才知道，要让matlab里的path refresh一下。</p>
<p style="text-indent: 28px; font-size: 14px;">最后print (h.Execute(vim.eval(&#39;expand(&quot;%:t:r&quot;)&#39;)))。这样，就可以在VIm里面直接查看结果了。包括错误信息。</p>
<p style="text-indent: 28px; font-size: 14px;">保存在$vim\vimfiles\ftplugin\matlab.vim中。当然这个代码的先决条件是要装了python3，python2也可以，只要把py3改成py就可以了。</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://www.elly66.com/blog/">ELLY66</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.elly66.com/computer/vim-python-matlab/ ">Vim、Python、Matlab互相调用</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elly66.com/computer/vim-python-matlab//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用Vim编译Latex文档</title>
		<link>http://www.elly66.com/computer/vim-edit-latex/</link>
		<comments>http://www.elly66.com/computer/vim-edit-latex/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 13:20:27 +0000</pubDate>
		<dc:creator>Elly66</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Latex]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://www.elly66.com/?p=618</guid>
		<description><![CDATA[<p style="font-size: 14px; text-indent: 32px;">Vim是一个很强大的编辑器。如果你已经知道了这一点，请自行跳过下一段。有很多人不知道Vim。比如我哥哥。每次看到我打开Vim，就很兴奋很好奇的问我是什么东东。</p>
<p style="font-size: 14px; text-indent: 32px;">简单介绍一下Vim。<strong>Vim是一款文本编辑器</strong>，在Linux和Windows下都可以用。Vim虽然很奇怪，初学的人会非常不适应。但是熟悉以后，会觉得VIm非常强大。在使用Vim的时候，就感觉是在自己和自己说话。我要换一个词（Change a Word)，就打&#34;cw&#8221;；我要把这行和下一行连起来（join），就大&#8220;Shift+j&#8221;；我要在这行开头开始输入（Insert），就打&#8220;Shift+i&#8221;；我要在这行末输入（Append），就打&#8220;Shift+a&#8221;&#8230;&#8230;由于需要把命令和输入的文字分开来。Vim就有多种模式：Visual（可视），Insert（插入），Normal（普通）。对于重复的命令可以录制，也可以写入_vimrc文件和插件里，实现定制。插件分为global和filetype。<strong>Vim不只是一款文本编辑器。</strong>也可以把它做成IDE。</p>]]></description>
			<content:encoded><![CDATA[<p style="font-size: 14px; text-indent: 32px;">Vim是一个很强大的编辑器。如果你已经知道了这一点，请自行跳过下一段。有很多人不知道Vim。比如我哥哥。每次看到我打开Vim，就很兴奋很好奇的问我是什么东东。</p>
<p style="font-size: 14px; text-indent: 32px;">简单介绍一下Vim。<strong>Vim是一款文本编辑器</strong>，在Linux和Windows下都可以用。Vim虽然很奇怪，初学的人会非常不适应。但是熟悉以后，会觉得VIm非常强大。在使用Vim的时候，就感觉是在自己和自己说话。我要换一个词（Change a Word)，就打&quot;cw&rdquo;；我要把这行和下一行连起来（join），就大&ldquo;Shift+j&rdquo;；我要在这行开头开始输入（Insert），就打&ldquo;Shift+i&rdquo;；我要在这行末输入（Append），就打&ldquo;Shift+a&rdquo;&hellip;&hellip;由于需要把命令和输入的文字分开来。Vim就有多种模式：Visual（可视），Insert（插入），Normal（普通）。对于重复的命令可以录制，也可以写入_vimrc文件和插件里，实现定制。插件分为global和filetype。<strong>Vim不只是一款文本编辑器。</strong>也可以把它做成IDE。</p>
<p><img class="aligncenter" src="http://img.elly66.com/vimtex1.PNG" width="400" /></p>
<p style="font-size: 14px; text-indent: 32px;">我用的是gVim 7.3，Windows 7操作系统，已装CTex。</p>
<p style="font-size: 14px; text-indent: 32px;">用Vim编辑Latex文档，网上有插件，但不是特别想装。我觉得gVim自带的syntax\tex.vim已经很强大了。</p>
<p style="font-size: 14px;">1. 折叠。</p>
<p><img class="aligncenter" src="http://img.elly66.com/vimtex4.PNG" width="400" /></p>
<p style="font-size: 14px; text-indent: 32px;">这很重要。写了20页的论文，不折叠的话要昏过去的。折叠的功能，简单设置一下就好。syntax\tex.vim里已经写好了。</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;">&quot; 在Tex文档中根据section,subsection设置折叠</span>
<span style="color: #804040;">let</span> g<span style="color: #000000;">:</span>tex_fold_enabled=<span style="color: #000000; font-weight:bold;">1</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">fdm</span>=<span style="color: #804040;">syntax</span></pre></div></div>

<p style="font-size: 14px;">2.隐藏字符</p>
<p style="font-size: 14px; text-indent: 32px;">latex输入数学公式的时候，其恶心程度随着公式的复杂程度而上升。syntax\tex.vim已经写好了函数，只要稍稍设置一下就可以把一些代码隐藏掉，显示unicode。（注意：隐藏代码不会使文件发生改变）比如，</p>
<p><img class="aligncenter" src="http://img.elly66.com/vimtex3.PNG" width="400" /></p>
<p style="font-size: 14px; text-indent: 32px;">注意上图，光标所在行的代码并没有隐藏，因而隐藏代码对修改代码是不会有影响的。</p>
<p style="font-size: 14px; text-indent: 32px;">代码如下：</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #804040;">let</span> g<span style="color: #000000;">:</span>tex_conceal= <span style="color: #000000;">&amp;</span>#<span style="color: #000000; font-weight:bold;">39</span>;admgs<span style="color: #000000;">&amp;</span>#<span style="color: #000000; font-weight:bold;">39</span>;
<span style="color: #804040;">set</span> cole=<span style="color: #000000; font-weight:bold;">2</span>
<span style="color: #804040;">hi</span> Conceal guifg=DarkMagenta guibg=#<span style="color: #000000; font-weight:bold;">202020</span></pre></div></div>

<p style="font-size: 14px; text-indent: 32px;">其中，a = 重音/连写体 (accents/ligatures)，d = 定界符，m = 数学符号，g = 希腊字母，s = 上标/下标，可以根据需要对g:tex_conceal的值删改。当然要把背景色和前景色设置的和vim的配色方案相称。</p>
<p style="font-size: 14px; text-indent: 32px;">上面两段代码，写完后保存到$Vim\vimfiles\syntax\tex.vim中，vim73和vimfiles这两个文件夹，vim73是发布的文档，vimfiles里放下的插件。和自己写的插件。（一开始，我怎么弄都不有问题。后来悲剧的发现，我把它放在了$Vim\vimfiles\ftplugin里面，主要是这两段代码都要设置参数，这个参数是要给vim73\syntax\tex.vim里调用的，所以应该在gvim掉这个插件前就把参数设置好，否则vim73\syntax\tex.vim就会用默认值。）</p>
<p style="font-size: 14px;">3.编译</p>
<p style="font-size: 14px; text-indent: 32px;">代码如下：</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;">&quot; 编译Latex</span>
<span style="color: #804040;">map</span> <span style="color: #668080;">&lt;silent&gt;</span> <span style="color: #000000;">&lt;</span>buffer<span style="color: #000000;">&gt;</span> ,r <span style="color: #000000;">:</span><span style="color: #804040;">call</span> Tex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #668080;">&lt;cr&gt;</span>
<span style="color: #804040;">function</span><span style="color: #000000;">!</span> Tex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    w
    <span style="color: #000000;">!</span>latex <span style="color: #000000;">%</span>
    silent <span style="color: #000000;">!</span>dvipdfmx  <span style="color: #000000;">%:</span>r
    silent <span style="color: #000000;">!</span> start <span style="color: #000000;">%:</span>r<span style="color: #000000;">.</span>pdf
endfunction<span style="color: #000000;">&lt;/</span>cr<span style="color: #000000;">&gt;</span></pre></div></div>

<p style="font-size: 14px; text-indent: 32px;">代码放在$Vim\vimfiles\ftplugin\tex.vim里，这样每次开启tex文档后，都会定义编译函数。调用的话就按&quot;,r&quot;。!表示用的外部命令。 %表示现在编辑的文档地址。%:r表示的是现在编辑的文档地址去掉后缀名以后的字符串。最后打开pdf文档。这段代码的执行效果，和用WinEdt编译的差不多，如果报错的话，也是在那个黑黑的框里面的报错的。</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://www.elly66.com/blog/">ELLY66</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.elly66.com/computer/vim-edit-latex/ ">用Vim编译Latex文档</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elly66.com/computer/vim-edit-latex//feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[笔记] Good Reasoning Matters! A Constructive Approach to Critical Thinking</title>
		<link>http://www.elly66.com/logic/%e7%ac%94%e8%ae%b0-good-reasoning-matters-a-constructive-approach-to-critical-thinking/</link>
		<comments>http://www.elly66.com/logic/%e7%ac%94%e8%ae%b0-good-reasoning-matters-a-constructive-approach-to-critical-thinking/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 11:46:56 +0000</pubDate>
		<dc:creator>Elly66</dc:creator>
				<category><![CDATA[Logic]]></category>
		<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://www.elly66.com/?p=606</guid>
		<description><![CDATA[<p style="text-indent: 32px; font-size: 16px;">刚刚，花了四天时间把 Good Reasoning Matters! A Constructive Approach to Critical Thinking 看完。<a href="http://rapidshare.com/files/218829250/Groarke-grm.rar" target="_blank">在rapidshare上有下载。</a>这本书是一本国外的关于critical thinking的教材。个人强烈推荐。除了一些例子可能会有比较多的生词，整体上，这本书的语言还是比较好懂的。另外，我喜欢的一点是它没有介绍各种fallacy，而是从比较正面的角度去说怎样的argument是strong的。比如我之前介绍过<a href="http://www.elly66.com/logic/fallacy2-slippery-slope" target="_blank">名为slippery slope的fallacy</a>。并不是所有的splippery slope argument都是不对的。书中有很多例子和习题，部分习题有解答。作者对于例子的分析还是很到位的。书的最后，作者点评了一篇学生习作，最后改写了一下。两篇文章的对比，可以让你学到很多。</p>]]></description>
			<content:encoded><![CDATA[<p style="text-indent: 32px; font-size: 16px;">刚刚，花了四天时间把 Good Reasoning Matters! A Constructive Approach to Critical Thinking 看完。<a href="http://rapidshare.com/files/218829250/Groarke-grm.rar" target="_blank">在rapidshare上有下载。</a>这本书是一本国外的关于critical thinking的教材。个人强烈推荐。除了一些例子可能会有比较多的生词，整体上，这本书的语言还是比较好懂的。另外，我喜欢的一点是它没有介绍各种fallacy，而是从比较正面的角度去说怎样的argument是strong的。比如我之前介绍过<a href="http://www.elly66.com/logic/fallacy2-slippery-slope" target="_blank">名为slippery slope的fallacy</a>。并不是所有的splippery slope argument都是不对的。书中有很多例子和习题，部分习题有解答。作者对于例子的分析还是很到位的。书的最后，作者点评了一篇学生习作，最后改写了一下。两篇文章的对比，可以让你学到很多。</p>
<h2>Notes</h2>
<hr />
<div style="font-size: 16px;">
<div>A&nbsp;<strong>strong argument</strong>&nbsp;is an argument with</div>
<ul>
<li>acceptable premises <span style="color: rgb(0, 0, 128);">（如果premise是用sub-argument撑起来的，先看看sub-argument是不是strong)</span></li>
<li>a conclusion that follows from them
<ul>
<li>relevant to the conclusion <span style="color: rgb(0, 0, 128);">（如果premise能使得conclusion更像真的（正相关)，或者更像假的(负相关), 一点作用也没有的就是irrelevant）</span></li>
<li>sufficient to establish it as probable <span style="color: rgb(0, 0, 128);">（这一条和结论的强度有关。）</span></li>
</ul>
</li>
</ul>
<h3 style="color: blue;"><strong>Empirical Reasoning</strong></h3>
<hr />
<h3 style="color: red;">Generalizations:</h3>
<div><strong>Premise 1:</strong>&nbsp;Sample S is a representative sample of Xs.</div>
<div><strong>Premise 2:</strong>&nbsp;Proportion 1 of Xs in S are Y.</div>
<div><strong>Conclusion:</strong>&nbsp;Proportion 2 of Xs are Y.</div>
<div>Proportion 1 &lt;= Proportion 2</div>
<div>&nbsp;</div>
<div>A good generalization shows</div>
<ul>
<li>that the individuals in the sample have some property Y, and</li>
<li>that the sample is representative, i.e. that it is
<ul>
<li>of reasonable size, and</li>
<li>free of bias</li>
</ul>
</li>
</ul>
<p>	A strong generalization based on a&nbsp;<strong>poll</strong>&nbsp;shows</p>
<ul>
<li>that the individuals polled have the properties in question, to the extent claimed; and</li>
<li>that the sample is representative, i.e. that it is&nbsp;
<ul>
<li>free of sampling errors, and
<ul>
<li>Is the sample reliable?</li>
<li>Is its size sufficient?</li>
<li>How was it selected? Does it include all relevant subgroups?</li>
<li>Is the margin of error it allows within reasonable bounds?</li>
</ul>
</li>
<li>free of measurement errors.
<ul>
<li>How reliable is the information collected about the measured property?</li>
<li>What kinds of questions were asked? (Are the statements vague or ambiguous? e.g. How do you feel about X?)</li>
<li>How were the results of the immediate questions interpreted?</li>
<li>Were the questions or answers affected by biases(of wording, timing, sponsors, etc.)?</li>
</ul>
</li>
</ul>
</li>
</ul>
<hr />
<h3 style="color: red;">General&nbsp;causal&nbsp;reasoning:</h3>
<div><strong>Premise 1:</strong>&nbsp;X is correlated with Y.</div>
<div><strong>Premise 2:</strong>&nbsp;The correlation between X and Y is not due to chance.</div>
<div><strong>Premise 3:</strong>&nbsp;There is no second cause, Z, that is the cause of Y or of both X and Y;</div>
<div><strong>Premise 4:</strong>&nbsp;Y is not the cause of X.</div>
<div><strong>Conclusion:</strong>&nbsp;X causes Y.</div>
<div>&nbsp;</div>
<h3 style="color: red;">Particular&nbsp;causal&nbsp;reasoning:</h3>
<div><strong>Premise 1:</strong>&nbsp;X causes Y. (general causal reasoning)</div>
<div><strong>Premise 2:</strong>&nbsp;This is the best explanation of the y in question.</div>
<div><strong>Conclusion:</strong>This x caused this y.</div>
<div>
<hr />
<h3 style="color: red;">Appeals to &nbsp;ignorance:</h3>
</p></div>
<div>
<div><strong>Premise 1:</strong>&nbsp;We have found no evidence to disprove( or prove) proposition P.</div>
<div><strong>Premise 2:</strong>&nbsp;There has been a responsible attempt to garner evidence.</div>
<p>		<span style="color: rgb(0, 0, 128);">（一般这一类的weak argument都是这个条件不满足。）</span></p>
<div><strong>Conclusion:&nbsp;</strong>Proposition P is improbable (or probable).</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<h3 style="color: blue;">Moral Reasoning</h3>
<hr />
<h3 style="color: red;">Slippery-Slope Arguments:</h3>
</p></div>
<div><strong>Premise 1:</strong>&nbsp;A causes B, B causes C, and so on to X. ()<span style="color: rgb(0, 0, 128);">（每个因果关系都要论证，一个有问题，就变成了fallacy）</span></div>
<div><strong>Premise 2:</strong>&nbsp;X is undesirable (or X is desirable). (moral reasoning)</div>
<div><strong>Conclusion:&nbsp;</strong>A is wrong (or right).</div>
<div>
<hr />
<h3 style="color: red;">Argument by analogy:</h3>
</p></div>
<div><strong>Premise 1:</strong>&nbsp;X,W,R,S are p,q,r,...,z</div>
<div><strong>Premise 2:</strong>&nbsp;Y is p,q,r,...</div>
<div><strong>Hidden Premise:</strong>&nbsp;p,q,r are the properties relevant to z.</div>
<div><strong>Conclusion:&nbsp;</strong>Y is z.</div>
<div>&nbsp;</div>
<div>
<div>A good argument by analogy supports a conclusion about Y by pointing out</div>
<ul>
<li>that is true of some X</li>
<li>that Y is similar to X in sufficient relevant respects</li>
<li>that X and Y are not relevantly dissimilar <span style="color: rgb(0, 0, 128);">（一般反驳这种argument就是反驳这一点。）</span></li>
</ul>
<hr />
<h3 style="color: red;">Appeals to Precedent</h3>
</p></div>
<div>A strong appeal to precedent shows that some action X should be allowed (or disallowed)&nbsp;because some analogous case has been allowed (or disallowed), or because future analogous cases should be allowed( or disallowed).</div>
<div>&nbsp;</div>
<div>A strong counter-argument to an appeal to precedent shows that one of these claims is unacceptable because the cases being compared are not relevantly analogous.</div>
<hr />
<h3 style="color: red;">Two-wrongs reasoning</h3>
<div><strong>Premise 1:</strong>&nbsp;X is a response to another wrong, Y, the unjust consequences of which it is designed to&nbsp;<em>cancel or alleviate</em>.</div>
<div><strong>Premise 2:</strong>&nbsp;X is less wrong than Y.</div>
<div><strong>Premise 3:&nbsp;</strong>There is no morally preferable way to respond to Y.</div>
<div><strong>Conclusion:&nbsp;</strong>X is justified</div>
<div>&nbsp;</div>
<h3 style="color: red;">Two-wrongs by analogy</h3>
<div><strong>Premise 1:</strong>&nbsp;A wrong, X, is analogous to other wrongs (Y, X, W, ...) that have been permitted.</div>
<div><strong>Premise 2:</strong>&nbsp;Fairness in the form of consistency is more important than preventing X.</div>
<div><strong>Premise 3:&nbsp;</strong>There is no morally preferable way to respond to the situation.</div>
<div>
<div><strong>Conclusion:&nbsp;</strong>X should be accepted/allowed.</div>
<div>&nbsp;</div>
<div>
<h3 style="color: blue;">Ethotic Schemes</h3>
<p>			<span style="color: rgb(0, 0, 128);">（这种类型的论证不能单独支撑一个结论，这个结论之后还需要经过更严密的论证。）</span></p>
<hr /></div>
<h3 style="color: red;">Pro homine (for the person) reasoning:</h3>
</p></div>
<div><strong>Premise 1:</strong>&nbsp;X says that y.</div>
<div><strong>Premise 2:</strong>&nbsp;X is knowledgeable, trustworthy, and free of bias.</div>
<div><strong>Conclusion:&nbsp;</strong>y should be accepted.</div>
<div>
<hr />
<h3 style="color: red;">Arguments from authority</h3>
</p></div>
<div><strong>Premise 1:</strong>&nbsp;X is an authority with credentials c, who believes and states y.</div>
<div><strong>Premise 2:</strong>&nbsp;Credentials c are relevant to y.</div>
<div><strong>Premise 3:&nbsp;</strong>X is not biased.</div>
<div><strong>Premise 4:</strong>&nbsp;There is wide agreement among the relevant experts over y.</div>
<div><strong>Premise 5:</strong>&nbsp;y is an appropriate field in which consensus is possible.</div>
<div><strong>Conclusion:&nbsp;</strong>y should be accepted.</div>
<hr />
<h3 style="color: red;">Ad homine (against the person) reasoning:</h3>
<div><strong>Premise 1:</strong>&nbsp;X says that y.</div>
<div><strong>Premise 2:</strong>&nbsp;X is unreliable(i.e. not knowledgeable, trustworthy, and/or free of bias)</div>
<div><strong>Conclusion:&nbsp;</strong>y should not be accepted (on the grounds that X says y).</div>
<div>
<hr /></div>
<h3 style="color: red;">A guilt(honor)-by-association argument:</h3>
<div><strong>Premise 1:</strong>&nbsp;A person or group X is associated with another person or group Y.</div>
<div><strong>Premise 2:</strong>&nbsp;Y has questionable (creditable) beliefs or behaves in a questionable (creditable) way.</div>
<div><strong>Conclusion:&nbsp;</strong>X&#39;s character and/or claims are questionable (creditable).</div>
<div>&nbsp;</div>
<div>A strong guilt(honor)-by-association</div>
<ul>
<li>there is good reason to believe that the alleged association between X and Y really exist;</li>
<li>there is good reason to question(credit) the beliefs or the behavior or Y;</li>
<li>there is no good reason to differentiate X from Y.</li>
</ul>
</div>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://www.elly66.com/blog/">ELLY66</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.elly66.com/logic/%e7%ac%94%e8%ae%b0-good-reasoning-matters-a-constructive-approach-to-critical-thinking/ ">[笔记] Good Reasoning Matters! A Constructive Approach to Critical Thinking</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elly66.com/logic/%e7%ac%94%e8%ae%b0-good-reasoning-matters-a-constructive-approach-to-critical-thinking//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MATLAB版图像:让我们手拉手，心连心，我们都是二附中人</title>
		<link>http://www.elly66.com/computer/matlab-efz-pic/</link>
		<comments>http://www.elly66.com/computer/matlab-efz-pic/#comments</comments>
		<pubDate>Sun, 07 Nov 2010 12:21:59 +0000</pubDate>
		<dc:creator>Elly66</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://www.elly66.com/?p=594</guid>
		<description><![CDATA[<p style="font-size: 16pt; text-indent: 20pt;">今天在人人网上看到母校的一个学弟，用图形计算器画了一幅图:</p>
<p><img class="aligncenter" src="http://fmn.rrimg.com/fmn053/20101107/1605/b_large_zohm_7cdf000630255c43.jpg" width="400pt" /></p>
<p style="font-size: 16pt;">好心的学弟给出了画这幅图所需要的23个函数解析式。我用matlab画了一下。<img class="aligncenter" src="http://img.elly66.com/efz.png" width="500pt" /></p>
<p style="font-size: 16pt;">下面是代码：</p>]]></description>
			<content:encoded><![CDATA[<p style="font-size: 16pt; text-indent: 20pt;">今天在人人网上看到母校的一个学弟，用图形计算器画了一幅图:</p>
<p><img class="aligncenter" src="http://fmn.rrimg.com/fmn053/20101107/1605/b_large_zohm_7cdf000630255c43.jpg" width="400pt" /></p>
<p style="font-size: 16pt;">好心的学弟给出了画这幅图所需要的23个函数解析式。我用matlab画了一下。<img class="aligncenter" src="http://img.elly66.com/efz.png" width="500pt" /></p>
<p style="font-size: 16pt;">下面是代码：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #33f;">0.15</span>*x^<span style="color: #33f;">2</span>+<span style="color: #33f;">1.5</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">2</span>,<span style="color: #33f;">2</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">hold</span> on
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;-x^<span style="color: #33f;">2</span>-<span style="color: #33f;">1</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #080;">&#40;</span>y-<span style="color: #33f;">3</span><span style="color: #080;">&#41;</span>^<span style="color: #33f;">2</span>+x^<span style="color: #33f;">2</span>-<span style="color: #33f;">0.5</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #080;">&#40;</span>y-<span style="color: #33f;">2.75</span><span style="color: #080;">&#41;</span>^<span style="color: #33f;">2</span>+<span style="color: #080;">&#40;</span>x-<span style="color: #33f;">4</span><span style="color: #080;">&#41;</span>^<span style="color: #33f;">2</span>-<span style="color: #33f;">0.5</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #080;">&#40;</span>y-<span style="color: #33f;">2.75</span><span style="color: #080;">&#41;</span>^<span style="color: #33f;">2</span>+<span style="color: #080;">&#40;</span>x+<span style="color: #33f;">4</span><span style="color: #080;">&#41;</span>^<span style="color: #33f;">2</span>-<span style="color: #33f;">0.5</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;t&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;<span style="color: #33f;">1.05</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">0.4</span>,<span style="color: #33f;">0.4</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;-<span style="color: #33f;">0.2</span>*<span style="color: #080;">&#40;</span>t^<span style="color: #33f;">2</span>-<span style="color: #33f;">1</span><span style="color: #080;">&#41;</span>-<span style="color: #33f;">1</span>&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;t&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">2</span>,<span style="color: #33f;">2</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #33f;">0.2</span>*<span style="color: #080;">&#40;</span>t^<span style="color: #33f;">2</span>-<span style="color: #33f;">1</span><span style="color: #080;">&#41;</span>+<span style="color: #33f;">1</span>&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;t&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">2</span>,<span style="color: #33f;">2</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;t&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;<span style="color: #33f;">0.35</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">0.4</span>,<span style="color: #33f;">0.3</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;-<span style="color: #33f;">5</span>/x-<span style="color: #33f;">0.2</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">5.2</span>,-<span style="color: #33f;">2</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #33f;">3</span>/<span style="color: #080;">&#40;</span>x+<span style="color: #33f;">3</span><span style="color: #080;">&#41;</span>+<span style="color: #33f;">2.2</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">5</span>,-<span style="color: #33f;">3</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #33f;">0.15</span>*y^<span style="color: #33f;">2</span>-<span style="color: #33f;">2.65</span>&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;y&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">5</span>,<span style="color: #33f;">2</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;-<span style="color: #33f;">0.4</span>&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;t&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">0.45</span>,<span style="color: #33f;">1.05</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #33f;">5</span>/x-<span style="color: #33f;">0.2</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span><span style="color: #33f;">2</span>,<span style="color: #33f;">5.2</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #33f;">3</span>/<span style="color: #080;">&#40;</span><span style="color: #33f;">3</span>-x<span style="color: #080;">&#41;</span>+<span style="color: #33f;">2.2</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span><span style="color: #33f;">3</span>,<span style="color: #33f;">5</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;-<span style="color: #33f;">0.15</span>*y^<span style="color: #33f;">2</span>+<span style="color: #33f;">2.65</span>&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;y&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">5</span>,<span style="color: #33f;">2</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;x&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;-<span style="color: #33f;">0.7</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">3.8</span>,-<span style="color: #33f;">3</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;x&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;<span style="color: #33f;">0.7</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">3.8</span>,-<span style="color: #33f;">3</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;x&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;<span style="color: #33f;">0</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">3.8</span>,-<span style="color: #33f;">3</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;-<span style="color: #33f;">3.8</span>&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;y&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span>-<span style="color: #33f;">0.7</span>,<span style="color: #33f;">0.7</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;x&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;<span style="color: #33f;">0.7</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span><span style="color: #33f;">3</span>,<span style="color: #33f;">3.8</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;x&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;-<span style="color: #33f;">0.7</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span><span style="color: #33f;">3</span>,<span style="color: #33f;">3.8</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ezplot</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #33f;">1.75</span>*x-<span style="color: #33f;">5.95</span>&amp;#<span style="color: #33f;">39</span>;,<span style="color: #080;">&#91;</span><span style="color: #33f;">3</span>,<span style="color: #33f;">3.8</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">axis</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span>-<span style="color: #33f;">6</span> <span style="color: #33f;">6</span> -<span style="color: #33f;">2</span> <span style="color: #33f;">6</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">findobj</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;Type&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;line&amp;#<span style="color: #33f;">39</span>;<span style="color: #080;">&#41;</span>,&amp;#<span style="color: #33f;">39</span>;Color&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;k&amp;#<span style="color: #33f;">39</span>;,&amp;#<span style="color: #33f;">39</span>;LineWidth&amp;#<span style="color: #33f;">39</span>;,<span style="color: #33f;">5</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">title</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;&amp;#<span style="color: #33f;">39</span>;<span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">xlabel</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;&amp;#<span style="color: #33f;">39</span>;<span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">ylabel</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;&amp;#<span style="color: #33f;">39</span>;<span style="color: #080;">&#41;</span></pre></td></tr></table></div>

<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://www.elly66.com/blog/">ELLY66</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.elly66.com/computer/matlab-efz-pic/ ">MATLAB版图像:让我们手拉手，心连心，我们都是二附中人</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elly66.com/computer/matlab-efz-pic//feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>一个小贴士：解决wp-syntax自动转义问题（续）</title>
		<link>http://www.elly66.com/computer/wp-syntax2/</link>
		<comments>http://www.elly66.com/computer/wp-syntax2/#comments</comments>
		<pubDate>Sun, 07 Nov 2010 05:04:15 +0000</pubDate>
		<dc:creator>Elly66</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.elly66.com/?p=587</guid>
		<description><![CDATA[<p style="font-size: 16pt; text-indent: 20pt;">在<a href="http://www.elly66.com/computer/wp-syntax/" title="一个小贴士：解决wp-syntax自动转义问题">一个小贴士：解决wp-syntax自动转义问题</a>中，我说了一下如何修改wp_syntax_highlight函数解决自动转义问题。但是，今天我又发现了一个新的问题：单引号。单引号的字符实体是&#38;#39。显示的代码是&#8220;&#38;#39&#8221;，而不是&#8220;&#8217;&#8221;。</p>]]></description>
			<content:encoded><![CDATA[<p style="font-size: 16pt; text-indent: 20pt;">在<a href="http://www.elly66.com/computer/wp-syntax/" title="一个小贴士：解决wp-syntax自动转义问题">一个小贴士：解决wp-syntax自动转义问题</a>中，我说了一下如何修改wp_syntax_highlight函数解决自动转义问题。但是，今天我又发现了一个新的问题：单引号。单引号的字符实体是&amp;#39。显示的代码是&ldquo;&amp;#39&rdquo;，而不是&ldquo;&rsquo;&rdquo;。接着上次的修改：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$escaped</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>false<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$code</span> <span style="color: #339933;">=</span> <span style="color: #990000;">htmlspecialchars_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$code</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p style="font-size: 16pt;">查阅了一下，上面的htmlspecialchars_decode()的语法是</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">htmlspecialchars_decode</span><span style="color: #009900;">&#40;</span>string<span style="color: #339933;">,</span>quotestyle<span style="color: #009900;">&#41;</span></pre></div></div>

<p style="font-size: 16pt;">quotestyle有三个参数：ENT_COMPAT（默认，仅解码双引号）、ENT_QUOTES（解码双引号和单引号）、ENT_NOQUOTES（不解码任何引号）。因此，我们需要做的就是：把</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$escaped</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;false&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$code</span> <span style="color: #339933;">=</span> <span style="color: #990000;">htmlspecialchars_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$code</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p style="font-size: 16pt;">变成</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$escaped</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;false&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$code</span> <span style="color: #339933;">=</span> <span style="color: #990000;">htmlspecialchars_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$code</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">ENT_QUOTES</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p style="font-size: 16pt;">保存，Over！</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://www.elly66.com/blog/">ELLY66</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.elly66.com/computer/wp-syntax2/ ">一个小贴士：解决wp-syntax自动转义问题（续）</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elly66.com/computer/wp-syntax2//feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Matlab命令：保存图像</title>
		<link>http://www.elly66.com/maths/matlab-save-figure/</link>
		<comments>http://www.elly66.com/maths/matlab-save-figure/#comments</comments>
		<pubDate>Sun, 07 Nov 2010 04:52:10 +0000</pubDate>
		<dc:creator>Elly66</dc:creator>
				<category><![CDATA[Maths]]></category>
		<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://www.elly66.com/?p=562</guid>
		<description><![CDATA[<p style="font-size: 16pt; text-indent: 20pt;">matlab 如何保存图像？非常简单。画图--&#62;点击&#8220;文件&#8221;--&#62;点击&#8220;另存为&#8221;--&#62;点击&#8220;文件类型&#8221;选择格式--&#62;修改名称--&#62;点击&#8220;确定&#8221;。为什么还要掌握保存图像的命令呢？</p>
<p style="font-size: 16pt; text-indent: 20pt;">话说，这个学期一开学的第一次数值分析的上机作业。取 $latex \alpha=1,5,10,20;$ $latex n=10,20,30,50 $，画图。总共16幅图。因为我要保存图片，没有办法用循环语句。用上述保存方法，完成这次作业，我要手工输入16次画图命令，用鼠标点击16*5=80次，输入16个图片名称。我居然要使用计算机干这种枯燥的体力活！饶了我吧！</p>]]></description>
			<content:encoded><![CDATA[<p style="font-size: 16pt; text-indent: 20pt;">matlab 如何保存图像？非常简单。画图--&gt;点击&ldquo;文件&rdquo;--&gt;点击&ldquo;另存为&rdquo;--&gt;点击&ldquo;文件类型&rdquo;选择格式--&gt;修改名称--&gt;点击&ldquo;确定&rdquo;。为什么还要掌握保存图像的命令呢？</p>
<p style="font-size: 16pt; text-indent: 20pt;">话说，这个学期一开学的第一次数值分析的上机作业。取 <img src='http://s.wordpress.com/latex.php?latex=%5Calpha%3D1%2C5%2C10%2C20%3B&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\alpha=1,5,10,20;' title='\alpha=1,5,10,20;' class='latex' /> <img src='http://s.wordpress.com/latex.php?latex=n%3D10%2C20%2C30%2C50%20&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='n=10,20,30,50 ' title='n=10,20,30,50 ' class='latex' />，画图。总共16幅图。因为我要保存图片，没有办法用循环语句。用上述保存方法，完成这次作业，我要手工输入16次画图命令，用鼠标点击16*5=80次，输入16个图片名称。我居然要使用计算机干这种枯燥的体力活！饶了我吧！</p>
<p style="font-size: 16pt; text-indent: 20pt;">保存图像的命令很简单，就是print。可以用它保存成任意的图片格式，也可以用它打印图片。</p>
<p style="font-size: 16pt;">例:</p>

<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">line</span>
<span style="color: #0000FF;">print</span> -deps2 myfig <span style="color: #228B22;">%文件名也可以写成myfig.eps</span></pre></div></div>

<p style="font-size: 16pt;">上例，把图像保存为黑白的矢量图格式，文件名为myfig.eps，保存在current folder下。可以用pwd命令查看current folder的路径。我现在有16幅图片，我不想不图片和代码放在一个文件夹下。我要新建一个文件夹fig专门放图片。</p>

<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">line</span>
<span style="color: #0000FF;">mkdir</span> fig <span style="color: #228B22;">%current folder下新建一个文件夹fig</span>
filepath=<span style="color: #080;">&#91;</span><span style="color: #0000FF;">pwd</span> &amp;#<span style="color: #33f;">39</span>;\fig\myfile.<span style="">eps</span>&amp;#<span style="color: #33f;">39</span>;<span style="color: #080;">&#93;</span>;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">print</span><span style="color: #080;">&#40;</span>&amp;#<span style="color: #33f;">39</span>;-deps2&amp;#<span style="color: #33f;">39</span>;,filepath<span style="color: #080;">&#41;</span></pre></div></div>

<p style="font-size: 16pt;">我希望能够保存成bmp，jpg或者png的格式。这个也是很简单的。把&ldquo;-deps2&rdquo;换掉。</p>
<table border="1" cellpadding="1" cellspacing="1" class="aligncenter" style="width: 200px;">
<tbody>
<tr>
<td><strong>图像格式</strong></td>
<td><strong>命令</strong></td>
</tr>
<tr>
<td>24位bmp</td>
<td>-dbmp</td>
</tr>
<tr>
<td>黑白eps</td>
<td>-deps</td>
</tr>
<tr>
<td>彩色eps</td>
<td>-depsc</td>
</tr>
<tr>
<td>黑白eps Level 2</td>
<td>-deps2</td>
</tr>
<tr>
<td>彩色eps Level 2</td>
<td>-depsc2</td>
</tr>
<tr>
<td>24位jpeg</td>
<td>-djpeg</td>
</tr>
<tr>
<td>彩色pdf</td>
<td>-dpdf</td>
</tr>
<tr>
<td>png</td>
<td>-dpng</td>
</tr>
</tbody>
</table>
<p style="font-size: 16pt;">注意：如果图中有汉字，不要存成eps或pdf，否则会出现乱码。可以存成jpeg，png再转成eps。或者，避免在图中用汉字。</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://www.elly66.com/blog/">ELLY66</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.elly66.com/maths/matlab-save-figure/ ">Matlab命令：保存图像</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elly66.com/maths/matlab-save-figure//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

