﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-石建 | Fat Mind</title><link>http://www.blogjava.net/shijian/</link><description /><language>zh-cn</language><lastBuildDate>Thu, 09 Apr 2026 20:12:02 GMT</lastBuildDate><pubDate>Thu, 09 Apr 2026 20:12:02 GMT</pubDate><ttl>60</ttl><item><title>meta学习 - 前辈kafka</title><link>http://www.blogjava.net/shijian/archive/2013/07/06/378641.html</link><dc:creator>石建 | Fat Mind</dc:creator><author>石建 | Fat Mind</author><pubDate>Sat, 06 Jul 2013 06:57:00 GMT</pubDate><guid>http://www.blogjava.net/shijian/archive/2013/07/06/378641.html</guid><wfw:comment>http://www.blogjava.net/shijian/comments/378641.html</wfw:comment><comments>http://www.blogjava.net/shijian/archive/2013/07/06/378641.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shijian/comments/commentRss/378641.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shijian/services/trackbacks/378641.html</trackback:ping><description><![CDATA[<p class="MsoNormal"><br /></p><a href="http://incubator.apache.org/kafka/design.html">http://incubator.apache.org/kafka/design.html</a><span style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; ">
</span><div>
<br />
1.<span class="Apple-style-span" style="font-size: 21px; font-weight: bold; ">Why we built this</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; "><br />
</span>&nbsp;&nbsp; &nbsp;asd（activity stream data）数据是任何网站的一部分，反映网站使用情况，如：那些内容被搜索、展示。通常，此部分数据被以log方式记录在文件，然后定期的整合和分析。od（operation data）是关于机器性能数据，和其它不同途径整合的操作数据。<br />
&nbsp;&nbsp; &nbsp;在近几年，asd和od变成一个网站重要的一部分，更复杂的基础设施是必须的。<br />
<span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; ">&nbsp;&nbsp; &nbsp; 数据特点：<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;a、大吞吐量的不变的ad，对实时计算是一个挑战，会很容易超过10倍or100倍。</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; ">&nbsp;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;b、传统的记录log方式是<span class="Apple-style-span" style="font-family: verdana, 'courier new'; font-size: 14px; line-height: 21px; color: #000000; ">respectable and scalable方式去支持离线处理，但是延迟太高。<br />
</span></span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; line-height: 22px; "><span class="Apple-style-span" style="font-size: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;Kafka is intended to be a single queuing platform that can support both offline and online use cases.</span><br />
<br />
<span class="Apple-style-span" style="font-size: 15px;">2.</span><span class="Apple-style-span" style="font-size: 30px; font-weight: bold; ">Major Design Elements</span><br />
<div>
<p style="font-size: 15px; ">There is a small number of major design decisions that make Kafka different from most other messaging systems:</p>
<ol style="font-size: 15px; ">
     <li>Kafka is designed for persistent messages as the common case；<span class="Apple-style-span" style="font-size: 14px; ">消息持久</span></li>
     <li>Throughput rather than features are the primary design constraint；<span class="Apple-style-span" style="font-size: 14px; ">吞吐量是第一要求</span></li>
     <li>State about&nbsp;<em>what</em>&nbsp;has been consumed is maintained as part of the consumer not the server；<span class="Apple-style-span" style="font-size: 14px; ">状态由客户端维护</span></li>
     <li>Kafka is explicitly distributed. It is assumed that producers, brokers, and consumers are all spread over multiple machines；<span class="Apple-style-span" style="font-size: 14px; ">必须是分布式<br />
     </span></li>
</ol>
</div>
3.<span class="Apple-style-span" style="font-size: 21px; font-weight: bold; ">Basics</span><br />
<span style="font-size: 15px; "><em>&nbsp;&nbsp;&nbsp;&nbsp;Messages</em></span>&nbsp;<span style="font-size: 15px; ">are the fundamental unit of communication</span>；<br />
&nbsp;&nbsp;&nbsp;&nbsp;Messages are</span>&nbsp;<span style="font-size: 15px; "><em>published</em></span>&nbsp;<span style="font-size: 15px; ">to a</span>&nbsp;<span style="font-size: 15px; "><em>topic</em></span>&nbsp;<span style="font-size: 15px; ">by a</span>&nbsp;<span style="font-size: 15px; "><em>producer&nbsp;</em></span><span style="font-size: 15px; ">which means they are physically sent to a server acting as a</span>&nbsp;<span style="font-size: 15px; "><em>broker，消息被生产者发布到一个topic，意味着物理的发送消息到broker；<br />
</em></span>&nbsp;&nbsp; &nbsp;多个consumer订阅一个topic，则此topic的每个消息都会被分发到每个consumer；<br />
&nbsp;&nbsp; &nbsp;kafka是分布式：producer、broker、consumer，均可以由集群的多台机器组成，相互协作 a logic group；<br />
&nbsp;&nbsp; &nbsp;属于同一个consumer group的每一个consumer process，每个消息能准确的由其中的一个process消费；<span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; ">A more common case in our own usage is that we have multiple logical consumer groups, each consisting of a cluster of consuming machines that act as a logical whole.<br />
</span>&nbsp;&nbsp; &nbsp;kafka不管一个topic有多少个consumer，其消息仅会存储一份。<br />
<br />
4.<span class="Apple-style-span" style="font-size: 21px;"><strong>Message Persistence and Caching</strong></span><br />
<span class="Apple-style-span" style="font-size: 16px; font-weight: bold; "><br />
4.1 Don't fear the filesystem !<br />
</span>&nbsp;&nbsp; &nbsp;kafka完全依赖文件系统去存储和cache消息；<br />
&nbsp;&nbsp; &nbsp;大家通常对磁盘的直觉是'很慢'，则使人们对持久化结构，是否能提供有竞争力的性能表示怀疑；实际上，磁盘到底有多慢或多块，完全取决于如何使用磁盘，<span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; ">a properly designed disk structure can often be as fast as the network.</span><br />
&nbsp;&nbsp; &nbsp;<a href="http://baike.baidu.com/view/969385.htm">http://baike.baidu.com/view/969385.htm</a>&nbsp;raid-5&nbsp;<br />
&nbsp;&nbsp; &nbsp;<a href="http://www.china001.com/show_hdr.php?xname=PPDDMV0&amp;dname=66IP341&amp;xpos=172">http://www.china001.com/show_hdr.php?xname=PPDDMV0&amp;dname=66IP341&amp;xpos=172</a>&nbsp;磁盘种类<br />
&nbsp;&nbsp; &nbsp;磁盘顺序读写的性能非常高，&nbsp;<span style="color: #222222; font-family: Arial, sans-serif; line-height: 22px; "><span class="Apple-style-span" style="font-size: 15px;">linear writes on a 6 7200rpm SATA RAID-5 array is about 300MB/sec；</span><span class="Apple-style-span" style="font-family: verdana, 'courier new'; font-size: 14px; line-height: 21px; color: #000000; ">These linear reads and writes are the most predictable of all usage patterns, and hence the one detected and optimized best by the operating system using read-ahead and write-behind techniques。顺序读写是最可预见的模式，因此操作系统通过read-head和write-behind技术去优化。<br />
</span><span class="Apple-style-span" style="font-size: 15px;">&nbsp;&nbsp; &nbsp;现代操作系统，用mem作为disk的cache；Any modern OS will happily divert&nbsp;</span><em style="font-size: 15px; ">all</em><span class="Apple-style-span" style="font-size: 15px;">&nbsp;free memory to disk caching with little performance penalty when the memory is reclaimed. All disk reads and writes will go through this unified cache.&nbsp;</span><br />
<span class="Apple-style-span" style="font-size: 15px;">&nbsp;&nbsp; &nbsp;Jvm：a、对象的内存开销是非常大的，通常是数据存储的2倍；b、当heap数据增大时，gc代价越来越大；</span><br />
<span class="Apple-style-span" style="font-size: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;As a result of these factors using the filesystem and relying on pagecache is superior to maintaining an in-memory cache or other structure。依赖文件系统和pagecache是优于mem cahce或其它结构的。</span><br />
<span class="Apple-style-span" style="font-size: 15px;">&nbsp;&nbsp; &nbsp;数据压缩，Doing so will result in a cache of up to 28-30GB on a 32GB machine without GC penalties.&nbsp;</span><br />
<span class="Apple-style-span" style="font-size: 15px;">&nbsp;&nbsp; &nbsp;This suggests a design which is very simple: maintain as much as possible in-memory and flush to the filesystem only when necessary. 尽可能的维持在内存中，仅当必须时写回到文件系统.</span><br />
<span class="Apple-style-span" style="font-size: 15px;">&nbsp;&nbsp; &nbsp;当数据被立即写回到持久化的文件，而未调用flush，其意味着数据仅被写入到os pagecahe，在后续某个时间由os flush。Then we add a configuration driven flush policy to allow the user of the system to control how often data is flushed to the physical disk (every N messages or every M seconds) to put a bound on the amount of data "at risk" in the event of a hard crash. 提供flush策略。</span><br />
<span class="Apple-style-span" style="font-size: 15px;"><br />
4.2&nbsp;</span><span class="Apple-style-span" style="font-size: 18px; font-weight: bold; ">Constant Time Suffices<br />
</span>&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">The persistent data structure used in messaging systems metadata is often a BTree. BTrees are the most versatile data structure available, and make it possible to support a wide variety of transactional and non-transactional semantics in the messaging system.</span><span style="color: #222222; font-family: Arial, sans-serif; line-height: 22px; "><br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp;Disk seeks come at 10 ms a pop, and each disk can do only one seek at a time so parallelism is limited. Hence even a handful of disk seeks leads to very high overhead.&nbsp;<br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp;Furthermore BTrees require a very sophisticated page or row locking implementation to avoid locking the entire tree on each operation.
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">The implementation must pay a fairly high price for row-locking or else effectively serialize all reads.</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; "><br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp; &nbsp; 持久化消息的元数据通常是BTree结构，但磁盘结构，其代价太大。原因：寻道、避免锁整棵树。<br />
&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: yellow; ">Intuitively a persistent queue could be built on simple reads and appends to files as is commonly the case with logging solutions.</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; "><br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp; &nbsp; 持久化队列可以构建在读和append to 文件。所以不支持BTree的一些语义，但其好处是：O(1)消耗，无锁读写。<br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="background-color: #ffffff; "><font class="Apple-style-span" color="#222222" face="Arial, sans-serif"><span class="Apple-style-span" style="font-size: 15px; line-height: 22px;">the performance is completely decoupled from the data size--one server can now take full advantage of a number of cheap, low-rotational speed 1+TB SATA drives.&nbsp;
<div style="display: inline-block; "></div>
</span></font></span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">Though they have poor seek performance, these drives often have comparable performance for large reads and writes at 1/3 the price and 3x the capacity.</span><span class="Apple-style-span" style="background-color: #ffffff; "><font class="Apple-style-span" color="#222222" face="Arial, sans-serif"><span class="Apple-style-span" style="font-size: 15px; line-height: 22px;"><br />
</span></font></span><span style="color: #222222; font-family: Arial, sans-serif; line-height: 22px; "><br />
4.3&nbsp;<span class="Apple-style-span" style="color: #2e4a8e; font-size: 23px; font-weight: bold; background-color: #ffffff; ">Maximizing Efficiency</span><br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp;Furthermore we assume each message published is read at least once (and often multiple times), hence we optimize for consumption rather than production. 更进一步，我们假设被发布的消息至少会读一次，因此优化consumer优先于producer。<br />
</span><span style="color: #222222; font-family: Arial, sans-serif; line-height: 22px; ">&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">There are two common causes of inefficiency : <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;two many network requests, （
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;APIs are built around a "message set" abstraction，
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">This allows network requests to group messages together and amortize the overhead of the network roundtrip rather than sending a single message at a time.</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">） 仅提供批量操作api，则每次网络开销是平分在一组消息，而不是单个消息。<br />
&nbsp; &nbsp; and excessive byte copying.（
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">The message log maintained by the broker is itself just a directory of message sets that have been written to disk.
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">Maintaining this common format allows optimization of the most important operation : network transfer of persistent log chunks.</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">）<br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp;To understand the impact of sendfile, it is important to understand the common data path for transfer of data from file to socket:
<ol>
     <li>The operating system reads data from the disk into pagecache in kernel space</li>
     <li>The application reads the data from kernel space into a user-space buffer</li>
     <li>The application writes the data back into kernel space into a socket buffer</li>
     <li>The operating system copies the data from the socket buffer to the NIC buffer where it is sent over the network<br />
     </li>
</ol>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp; &nbsp; 利用os提供的zero-copy，
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">only the final copy to the NIC buffer is needed.</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; "> <br />
<br />
4.4&nbsp;<span class="Apple-style-span" style="color: #2e4a8e; font-size: 23px; font-weight: bold; ">End-to-end Batch Compression</span><br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp;In many cases the bottleneck is actually not CPU but network. This is particularly true for a data pipeline that needs to send messages across data centers.
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">Efficient compression requires compressing multiple messages together rather than compressing each message individually.&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">Ideally this would be possible in an end-to-end fashion &#8212; that is, data would be compressed prior to sending by the producer and remain compressed on the server, only being decompressed by the eventual consumers.</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;<br />
&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">A batch of messages can be clumped together compressed and sent to the server in this form. This batch of messages will be delivered all to the same consumer and will remain in compressed form until it arrives there.<br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp; &nbsp; 理解：kafka&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">producer&nbsp;</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">api 提供批量压缩，broker不对此批消息做任何操作，且以压缩的方式，一起被发送到consumer。<br />
<br />
4.5&nbsp;<span class="Apple-style-span" style="color: #2e4a8e; font-size: 23px; font-weight: bold; ">Consumer state</span><br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp;Keeping track of&nbsp;<em>what</em>&nbsp;has been consumed is one of the key things a messaging system must provide.&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">State tracking requires updating a persistent entity and potentially causes random accesses.&nbsp;<br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">Most messaging systems keep metadata about what messages have been consumed on the broker. That is, as a message is handed out to a consumer, the broker records that fact locally.&nbsp;大部分消息系统，存储是否被消费的元信息在broker。则是说，一个消息被分发到一个consumer，broker记录。<br />
&nbsp; &nbsp; 问题：当consumer消费失败后，会导致消息丢失；改进：每次consumer消费后，给broker ack，若broker在超时时间未收到ack，则重发此消息。<br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp; &nbsp; 问题：1.当消费成功，但未ack时，会导致消费2次 &nbsp;2.
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;now the broker must keep multiple states about every single message &nbsp;3.当broker是多台机器时，则状态之间需要同步<br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; "><br />
4.5.1&nbsp;<span class="Apple-style-span" style="color: #2e4a8e; font-size: 18px; font-weight: bold; ">Message delivery semantics</span><br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">So clearly there are multiple possible message delivery guarantees that could be provided :&nbsp;</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">at most once 、at least once、exactly once。<br />
&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">This problem is heavily studied, and is a variation of the "transaction commit" problem. Algorithms that provide exactly once semantics exist, two- or three-phase commits and Paxos variants being examples, but they come with some drawbacks. They typically require multiple round trips and may have poor guarantees of liveness (they can halt indefinitely).&nbsp;<br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp; &nbsp; 消费分发语义，是 &#8216;事务提交&#8217; 问题的变种。算法提供 exactly onece 语义，两阶段 or 三阶段提交，paxos 均是例子，但它们存在缺点。典型的问题是要求多次round trip，且
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">poor guarantees of liveness。<br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">Kafka does two unusual things with respect to metadata.&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">First the stream is partitioned on the brokers into a set of distinct partitions.&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">Within a partition messages are stored in the order in which they arrive at the broker, and will be given out to consumers in that same order. </span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: yellow; ">This means that rather than store metadata for each message (marking it as consumed, say), we just need to store the "high water mark" for each combination of consumer, topic, and partition.</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;&nbsp;</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; "><br />
</span><span style="color: #222222; font-family: Arial, sans-serif; line-height: 22px; ">&nbsp; &nbsp;&nbsp;<br />
<span class="Apple-style-span" style="font-size: 15px; ">4.5.2&nbsp;</span></span><span class="Apple-style-span" style="color: #2e4a8e; font-family: Arial, sans-serif; font-size: 18px; font-weight: bold; line-height: 22px; background-color: #ffffff; ">Consumer state</span><span style="color: #222222; font-family: Arial, sans-serif; line-height: 22px; "><span class="Apple-style-span" style="font-size: 15px; "><br />
</span></span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp;In Kafka, the consumers are responsible for maintaining state information (offset) on what has been consumed.</span><span style="color: #222222; font-family: Arial, sans-serif; line-height: 22px; "><span class="Apple-style-span" style="font-size: 15px; ">&nbsp;
<div style="display: inline-block; "></div>
</span></span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">Typically, the Kafka consumer library writes their state data to zookeeper.<br />
</span><span style="color: #222222; font-family: Arial, sans-serif; line-height: 22px; ">&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: yellow; ">This solves a distributed consensus problem, by removing the distributed part!</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; "><br />
</span><span style="color: #222222; font-family: Arial, sans-serif; line-height: 22px; ">&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">There is a side benefit of this decision. A consumer can deliberately&nbsp;<em>rewind</em>&nbsp;back to an old offset and re-consume data.<br />
</span><span style="color: #222222; font-family: Arial, sans-serif; line-height: 22px; "><br />
4.5.3&nbsp;<span class="Apple-style-span" style="color: #2e4a8e; font-size: 18px; font-weight: bold; background-color: #ffffff; ">Push vs. pull</span><br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">A related question is whether consumers should pull data from brokers or brokers should push data to the subscriber.
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">There are pros and cons to both approaches.</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; "><br />
&nbsp;&nbsp;&nbsp;&nbsp;However a push-based system has difficulty dealing with diverse consumers as the broker controls the rate at which data is transferred. push目标是consumer能在最大速率去消费，可不幸的是，当consume速率小于生产速率时，<span class="Apple-style-span" style="font-size: 14px; ">the consumer tends to be overwhelmed。<br />
</span>&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">A pull-based system has the nicer property that the consumer simply falls behind and catches up when it can. This can be mitigated with some kind of backoff protocol by which the consumer can indicate it is overwhelmed, but getting the rate of transfer to fully utilize (but never over-utilize) the consumer is trickier than it seems. Previous attempts at building systems in this fashion led us to go with a more traditional pull model. &nbsp;不存在push问题，且也保证充分利用consumer能力。<br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; "><br />
5.&nbsp;<span class="Apple-style-span" style="color: #2e4a8e; font-size: 23px; font-weight: bold; ">Distribution</span><br />
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp;Kafka is built to be run across a cluster of machines as the common case. There is no central "master" node. Brokers are peers to each other and can be added and removed at anytime without any manual configuration changes. Similarly, producers and consumers can be started dynamically at any time. Each broker registers some metadata (e.g., available topics) in Zookeeper. Producers and consumers can use Zookeeper to discover topics and to co-ordinate the production and consumption. The details of producers and consumers will be described below.<br />
</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; line-height: 22px; background-color: #ffffff; "><br />
<font class="Apple-style-span" color="#222222"><span class="Apple-style-span" style="font-size: 15px;">6.&nbsp;</span></font><font class="Apple-style-span" color="#2e4a8e"><span class="Apple-style-span" style="font-size: 23px;"><strong>Producer<br />
</strong></span></font><font class="Apple-style-span" color="#222222"><span class="Apple-style-span" style="font-size: 15px;"><br />
</span></font></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; line-height: 22px; background-color: #ffffff; "><font class="Apple-style-span" color="#222222"><span class="Apple-style-span" style="font-size: 15px;">6.1&nbsp;</span></font><span class="Apple-style-span" style="color: #2e4a8e; font-size: 18px; font-weight: bold; ">Automatic producer load balancing<br />
</span></span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp;Kafka supports client-side load balancing for message producers or use of a dedicated load balancer to balance TCP connections.&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;The advantage of using a level-4 load balancer is that each producer only needs a single TCP connection, and no connection to zookeeper is needed.&nbsp;
<div style="display: inline-block; "></div>
</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">The disadvantage is that the balancing is done at the TCP connection level, and hence it may not be well balanced (if some producers produce many more messages then others, evenly dividing up the connections per broker may not result in evenly dividing up the messages per broker).<br />
</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; line-height: 22px; background-color: #ffffff; "><span class="Apple-style-span" style="color: #2e4a8e; font-size: 18px; font-weight: bold; ">&nbsp; &nbsp;&nbsp;
<div style="display: inline-block; "></div>
</span></span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">Client-side zookeeper-based load balancing solves some of these problems. It allows the producer to dynamically discover new brokers, and balance load on a per-request basis.&nbsp;I</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">t allows the producer to partition data according to some key instead of randomly.</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; line-height: 22px; background-color: #ffffff; "><span class="Apple-style-span" style="color: #2e4a8e; font-size: 18px; font-weight: bold; "><br />
</span></span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">
<p>&nbsp;&nbsp;&nbsp;&nbsp;The working of the zookeeper-based load balancing is described below. Zookeeper watchers are registered on the following events&#8212;</p>
<ul>
     <li>a new broker comes up</li>
     <li>a broker goes down</li>
     <li>a new topic is registered</li>
     <li>a broker gets registered for an existing topic</li></ul></span><p>&nbsp;&nbsp;&nbsp;&nbsp;Internally, the producer maintains an elastic pool of connections to the brokers, one per broker. <span style="background-color: yellow; ">This pool is kept updated to establish/maintain connections to all the live brokers, through the zookeeper watcher callbacks</span>. When a producer request for a particular topic comes in, a broker partition is picked by the partitioner (see section on semantic partitioning). The available producer connection is used from the pool to send the data to the selected broker partition.<br />
&nbsp; &nbsp; producer通过zk，管理与broker的连接。当一个请求，根据partition rule 计算分区，从连接池选择对应的connection，发送数据。<br />
<br />
6.2 <span class="Apple-style-span" style="color: #2e4a8e; font-family: Arial, sans-serif; font-size: 18px; font-weight: bold; line-height: 22px; background-color: #ffffff; ">Asynchronous send</span></p>
<span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp;Asynchronous non-blocking operations are fundamental to scaling messaging systems.<br />&nbsp; &nbsp;&nbsp;<div style="display: inline-block; "></div></span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">This allows buffering of produce requests in a in-memory queue and batch sends that are triggered by a time interval or a pre-configured batch size.&nbsp;<br /></span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; "><br />6.3&nbsp;<span class="Apple-style-span" style="color: #2e4a8e; font-size: 18px; font-weight: bold; ">Semantic partitioning<br /></span>&nbsp; &nbsp;&nbsp;<div style="display: inline-block; "></div></span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">The producer has the capability to be able to semantically map messages to the available kafka nodes and partitions.&nbsp;<div style="display: inline-block; "></div></span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; ">This allows partitioning the stream of messages with some semantic partition function based on some key in the message to spread them over broker machines.&nbsp;</span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; "><br /><br /></span><span class="Apple-style-span" style="color: #222222; font-family: Arial, sans-serif; font-size: 15px; line-height: 22px; background-color: #ffffff; "><div>
<br />
</div>
</span></div><img src ="http://www.blogjava.net/shijian/aggbug/378641.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shijian/" target="_blank">石建 | Fat Mind</a> 2013-07-06 14:57 <a href="http://www.blogjava.net/shijian/archive/2013/07/06/378641.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Js练习：操纵cookie</title><link>http://www.blogjava.net/shijian/archive/2012/09/09/387339.html</link><dc:creator>石建 | Fat Mind</dc:creator><author>石建 | Fat Mind</author><pubDate>Sun, 09 Sep 2012 07:18:00 GMT</pubDate><guid>http://www.blogjava.net/shijian/archive/2012/09/09/387339.html</guid><wfw:comment>http://www.blogjava.net/shijian/comments/387339.html</wfw:comment><comments>http://www.blogjava.net/shijian/archive/2012/09/09/387339.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shijian/comments/commentRss/387339.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shijian/services/trackbacks/387339.html</trackback:ping><description><![CDATA[<p style="margin: 4px 0px; padding: 2px 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: normal; background-color: #ffffff; ">1.Js代码，login.js文件<br /><br /></p><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008000; ">//</span><span style="color: #008000; ">用户的登陆信息写入cookies</span><span style="color: #008000; "><br /></span><span style="color: #0000FF; ">function</span>&nbsp;SetCookie(form)<span style="color: #008000; ">//</span><span style="color: #008000; ">两个参数，一个是cookie的名子，一个是值</span><span style="color: #008000; "><br /></span>{&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">var</span>&nbsp;name&nbsp;=&nbsp;form.name.value;<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">var</span>&nbsp;password&nbsp;=&nbsp;form.password.value;<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">var</span>&nbsp;Days&nbsp;=&nbsp;1;&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">此&nbsp;cookie&nbsp;将被保存&nbsp;7&nbsp;天&nbsp;</span><span style="color: #008000; "><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">var</span>&nbsp;exp&nbsp;&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;Date();&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">生成一个现在的日期，加上保存期限，然后设置cookie的生存期限！</span><span style="color: #008000; "><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;exp.setTime(exp.getTime()&nbsp;+&nbsp;Days*24*60*60*1000);<br />&nbsp;&nbsp;&nbsp;&nbsp;document.cookie&nbsp;=&nbsp;"user="+&nbsp;escape(name)&nbsp;+&nbsp;"/"&nbsp;+&nbsp;escape(password)&nbsp;+&nbsp;";expires="&nbsp;+&nbsp;exp.toGMTString();<br />}<br /><span style="color: #008000; ">//</span><span style="color: #008000; ">取cookies函数--正则表达式(不会，学习正则表达式)&nbsp;&nbsp;</span><span style="color: #008000; "><br /></span><span style="color: #0000FF; ">function</span>&nbsp;getCookie(name)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">var</span>&nbsp;arr&nbsp;=&nbsp;document.cookie.match(<span style="color: #0000FF; ">new</span>&nbsp;RegExp("(^|&nbsp;)"+name+"=([^;]*)(;|$)"));<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>(arr&nbsp;!=&nbsp;<span style="color: #0000FF; ">null</span>)&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;unescape(arr[2]);&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;<span style="color: #0000FF; ">null</span>;<br />}<br /><span style="color: #008000; ">//</span><span style="color: #008000; ">取cookies函数--普通实现&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000; "><br /></span>&nbsp;&nbsp;<span style="color: #0000FF; ">function</span>&nbsp;&nbsp;&nbsp;readCookie(form){&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">var</span>&nbsp;&nbsp;&nbsp;cookieValue&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;"";&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">var</span>&nbsp;&nbsp;&nbsp;search&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;"user=";&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>(document.cookie.length&nbsp;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&nbsp;0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offset&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;document.cookie.indexOf(search);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>(offset&nbsp;!=&nbsp;&nbsp;-1){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offset&nbsp;&nbsp;&nbsp;+=&nbsp;&nbsp;&nbsp;search.length;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;document.cookie.indexOf(";",offset);&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>&nbsp;&nbsp;&nbsp;(end&nbsp;&nbsp;==&nbsp;&nbsp;-1)&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;document.cookie.length;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">获取cookies里面的值&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000; "><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookieValue&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;unescape(document.cookie.substring(offset,end))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>(cookieValue&nbsp;!=&nbsp;<span style="color: #0000FF; ">null</span>){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">var</span>&nbsp;str&nbsp;=&nbsp;cookieValue.split("/");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form.name.value&nbsp;=&nbsp;str[0];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form.password.value&nbsp;=&nbsp;str[1];&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;<br /><span style="color: #008000; ">//</span><span style="color: #008000; ">删除cookie，（servlet里面：设置时间为0，设置为-1和session的范围是一样的），javascript好像是有点区别</span><span style="color: #008000; "><br /></span><span style="color: #0000FF; ">function</span>&nbsp;delCookie()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">var</span>&nbsp;name&nbsp;=&nbsp;"admin";<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">var</span>&nbsp;exp&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;Date();<br />&nbsp;&nbsp;&nbsp;&nbsp;exp.setTime(exp.getTime()&nbsp;-&nbsp;1);<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">var</span>&nbsp;cval=getCookie(name);<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>(cval!=<span style="color: #0000FF; ">null</span>)&nbsp;document.cookie=&nbsp;name&nbsp;+&nbsp;"="+cval+";expires="+exp.toGMTString();<br />}</div><br /><p>&nbsp;</p><p style="margin: 4px 0px; padding: 2px 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: normal; background-color: #ffffff; "><span style="background-color: #f8f8f8; ">2.jsp代码，文件login.jsp</span><span style="color: #0000ff; background-color: #f8f8f8; "><br /><br /></span></p><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->&lt;%@&nbsp;page&nbsp;contentType="text/html;&nbsp;charset=gb2312"&nbsp;language="java"<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">import</span>="java.sql.*"&nbsp;errorPage=""%&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&lt;html&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;head&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;meta&nbsp;http-equiv="Content-Type"&nbsp;content="text/html;&nbsp;charset=gb2312"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;javascript&nbsp;控制&nbsp;cookie&lt;/title&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;link&nbsp;href="css/style.css"&nbsp;rel="stylesheet"&nbsp;type="text/css"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;script&nbsp;type="text/javascript"&nbsp;src="js/login.js"&gt;&lt;/script&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/head&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;script&nbsp;language="javascript"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;checkEmpty(form){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">for</span>(i=0;i&lt;form.length;i++){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>(form.elements[i].value==""){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert("表单信息不能为空");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;<span style="color: #0000FF; ">false</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&lt;/script&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;body&nbsp;onload="readCookie(form)"&gt;&nbsp;&lt;!--&nbsp;作为JavaScript控制的cookie--&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;align="center"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;table&nbsp;width="324"&nbsp;height="225"&nbsp;border="0"&nbsp;cellpadding="0"&nbsp;cellspacing="0"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&nbsp;height="50"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&nbsp;&gt;&lt;/td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&nbsp;align="center"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&nbsp;background="images/back.jpg"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;br&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;br&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;登陆<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;form&nbsp;name="form"&nbsp;method="post"&nbsp;action=""&nbsp;onSubmit="return&nbsp;checkEmpty(form)"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type="hidden"&nbsp;name="id"&nbsp;value="-1"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;table&nbsp;width="268"&nbsp;border="1"&nbsp;cellpadding="0"&nbsp;cellspacing="0"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&nbsp;align="center"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&nbsp;width="63"&nbsp;height="30"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用户名：<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&nbsp;width="199"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type="text"&nbsp;name="name"&nbsp;id="name"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&nbsp;align="center"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&nbsp;height="30"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;密码：<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type="password"&nbsp;name="password"&nbsp;id="password"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/table&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;br&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type="submit"&nbsp;value="提交"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type="checkbox"&nbsp;name="cookie"&nbsp;onclick="SetCookie(form)"&gt;记住我&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/form&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/table&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/body&gt;<br />&lt;/html&gt;</div><p>&nbsp;</p><div style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: normal; background-color: #ffffff; "><p style="margin: 4px 0px; padding: 2px 0px; "><br />目的：当你再次打开login.jsp页面，表单里面的内容已经写好了，是你上一次的登陆信息！</p></div><div style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: normal; background-color: #ffffff; "><br />问题：1.JavaScript里面取cookie都是写死的，不是很灵活！</div><div style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: normal; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.JavaScript的cookie是按照字符串的形式存放的，所以拿出的时候，你要按照你放进去的形式来选择！</div><div style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: normal; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.本来是想实现自动登陆的，可我的每个页面都要session的检查！一个客户端，一个服务器端，没能实现！</div><p style="margin: 4px 0px; padding: 2px 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: normal; background-color: #ffffff; ">&nbsp;</p><p style="margin: 4px 0px; padding: 2px 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: normal; background-color: #ffffff; ">&nbsp;</p><img src ="http://www.blogjava.net/shijian/aggbug/387339.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shijian/" target="_blank">石建 | Fat Mind</a> 2012-09-09 15:18 <a href="http://www.blogjava.net/shijian/archive/2012/09/09/387339.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Js 基础知识</title><link>http://www.blogjava.net/shijian/archive/2012/05/20/378611.html</link><dc:creator>石建 | Fat Mind</dc:creator><author>石建 | Fat Mind</author><pubDate>Sun, 20 May 2012 05:50:00 GMT</pubDate><guid>http://www.blogjava.net/shijian/archive/2012/05/20/378611.html</guid><wfw:comment>http://www.blogjava.net/shijian/comments/378611.html</wfw:comment><comments>http://www.blogjava.net/shijian/archive/2012/05/20/378611.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shijian/comments/commentRss/378611.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shijian/services/trackbacks/378611.html</trackback:ping><description><![CDATA[1.变量类型<br />&nbsp;&nbsp;- undefined<br />&nbsp;&nbsp;- null<br />&nbsp;&nbsp;- string<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;- == 与 === 区别<br />&nbsp;&nbsp;- number<br />&nbsp;&nbsp;- boolean<br />&nbsp;&nbsp;- string、number、boolean均有对应的 '对象类'<br />2.函数<br />&nbsp;&nbsp;- 定义函数<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;- function 关键字<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;- 参数（见例子），arguments<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;-&nbsp;函数内变量声明，var区别<br />&nbsp;&nbsp;- 作用域<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;- 链式结构（子函数可以看见父函数的变量）<br />&nbsp;&nbsp;- 匿名函数<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- 使用场景（非复用场景，如：jsonp回调函数）<br />&nbsp;&nbsp; &nbsp; &nbsp;- this特征<br /><div style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; background-color: #eeeeee; "><div><font class="Apple-style-span" color="#0000FF" style="font-size: 13px; ">例子：</font><br /><div><span style="color: #0000ff; font-size: 13px; ">var</span><span style="color: #000000; font-size: 13px; ">&nbsp;add&nbsp;</span><span style="color: #000000; font-size: 13px; ">=</span><font class="Apple-style-span" size="2">&nbsp;</font><span style="color: #0000ff; font-size: 13px; ">function</span><span style="color: #000000; font-size: 13px; ">(x)&nbsp;{</span><span style="color: #000000; font-size: 13px; "><br />&nbsp;&nbsp; &nbsp;return x++;</span><br /><font class="Apple-style-span" size="2">}</font><br /><font class="Apple-style-span" size="2">add(1,2,3); // 参数可以随意多个，类似Java中的(int x ...)<br /></font><br /><div style="font-size: 13px; "><div>var fn = function(name, pass) {</div><div>&nbsp;&nbsp; &nbsp;alert(name);</div><div>&nbsp;&nbsp; &nbsp;alert(pass);</div><div>};</div><div>fn("hello","1234",5); // 按照传递的顺序排列</div></div></div><br /><br /><font class="Apple-style-span" color="#0000FF" style="font-size: 13px; ">var</font><span style="color: #000000; font-size: 13px; ">&nbsp;name&nbsp;</span><span style="color: #000000; font-size: 13px; ">=</span><font class="Apple-style-span" size="2">&nbsp;</font><span style="color: #000000; font-size: 13px; ">"</span><span style="color: #000000; font-size: 13px; ">windows</span><span style="color: #000000; font-size: 13px; ">"</span><span style="color: #000000; font-size: 13px; ">;<br /></span><span style="color: #0000ff; font-size: 13px; ">var</span><span style="color: #000000; font-size: 13px; ">&nbsp;fn&nbsp;</span><span style="color: #000000; font-size: 13px; ">=</span><font class="Apple-style-span" size="2">&nbsp;</font><span style="color: #0000ff; font-size: 13px; ">function</span><span style="color: #000000; font-size: 13px; ">()&nbsp;{<br />&nbsp;&nbsp; &nbsp;var name&nbsp;</span><span style="color: #000000; font-size: 13px; ">=</span><font class="Apple-style-span" size="2">&nbsp;</font><span style="color: #000000; font-size: 13px; ">"</span><span style="color: #000000; font-size: 13px; ">hello</span><span style="color: #000000; font-size: 13px; ">"</span><span style="color: #000000; font-size: 13px; ">;<br />&nbsp;&nbsp;&nbsp;&nbsp;alert(</span><span style="color: #0000ff; font-size: 13px; ">this</span><font class="Apple-style-span" size="2">.name);</font><br /><font class="Apple-style-span" size="2">}</font><br /><font class="Apple-style-span" size="2">fn(); //&nbsp;windows，this在匿名函数内部是指向windows范围<br /><br /></font></div><font class="Apple-style-span" color="#0000FF" style="font-size: 13px; ">var</font><span style="color: #000000; font-size: 13px; ">&nbsp;name&nbsp;</span><span style="color: #000000; font-size: 13px; ">=</span><span style="color: #000000; font-size: 13px; ">&nbsp;</span><span style="color: #000000; font-size: 13px; ">"</span><span style="color: #000000; font-size: 13px; ">windows</span><span style="color: #000000; font-size: 13px; ">"</span><span style="color: #000000; font-size: 13px; ">;<br /></span><span style="color: #0000ff; font-size: 13px; ">var</span><span style="color: #000000; font-size: 13px; ">&nbsp;fn&nbsp;</span><span style="color: #000000; font-size: 13px; ">=</span><span style="color: #000000; font-size: 13px; ">&nbsp;</span><span style="color: #0000ff; font-size: 13px; ">function</span><span style="color: #000000; font-size: 13px; ">()&nbsp;{<br />&nbsp;&nbsp; &nbsp;name&nbsp;</span><span style="color: #000000; font-size: 13px; ">=</span><span style="color: #000000; font-size: 13px; ">&nbsp;</span><span style="color: #000000; font-size: 13px; ">"</span><span style="color: #000000; font-size: 13px; ">hello</span><span style="color: #000000; font-size: 13px; ">"</span><span style="color: #000000; font-size: 13px; ">;<br />&nbsp;&nbsp;&nbsp;&nbsp;alert(</span><span style="color: #0000ff; font-size: 13px; ">this</span><font class="Apple-style-span" size="2">.name);</font><br /><font class="Apple-style-span" size="2">}</font><br /><font class="Apple-style-span" size="2">fn(); // 因函数内部变量name未声明为var，则属于全局变量，且this指向windows，则为'hello'<br /></font><br /><div><div>function add(a) {</div><div>&nbsp;&nbsp; &nbsp;return ++a;</div><div>}</div><div>var fn = function(x,add){</div><div>&nbsp;&nbsp; &nbsp;return add(x);</div><div>}</div><div>fn(1, add); &nbsp;// 函数作为参数</div></div></div><br />3.闭包 &nbsp;<br /><div><a href="http://www.ruanyifeng.com/blog/2009/08/learning_javascript_closures.html">http://www.ruanyifeng.com/blog/2009/08/learning_javascript_closures.html</a>&nbsp;【good】<br />其它语言闭包概念&nbsp;<a href="http://www.ibm.com/developerworks/cn/linux/l-cn-closure/">http://www.ibm.com/developerworks/cn/linux/l-cn-closure/</a><br /><br />4.对象<br />&nbsp;&nbsp; &nbsp;-&nbsp;new Object()<div><div>&nbsp;&nbsp;&nbsp;&nbsp;&#8211; 对象字面量</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&#8211; 构造函数<br />&nbsp;&nbsp; &nbsp;- 上述操作，经历的步骤</div></div>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8211;创建新对象<div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8211;将构造方法的作用域赋给新对象(new 操作符)</div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8211;为对象添加属性, 方法</div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8211;返回该对象</div></div><br /><div style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; background-color: #eeeeee; "><div><div style="color: #0000ff; font-size: 13px; "><div><span style="color: #000000; "><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #0000ff; "><div><div>var obj = new Object(); &nbsp;// new Object方式</div><div>obj.name = 'zhangsan';</div></div><br />var obj = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// 字面常量方式，定义对象</div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #0000ff; ">&nbsp;&nbsp;&nbsp;&nbsp;name : 'zhangsan',</div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&nbsp;&nbsp; &nbsp;<span style="color: #000000; ">showName :</span>&nbsp;<span style="color: #0000ff; ">function</span><span style="color: #000000; ">&nbsp;(){</span><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(<span style="color: #0000ff; ">this</span><span style="color: #000000; ">.name);<br />&nbsp;&nbsp;&nbsp;&nbsp;}</span></div></div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #0000ff; ">};<br />alert(obj.showName());</div></span></div></div></div><font class="Apple-style-span"><div style="display: inline-block; "><div><font class="Apple-style-span" color="#0080FF" face="Consolas, 'Lucida Console', monospace"><span class="Apple-style-span" style="font-size: 12px; line-height: normal; white-space: pre-wrap; ">
</span><div style="font-size: 12px; line-height: normal; white-space: pre-wrap; ">function Person(name) { // 构造函数<br />&nbsp;&nbsp;&nbsp;&nbsp;this.name = name;     <br />&nbsp;&nbsp;&nbsp;&nbsp;this.showName = function(){         <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return this.name;     } <br />&nbsp;&nbsp;&nbsp;&nbsp;}; <br />var obj = new Person("zhangsan");  // 必须用 new 关键，否则等于调用一个普通函数<br />obj.showName(); <br />alert(obj.name);

</div></font></div></div><br /></font></div></div><br /><div><div>资料：内部培训ppt&nbsp;<a></a></div></div><img src ="http://www.blogjava.net/shijian/aggbug/378611.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shijian/" target="_blank">石建 | Fat Mind</a> 2012-05-20 13:50 <a href="http://www.blogjava.net/shijian/archive/2012/05/20/378611.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转] Linux 句柄是什么 ？</title><link>http://www.blogjava.net/shijian/archive/2012/04/06/373463.html</link><dc:creator>石建 | Fat Mind</dc:creator><author>石建 | Fat Mind</author><pubDate>Fri, 06 Apr 2012 06:02:00 GMT</pubDate><guid>http://www.blogjava.net/shijian/archive/2012/04/06/373463.html</guid><wfw:comment>http://www.blogjava.net/shijian/comments/373463.html</wfw:comment><comments>http://www.blogjava.net/shijian/archive/2012/04/06/373463.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shijian/comments/commentRss/373463.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shijian/services/trackbacks/373463.html</trackback:ping><description><![CDATA[<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 30px; "></p><p><br /></p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">1.</span><span style="font-size:10.5pt;Times New Roman&quot;;">句柄就是一个标识符，只要获得对象的句柄，我们就可以对对象进行任意的操作。<br /><br /></span></p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">2.</span><span style="font-size:10.5pt;Times New Roman&quot;;">句柄不是指针，操作系统用句柄可以找到一块内存，这个句柄可能是标识符，</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">map</span><span style="font-size:10.5pt;Times New Roman&quot;;">的</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">key</span><span style="font-size:10.5pt;Times New Roman&quot;;">，也可能是指针，看操作系统怎么处理的了。</span></p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">fd</span><span style="font-size:10.5pt;Times New Roman&quot;;">算是在某种程度上替代句柄吧；</span></p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">Linux </span><span style="font-size:10.5pt;Times New Roman&quot;;">有相应机制，但没有统一的句柄类型，各种类型的系统资源由各自的类型来标识，由各自的接口操作。<br /><br /></span></p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">3.http://tech.ddvip.com/2009-06/1244006580122204_11.html</span></p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;Times New Roman&quot;;">在操作系统层面上，文件操作也有类似于</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">FILE</span><span style="font-size:10.5pt;Times New Roman&quot;;">的一个概念，在</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">Linux</span><span style="font-size:10.5pt;Times New Roman&quot;;">里，这叫做文件描述符</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">(File Descriptor)</span><span style="font-size: 10.5pt;Times New Roman&quot;;">，而在</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">Windows</span><span style="font-size:10.5pt;Times New Roman&quot;;">里，叫做句柄</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">(Handle)(</span><span style="font-size:10.5pt;Times New Roman&quot;;">以下在没有歧义的时候统称为句柄</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">)</span><span style="font-size:10.5pt;Times New Roman&quot;;">。用户通过某个函数打开文件以获得句柄，此</span> <span style="font-size:10.5pt;Times New Roman&quot;;">后用户操纵文件皆通过该句柄进行。</span></p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt">&nbsp;</p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;Times New Roman&quot;;">设计这么一个句柄的原因在于句柄可以防止用户随意读写操作系统内核的文件对象。无论是</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">Linux</span><span style="font-size:10.5pt;Times New Roman&quot;;">还是</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">Windows</span><span style="font-size:10.5pt;Times New Roman&quot;;">，文件句柄总是和内核的文件对象相关联的，但如何关联细节用户并不可见。内核可以通过句柄来计算出内核里文件对象的地址，但此能力并不对用户开放。</span></p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt">&nbsp;</p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;Times New Roman&quot;;">下面举一个实际的例子，在</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">Linux</span><span style="font-size:10.5pt;Times New Roman&quot;;">中，值为</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">0</span><span style="font-size:10.5pt;Times New Roman&quot;;">、</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">1</span><span style="font-size:10.5pt;Times New Roman&quot;;">、</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">2</span><span style="font-size:10.5pt;Times New Roman&quot;;">的</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">fd</span><span style="font-size:10.5pt;Times New Roman&quot;;">分别代表标准输入、标准输出和标准错误输出。在程序中打开文件得到的</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">fd</span><span style="font-size:10.5pt;Times New Roman&quot;;">从</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">3</span><span style="font-size:10.5pt;Times New Roman&quot;;">开始增长。</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"> fd</span><span style="font-size:10.5pt;Times New Roman&quot;;">具体是什么呢</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">?</span><span style="font-size:10.5pt;Times New Roman&quot;;">在内核中，每一个进程都有一个私有的</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">&#8220;</span><span style="font-size:10.5pt;Times New Roman&quot;;">打开文件表</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">&#8221;</span><span style="font-size:10.5pt;Times New Roman&quot;;">，这个表是一个指针数组，每一个元素都指向一个内核的打开文件对象。而</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">fd</span><span style="font-size:10.5pt;Times New Roman&quot;;">，就是这</span> <span style="font-size:10.5pt;Times New Roman&quot;;">个表的下标。当用户打开一个文件时，内核会在内部生成一个打开文件对象，并在这个表里找到一个空项，让这一项指向生成的打开文件对象，并返回这一项的下标</span> <span style="font-size:10.5pt;Times New Roman&quot;;">作为</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">fd</span><span style="font-size:10.5pt;Times New Roman&quot;;">。由于这个表处于内核，并且用户无法访问到，因此用户即使拥有</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">fd</span><span style="font-size:10.5pt;Times New Roman&quot;;">，也无法得到打开文件对象的地址，只能够通过系统提供的函数来操作。</span></p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt">&nbsp;</p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;Times New Roman&quot;;">在</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">C</span><span style="font-size:10.5pt;Times New Roman&quot;;">语言里，操纵文件的渠道则是</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">FILE</span><span style="font-size:10.5pt;Times New Roman&quot;;">结构，不难想象，</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">C</span><span style="font-size:10.5pt;Times New Roman&quot;;">语言中的</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">FILE</span><span style="font-size:10.5pt;Times New Roman&quot;;">结构必定和</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">fd</span><span style="font-size:10.5pt;Times New Roman&quot;;">有一对一的关系，每个</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">FILE</span><span style="font-size:10.5pt;Times New Roman&quot;;">结构都会记录自己唯一对应的</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">fd</span><span style="font-size:10.5pt;Times New Roman&quot;;">。</span></p>  <span style="font-size: 10.5pt; line-height: 240%; font-family: 宋体; "><br /><strong>句柄</strong>&nbsp;</span><span class="Apple-style-span" style="font-size: 14px; font-weight: normal; "><a href="http://zh.wikipedia.org/wiki/%E5%8F%A5%E6%9F%84">http://zh.wikipedia.org/wiki/%E5%8F%A5%E6%9F%84</a><br /><br /></span>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;Times New Roman&quot;;">在</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E7%A8%8B%E5%BA%8F%E8%AE%BE%E8%AE%A1" title="程序设计"><span style="font-family: 宋体; text-decoration: none; ">程序设计</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">中</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">,</span><span style="font-size:10.5pt;Times New Roman&quot;;">句柄</span><span style="font-size:10.5pt;Times New Roman&quot;;">是一种特殊的</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/w/index.php?title=%E6%99%BA%E8%83%BD%E6%8C%87%E9%92%88&amp;action=edit&amp;redlink=1" title="智能指针（尚未撰写）"><span style="font-family: 宋体; text-decoration: none; ">智能指针</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">。当一个</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F" title="应用程序"><span style="font-family: 宋体; text-decoration: none; ">应用程序</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">要引用其他系统</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">(</span><span style="font-size:10.5pt;Times New Roman&quot;;">如</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E6%95%B0%E6%8D%AE%E5%BA%93" title="数据库"><span style="font-family: 宋体; text-decoration: none; ">数据库</span></a></span><span style="font-size:10.5pt;Times New Roman&quot;;">、</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F" title="操作系统"><span style="font-family: 宋体; text-decoration: none; ">操作系统</span></a>&nbsp;)</span><span style="font-size:10.5pt;Times New Roman&quot;;">所管理的</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E5%86%85%E5%AD%98" title="内存"><span style="font-family: 宋体; text-decoration: none; ">内存</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">块或</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E5%AF%B9%E8%B1%A1_%28%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%A7%91%E5%AD%A6%29" title="对象 (计算机科学)"><span style="font-family: 宋体; text-decoration: none; ">对象</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">时，就要使用句柄。</span></p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;Times New Roman&quot;;">句柄与普通</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E6%8C%87%E9%92%88_%28%E4%BF%A1%E6%81%AF%E5%AD%A6%29" title="指针 (信息学)"><span style="font-family: 宋体; text-decoration: none; ">指针</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">的区别在于，指针包含的是引用</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E5%AF%B9%E8%B1%A1_%28%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%A7%91%E5%AD%A6%29" title="对象 (计算机科学)"><span style="font-family: 宋体; text-decoration: none; ">对象</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">的</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E7%89%A9%E7%90%86%E5%9C%B0%E5%9D%80" title="物理地址"><span style="font-family: 宋体; text-decoration: none; ">内存地址</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">，而句柄则是由系统所管理的引用标识，该标识可以被系统重新定位到一个</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E7%89%A9%E7%90%86%E5%9C%B0%E5%9D%80" title="物理地址"><span style="font-family: 宋体; text-decoration: none; ">内存地址</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">上。这种间接访问</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E5%AF%B9%E8%B1%A1_%28%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%A7%91%E5%AD%A6%29" title="对象 (计算机科学)"><span style="font-family: 宋体; text-decoration: none; ">对象</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">的模式增强了系统对引用</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E5%AF%B9%E8%B1%A1_%28%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%A7%91%E5%AD%A6%29" title="对象 (计算机科学)"><span style="font-family: 宋体; text-decoration: none; ">对象</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">的控制。（参见</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/w/index.php?title=%E5%B0%81%E8%A3%85&amp;action=edit&amp;redlink=1" title="封装（尚未撰写）"><span style="font-family: 宋体; text-decoration: none; ">封装</span></a>&nbsp;)</span><span style="font-size:10.5pt;Times New Roman&quot;;">。</span></p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;Times New Roman&quot;;">在上世纪</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">80</span><span style="font-size:10.5pt;Times New Roman&quot;;">年代的操作系统（如</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/Mac_OS" title="Mac OS"><span style="text-decoration: none; ">Mac OS</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">和</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/Windows" title="Windows"><span style="text-decoration: none; ">Windows</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">）的</span><span style="font-size: 10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86" title="内存管理"><span style="font-family: 宋体; text-decoration: none; ">内存管理</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">中，句柄被广泛应用。</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/Unix" title="Unix"><span style="text-decoration: none; ">Unix</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">系统的</span><span style="font-size: 10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E6%96%87%E4%BB%B6%E6%8F%8F%E8%BF%B0%E7%AC%A6" title="文件描述符"><span style="font-family: 宋体; text-decoration: none; ">文件描述符</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">基本上也属于句柄。和其它</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E6%A1%8C%E9%9D%A2%E7%8E%AF%E5%A2%83" title="桌面环境"><span style="font-family: 宋体; text-decoration: none; ">桌面环境</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">一样，</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/Windows_API" title="Windows API"><span style="text-decoration: none; ">Windows API</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">大量使用句柄来标识系统中的</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E5%AF%B9%E8%B1%A1_%28%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%A7%91%E5%AD%A6%29" title="对象 (计算机科学)"><span style="font-family: 宋体; text-decoration: none; ">对象</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">，并建立操作系统与</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/w/index.php?title=%E7%94%A8%E6%88%B7%E7%A9%BA%E9%97%B4&amp;action=edit&amp;redlink=1" title="用户空间（尚未撰写）"><span style="font-family: 宋体; text-decoration: none; ">用户空间</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">之间的通信渠道。例如，桌面上的一个窗体由一个</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;">HWND&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">类型的句柄来标识。</span></p>  <p style="margin:0cm;margin-bottom:.0001pt;line-height:22.5pt"><span style="font-size:10.5pt;Times New Roman&quot;;">如今，</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E5%86%85%E5%AD%98" title="内存"><span style="font-family: 宋体; text-decoration: none; ">内存</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">容量的增大和</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E8%99%9A%E6%8B%9F%E5%86%85%E5%AD%98" title="虚拟内存"><span style="font-family: 宋体; text-decoration: none; ">虚拟内存</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">算法使得更简单的</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E6%8C%87%E9%92%88_%28%E4%BF%A1%E6%81%AF%E5%AD%A6%29" title="指针 (信息学)"><span style="font-family: 宋体; text-decoration: none; ">指针</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">愈加受到青睐，而指向另一指针的那类句柄受到冷淡。尽管如此，许多</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F" title="操作系统"><span style="font-family: 宋体; text-decoration: none; ">操作系统</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">仍然把指向私有</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E5%AF%B9%E8%B1%A1_%28%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%A7%91%E5%AD%A6%29" title="对象 (计算机科学)"><span style="font-family: 宋体; text-decoration: none; ">对象</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">的指针以及</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E8%BF%9B%E7%A8%8B" title="进程"><span style="font-family: 宋体; text-decoration: none; ">进程</span></a></span><span style="font-size:10.5pt;Times New Roman&quot;;">传递给</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E5%AE%A2%E6%88%B7%E7%AB%AF" title="客户端"><span style="font-family: 宋体; text-decoration: none; ">客户端</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">的内部</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;Times New Roman&quot;;"><a href="http://zh.wikipedia.org/zh-cn/%E6%95%B0%E7%BB%84" title="数组"><span style="font-family: 宋体; text-decoration: none; ">数组</span></a>&nbsp;</span><span style="font-size:10.5pt;Times New Roman&quot;;">下标称为句柄。<br /><br /><br /></span></p><p>&nbsp;</p><img src ="http://www.blogjava.net/shijian/aggbug/373463.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shijian/" target="_blank">石建 | Fat Mind</a> 2012-04-06 14:02 <a href="http://www.blogjava.net/shijian/archive/2012/04/06/373463.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>单元测试利器 之 powermock [使用小结]</title><link>http://www.blogjava.net/shijian/archive/2012/03/29/371819.html</link><dc:creator>石建 | Fat Mind</dc:creator><author>石建 | Fat Mind</author><pubDate>Thu, 29 Mar 2012 04:39:00 GMT</pubDate><guid>http://www.blogjava.net/shijian/archive/2012/03/29/371819.html</guid><wfw:comment>http://www.blogjava.net/shijian/comments/371819.html</wfw:comment><comments>http://www.blogjava.net/shijian/archive/2012/03/29/371819.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shijian/comments/commentRss/371819.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shijian/services/trackbacks/371819.html</trackback:ping><description><![CDATA[<br />官方 ：<a href="http://code.google.com/p/powermock/">http://code.google.com/p/powermock/</a>&nbsp; <br /><br />1. 使用mockito的同学，推荐阅读如下部分<br /><br /><div><span class="Apple-style-span" style="font-family: arial, sans-serif; line-height: normal; font-size: small; ">&nbsp; &nbsp; - document [必选]</span><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="line-height: normal; "><font class="Apple-style-span" face="arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; - getting started</font><br /><font class="Apple-style-span" face="arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; - motavition</font><br /><font class="Apple-style-span" face="arial, sans-serif">&nbsp; &nbsp; - mockito extends [必选]</font><br /><font class="Apple-style-span" face="arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; - mockito 1.8+ useage</font><br /><font class="Apple-style-span" face="arial, sans-serif">&nbsp; &nbsp; - common</font><br /><font class="Apple-style-span" face="arial, sans-serif">&nbsp; &nbsp; - tutorial</font><br /><font class="Apple-style-span" face="arial, sans-serif">&nbsp; &nbsp; - faq [必选]</font><br /><br /></span></font><span class="Apple-style-span" style="line-height: normal; font-size: small; "><span style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: yellow; "><font class="Apple-style-span" face="arial, sans-serif"><br /></font><font class="Apple-style-span" face="宋体">2. 附件：实际开发中使用到的</font></span><span style="font-family: arial, sans-serif; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: yellow; background-position: initial initial; background-repeat: initial initial; ">powermock</span><span style="font-family: 宋体; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: yellow; background-position: initial initial; background-repeat: initial initial; ">的一些特性，简化后的例子（仅为说明</span><span style="font-family: arial, sans-serif; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: yellow; background-position: initial initial; background-repeat: initial initial; ">powermock api</span><span style="font-family: 宋体; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: yellow; background-position: initial initial; background-repeat: initial initial; ">使用）</span><span style="font-family: 宋体; ">。主要包括</span> <span style="font-family: 宋体; ">：</span></span><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="line-height: normal; "><br />  <p style="font-family: arial, sans-serif; margin-left: 18pt; ">&nbsp;</p>  <p style="font-family: arial, sans-serif; margin-left: 60pt; text-indent: -18pt; "><span><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family:宋体">修改私有域</span></p>  <p style="font-family: arial, sans-serif; margin-left: 60pt; text-indent: -18pt; "><span><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family:宋体">私有方法</span></p>  <p style="font-family: arial, sans-serif; margin-left: 84pt; text-indent: -21pt; "><span><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family:宋体">测试私有方法</span></p>  <p style="font-family: arial, sans-serif; margin-left: 84pt; text-indent: -21pt; "><span><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Mock</p>  <p style="font-family: arial, sans-serif; margin-left: 84pt; text-indent: -21pt; "><span><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Verify</p>  <p style="font-family: arial, sans-serif; margin-left: 60pt; text-indent: -18pt; "><span><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family:宋体">静态方法</span></p>  <p style="font-family: arial, sans-serif; margin-left: 84pt; text-indent: -21pt; "><span><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Mock</p>  <p style="font-family: arial, sans-serif; margin-left: 84pt; text-indent: -21pt; "><span><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family:宋体">抛出异常</span></p>  <p style="font-family: arial, sans-serif; margin-left: 84pt; text-indent: -21pt; "><span><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Verify</p>  <p style="font-family: arial, sans-serif; margin-left: 60pt; text-indent: -18pt; "><span><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Mock<span style="font-family:宋体">类部分方法</span></p>  <p style="font-family: arial, sans-serif; margin-left: 60pt; text-indent: -18pt; "><span><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Mock Java core library<span style="font-family:宋体">，如：</span>Thread</p>  <p style="font-family: arial, sans-serif; margin-left: 60pt; text-indent: -18pt; "><span><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Mock <span style="font-family:宋体">构造器<br /><br /><a href="/Files/shijian/powermock.rar">/Files/shijian/powermock.rar</a><br /><br /><br /></span></p><br /></span></font></div><a href="http://code.google.com/p/powermock/"></a></div><img src ="http://www.blogjava.net/shijian/aggbug/371819.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shijian/" target="_blank">石建 | Fat Mind</a> 2012-03-29 12:39 <a href="http://www.blogjava.net/shijian/archive/2012/03/29/371819.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]Google: Excellent Papers for 2011</title><link>http://www.blogjava.net/shijian/archive/2012/03/24/372604.html</link><dc:creator>石建 | Fat Mind</dc:creator><author>石建 | Fat Mind</author><pubDate>Sat, 24 Mar 2012 03:39:00 GMT</pubDate><guid>http://www.blogjava.net/shijian/archive/2012/03/24/372604.html</guid><wfw:comment>http://www.blogjava.net/shijian/comments/372604.html</wfw:comment><comments>http://www.blogjava.net/shijian/archive/2012/03/24/372604.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shijian/comments/commentRss/372604.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shijian/services/trackbacks/372604.html</trackback:ping><description><![CDATA[<div><p align="left" style="text-align:left;line-height:15.75pt;"><strong><span style="font-family:宋体;color:#464646;"><br />原文地址：</span></strong>http://googleresearch.blogspot.com/2012/03/excellent-papers-for-2011.html</p>  <p align="left" style="text-align:left;line-height:15.75pt;">&nbsp;</p>  <p align="center" style="text-align:center;background:white;vertical-align:middle"><span style="font-size:15.0pt;font-family:Helvetica;color:#333333;"><span style="color:#094382"><a href="http://googleresearch.blogspot.com/2012/03/excellent-papers-for-2011.html">Excellent Papers for 2011</a><br /><br /></span></span></p>  <p style="background:white"><span style="font-family:Helvetica;color:#333333;">Posted by Corinna Cortes and Alfred Spector, Google Research<br /> <br /> Googlers across the company actively engage with the scientific community by publishing technical papers, contributing open-source packages, working on standards, introducing new APIs and tools, giving talks and presentations, participating in ongoing technical debates, and much more. Our&nbsp;<a href="http://research.google.com/pubs/papers.html"><span style="color:#094382">publications</span></a>&nbsp;offer technical and algorithmic advances, feature aspects we learn as we develop novel products and services, and shed light on some of the technical challenges we face at Google.</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:宋体;color:#333333">谷歌公司积极参与科学界的交流，通过发表技术论文，贡献开源软件，制定标准，引入新的</span><span style="font-family:Arial;color:#333333">API</span><span style="font-family:宋体;color:#333333">和工具，举办讲座和演讲，参加正在进行的技术辩论，等等。我们发布的文章提供技术和算法的进步，在开发新的产品和服务过程中学习到的内容，揭示一些我们在谷歌所面临的技术挑战。</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:Helvetica;color:#333333;">In an effort to highlight some of our work, we periodically select a number of publications to be featured on this blog. We first posted a&nbsp;<a href="http://googleresearch.blogspot.com/2010/07/google-publications.html"><span style="color:#094382">set of papers</span></a>&nbsp;on this blog in mid-2010 and subsequently discussed them in more detail in the following blog postings. In a&nbsp;<a href="http://googleresearch.blogspot.com/2011/01/more-google-contributions-to-broader.html"><span style="color:#094382">second round</span></a>, we highlighted new noteworthy papers from the later half of 2010. This time we honor the influential papers authored or co-authored by Googlers covering all of 2011 -- covering roughly 10% of our total publications.&nbsp;</span>&nbsp;<span style="font-family:Helvetica;color:#333333;">It&#8217;s tough choosing, so we may have left out some important papers.&nbsp;</span>&nbsp;<span style="font-family:Helvetica;color:#333333;">So, do see the&nbsp;<a href="http://research.google.com/pubs/papers.html"><span style="color:#094382">publications list</span></a>&nbsp;to review the complete group.</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:宋体;color:#333333">为了彰显我们的一些工作，我们定期选择一些列文章发布在</span><span style="font-family:Arial;color:#333333">blog</span><span style="font-family:宋体;color:#333333">。</span><span style="font-family:Arial;color:#333333">2010</span><span style="font-family:宋体;color:#333333">中期，我们第一次发布了一些列的文章在</span><span style="font-family:Arial;color:#333333">blog</span><span style="font-family:宋体;color:#333333">，并随后在博客文章中更详细讨论它们。在第二轮中，我们强调从</span><span style="font-family:Arial;color:#333333">2010</span><span style="font-family:宋体;color:#333333">年下半年新值得注意的论文。这一次，我们给有影响力的文章的作者或合著者以荣誉，大约占总文章数的</span><span style="font-family:Arial;color:#333333">10%</span><span style="font-family:宋体;color:#333333">。这是艰难的选择的，所以我们可能已经遗漏了一些重要文章。因此，请看完整的文章清单。</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:Helvetica;color:#333333;">In the coming weeks we will be offering a more in-depth look at these publications, but here are some summaries:</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:宋体;">在未来几周我们将更深入的谈论这些论文，但现在只做一些总结。</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><strong><span style="font-family:Helvetica;color:#333333;">Audio processing</span></strong></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:Helvetica;color:#333333;">&#8220;<a href="http://research.google.com/pubs/pub36963.html" target="_blank"><span style="color:#094382">Cascades of two-pole&#8211;two-zero asymmetric resonators are good models of peripheral auditory function</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author35932.html"><span style="color:#094382">Richard F. Lyon</span></a>,<strong>Journal of the Acoustical Society of America</strong>, vol. 130 (2011), pp. 3893-3904.<br /> Lyon's long title summarizes a result that he has been working toward over many years of modeling sound processing in the inner ear.&nbsp;</span>&nbsp;<span style="font-family:Helvetica;color:#333333;">This nonlinear cochlear model is shown to be "good" with respect to psychophysical data on masking, physiological data on mechanical and neural response, and computational efficiency. These properties derive from the close connection between wave propagation and filter cascades. This filter-cascade model of the ear is used as an efficient sound processor for several machine hearing projects at Google.</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:宋体;color:#333333;">声音处理：</span><span style="font-family:宋体;color:#333333">这个滤波器级联模型的耳朵是用来作为一种高效的声音处理器，是谷歌的几个机器声音处理项目之一。</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><strong><span style="font-family:Helvetica;color:#333333;">Electronic Commerce and Algorithms</span></strong></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:Helvetica;color:#333333;">&#8220;<a href="http://research.google.com/pubs/archive/36742.pdf" target="_blank"><span style="color:#094382">Online Vertex-Weighted Bipartite Matching and Single-bid Budgeted Allocations</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author3107.html"><span style="color:#094382">Gagan Aggarwal</span></a>,&nbsp;<a href="http://research.google.com/pubs/GaganGoel.html"><span style="color:#094382">Gagan Goel</span></a>,&nbsp;<a href="http://research.google.com/pubs/author39394.html"><span style="color:#094382">Chinmay Karande</span></a>,&nbsp;<a href="http://research.google.com/pubs/author31656.html"><span style="color:#094382">Aranyak Mehta</span></a>,&nbsp;<strong>SODA 2011</strong>.<br /> The authors introduce an elegant and powerful algorithmic technique to the area of online ad allocation and matching: a hybrid of random perturbations and greedy choice to make decisions on the fly. Their technique sheds new light on classic matching algorithms, and can be used, for example, to pick one among a set of relevant ads, without knowing in advance the demand for ad slots on future web page views.&nbsp;</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:宋体;color:#333333">作者介绍在线广告分配和匹配方面的优雅和强大的算法技术：一种混合随机扰动和贪婪选择，实现在线决定。他们的技术揭示了经典的匹配算法的新的方向，例如，挑选其中一组相关的广告，事先不知道未来的网站页面访问的广告位置的需求。【关注】</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:Helvetica;color:#333333;">&#8220;<a href="http://research.google.com/pubs/pub37235.html" target="_blank"><span style="color:#094382">Milgram-routing in social networks</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/SilvioLattanzi.html"><span style="color:#094382">Silvio Lattanzi</span></a>, Alessandro Panconesi, D. Sivakumar,&nbsp;<strong>Proceedings of the 20th International Conference on World Wide Web, WWW 2011</strong>, pp. 725-734.<br /> Milgram&#8217;s "six-degrees-of-separation experiment" and the fascinating small world hypothesis that follows from it, have generated a lot of interesting research in recent years. In this landmark experiment, Milgram showed that people unknown to each other are often connected by surprisingly short chains of acquaintances. In the paper we prove theoretically and experimentally how a recent model of social networks, "Affiliation Networks", offers an explanation to this phenomena and inspires interesting technique for local routing within social networks.</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:宋体;color:#333333">米尔格兰姆的</span><span style="font-family:Arial;color:#333333">&#8220;</span><span style="font-family:宋体;color:#333333">六个度分离实验</span><span style="font-family:Arial;color:#333333">&#8221;</span><span style="font-family:宋体;color:#333333">，迷人的小世界遵从它的结果，在最近几年已经产生了很多有趣的研究。在这一具有里程碑意义的实验，表明未知的对方往往是通过熟人，以令人惊讶的短链连接即可认识。在本文中，我们提供理论和实验关于近代的社会网络模型，</span><span style="font-family:Arial;color:#333333">&#8220;</span><span style="font-family:Helvetica;color:#333333;">Affiliation Networks</span><span style="font-family:Arial;color:#333333">&#8221;</span><span style="font-family:宋体;color:#333333">，提供了一种解释这种现象，并激发社会网络的</span><span style="font-family:Helvetica;color:#333333;">interesting technique for local routing</span><span style="font-family:宋体;color:#333333">。【关注】</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:Helvetica;color:#333333;">&#8220;<a href="http://research.google.com/pubs/pub37653.html" target="_blank"><span style="color:#094382">Non-Price Equilibria in Markets of Discrete Goods</span></a>&#8221;, Avinatan Hassidim, Haim Kaplan, Yishay Mansour, Noam Nisan,&nbsp;<strong>EC</strong>, 2011.<br /> We present a correspondence between markets of indivisible items, and a family of auction based n player games. We show that a market has a price based (Walrasian) equilibrium if and only if the corresponding game has a pure Nash equilibrium. We then turn to markets which do not have a Walrasian equilibrium (which is the interesting case), and study properties of the mixed Nash equilibria of the corresponding games.</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:宋体;color:#333333">在离散商品市场的非价格平衡【关注】</span></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><strong><span style="font-family:Helvetica;color:#333333;">HCI</span></strong></p>  <p style="background:white">&nbsp;</p>  <p style="background:white"><span style="font-family:Helvetica;color:#333333;">&#8220;<a href="http://research.google.com/pubs/pub37064.html" target="_blank"><span style="color:#094382">From Basecamp to Summit: Scaling Field Research Across 9 Locations</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author35817.html"><span style="color:#094382">Jens Riegelsberger</span></a>, Audrey Yang, Konstantin Samoylov, Elizabeth Nunge, Molly Stevens, Patrick Larvie,&nbsp;<strong>CHI 2011 Extended Abstracts</strong>.<br /> The paper reports on our experience with a basecamp research hub to coordinate logistics and ongoing real-time analysis with research teams in the field. We also reflect on the implications for the meaning of research in a corporate context, where much of the value may be less in a final report, but more in the curated impressions and memories our colleagues take away from the the research trip.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/archive/37156.pdf" target="_blank"><span style="color:#094382">User-Defined Motion Gestures for Mobile Interaction</span></a>&#8221;, Jaime Ruiz,&nbsp;<a href="http://research.google.com/pubs/author38946.html"><span style="color:#094382">Yang Li</span></a>, Edward Lank,&nbsp;<strong>CHI 2011: ACM Conference on Human Factors in Computing Systems</strong>, pp. 197-206.<br /> Modern smartphones contain sophisticated sensors that can detect rich motion gestures &#8212; deliberate movements of the device by end-users to invoke commands. However, little is known about best-practices in motion gesture design for the mobile computing paradigm. We systematically studied the design space of motion gestures via a guessability study that elicits end-user motion gestures to invoke commands on a smartphone device. The study revealed consensus among our participants on parameters of movement and on mappings of motion gestures onto commands, by which we developed a taxonomy for motion gestures and compiled an end-user inspired motion gesture set. The work lays the foundation of motion gesture design&#8212;a new dimension for mobile interaction.<br /> <br /> <strong>Information Retrieval</strong><br /> <br /> &#8220;<a href="http://research.google.com/pubs/archive/36757.pdf" target="_blank"><span style="color:#094382">Reputation Systems for Open Collaboration</span></a>&#8221;, B.T. Adler, L. de Alfaro,&nbsp;<a href="http://research.google.com/pubs/author25088.html"><span style="color:#094382">A. Kulshrestra</span></a>, I. Pye,&nbsp;<strong>Communications of the ACM</strong>, vol. 54 No. 8 (2011), pp. 81-87.<br /> This paper describes content based reputation algorithms, that rely on automated content analysis to derive user and content reputation, and their applications for Wikipedia and google Maps. The Wikipedia reputation system WikiTrust relies on a chronological analysis of user contributions to articles, metering positive or negative increments of reputation whenever new contributions are made. The Google Maps system Crowdsensus compares the information provided by users on map business listings and computes both a likely reconstruction of the correct listing and a reputation value for each user. Algorithmic-based user incentives ensure the trustworthiness of evaluations of Wikipedia entries and Google Maps business information.<br /> <br /> <strong>Machine Learning and Data Mining</strong><br /> <br /> &#8220;<a href="http://research.google.com/pubs/MachineLearning.html" target="_blank"><span style="color:#094382">Domain adaptation in regression</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author121.html"><span style="color:#094382">Corinna Cortes</span></a>,&nbsp;<a href="http://research.google.com/pubs/author122.html"><span style="color:#094382">Mehryar Mohri</span></a>,&nbsp;<strong>Proceedings of The 22nd International Conference on Algorithmic Learning Theory, ALT 2011</strong>.<br /> Domain adaptation is one of the most important and challenging problems in machine learning.&nbsp;</span>&nbsp;<span style="font-family:Helvetica;color:#333333;">This paper presents a series of theoretical guarantees for domain adaptation in regression, gives an adaptation algorithm based on that theory that can be cast as a semi-definite programming problem, derives an efficient solution for that problem by using results from smooth optimization, shows that the solution can scale to relatively large data sets, and reports extensive empirical results demonstrating the benefits of this new adaptation algorithm.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37074.html" target="_blank"><span style="color:#094382">On the necessity of irrelevant variables</span></a>&#8221;, David P. Helmbold,&nbsp;<a href="http://research.google.com/pubs/author116.html"><span style="color:#094382">Philip M. Long</span></a>,&nbsp;<strong>ICML</strong>, 2011<br /> Relevant variables sometimes do much more good than irrelevant variables do harm, so that it is possible to learn a very accurate classifier using predominantly irrelevant variables.&nbsp;</span>&nbsp;<span style="font-family:Helvetica;color:#333333;">We show that this holds given an assumption that formalizes the intuitive idea that the variables are non-redundant.&nbsp;</span>&nbsp;<span style="font-family:Helvetica;color:#333333;">For problems like this it can be advantageous to add many additional variables, even if only a small fraction of them are relevant.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/archive/36898.pdf" target="_blank"><span style="color:#094382">Online Learning in the Manifold of Low-Rank Matrices</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author35799.html"><span style="color:#094382">Gal Chechik</span></a>, Daphna Weinshall, Uri Shalit,&nbsp;<strong>Neural Information Processing Systems (NIPS 23)</strong>, 2011, pp. 2128-2136.<br /> Learning measures of similarity from examples of similar and dissimilar pairs is a problem that is hard to scale. LORETA uses retractions, an operator from matrix optimization, to learn low-rank similarity matrices efficiently. This allows to learn similarities between objects like images or texts when represented using many more features than possible before.<br /> <br /> <strong>Machine Translation</strong><br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37159.html" target="_blank"><span style="color:#094382">Training a Parser for Machine Translation Reordering</span></a>&#8221;, Jason Katz-Brown,&nbsp;<a href="http://research.google.com/pubs/author38945.html"><span style="color:#094382">Slav Petrov</span></a>,&nbsp;<a href="http://research.google.com/pubs/author32317.html"><span style="color:#094382">Ryan McDonald</span></a>,&nbsp;<a href="http://research.google.com/pubs/och.html"><span style="color:#094382">Franz Och</span></a>, David Talbot, Hiroshi Ichikawa, Masakazu Seno,&nbsp;<strong>Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing (EMNLP '11)</strong>.<br /> Machine translation systems often need to understand the syntactic structure of a sentence to translate it correctly. Traditionally, syntactic parsers are evaluated as standalone systems against reference data created by linguists. Instead, we show how to train a parser to optimize reordering accuracy in a machine translation system, resulting in measurable improvements in translation quality over a more traditionally trained parser.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/archive/37162.pdf" target="_blank"><span style="color:#094382">Watermarking the Outputs of Structured Prediction with an application in Statistical Machine Translation</span></a>&#8221;, Ashish Venugopal,<a href="http://research.google.com/pubs/author37567.html"><span style="color:#094382">Jakob Uszkoreit</span></a>, David Talbot,&nbsp;<a href="http://research.google.com/pubs/och.html"><span style="color:#094382">Franz Och</span></a>, Juri Ganitkevitch,&nbsp;<strong>Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing (EMNLP)</strong>.<br /> We propose a general method to watermark and probabilistically identify the structured results of machine learning algorithms with an application in statistical machine translation. Our approach does not rely on controlling or even knowing the inputs to the algorithm and provides probabilistic guarantees on the ability to identify collections of results from one&#8217;s own algorithm, while being robust to limited editing operations.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/archive/37163.pdf" target="_blank"><span style="color:#094382">Inducing Sentence Structure from Parallel Corpora for Reordering</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author38952.html"><span style="color:#094382">John DeNero</span></a>,&nbsp;<a href="http://research.google.com/pubs/author37567.html"><span style="color:#094382">Jakob Uszkoreit</span></a>,&nbsp;<strong>Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing (EMNLP)</strong>.<br /> Automatically discovering the full range of linguistic rules that govern the correct use of language is an appealing goal, but extremely challenging.&nbsp;</span>&nbsp;<span style="font-family:Helvetica;color:#333333;">Our paper describes a targeted method for discovering only those aspects of linguistic syntax necessary to explain how two different languages differ in their word ordering.&nbsp;</span>&nbsp;<span style="font-family:Helvetica;color:#333333;">By focusing on word order, we demonstrate an effective and practical application of unsupervised grammar induction that improves a Japanese to English machine translation system.<br /> <br /> <strong>Multimedia and Computer Vision</strong><br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub36985.html" target="_blank"><span style="color:#094382">Kernelized Structural SVM Learning for Supervised Object Segmentation</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author39634.html"><span style="color:#094382">Luca Bertelli</span></a>,&nbsp;<a href="http://research.google.com/pubs/author39635.html"><span style="color:#094382">Tianli Yu</span></a>, Diem Vu, Burak Gokturk,<strong>Proceedings of IEEE Conference on Computer Vision and Pattern Recognition 2011</strong>.<br /> The paper proposes a principled way for computers to learn how to segment the foreground from the background of an image given a set of training examples. The technology is build upon a specially designed nonlinear segmentation kernel under the recently proposed structured SVM learning framework.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37041.html" target="_blank"><span style="color:#094382">Auto-Directed Video Stabilization with Robust L1 Optimal Camera Paths</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author38919.html"><span style="color:#094382">Matthias Grundmann</span></a>,&nbsp;<a href="http://research.google.com/pubs/author38000.html"><span style="color:#094382">Vivek Kwatra</span></a>, Irfan Essa,<strong>IEEE Conference on Computer Vision and Pattern Recognition (CVPR 2011).</strong><br /> Casually shot videos captured by handheld or mobile cameras suffer from significant amount of shake. Existing in-camera stabilization methods dampen high-frequency jitter but do not suppress low-frequency movements and bounces, such as those observed in videos captured by a walking person. On the other hand, most professionally shot videos usually consist of carefully designed camera configurations, using specialized equipment such as tripods or camera dollies, and employ ease-in and ease-out for transitions. Our stabilization technique automatically converts casual shaky footage into more pleasant and professional looking videos by mimicking these cinematographic principles. The original, shaky camera path is divided into a set of segments, each approximated by either constant, linear or parabolic motion, using an algorithm based on robust L1 optimization. The stabilizer has been part of the YouTube Editor (<a href="http://youtube.com/editor"><span style="color:#094382">youtube.com/editor</span></a>) since March 2011.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37298.html" target="_blank"><span style="color:#094382">The Power of Comparative Reasoning</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author36197.html"><span style="color:#094382">Jay Yagnik</span></a>, Dennis Strelow,&nbsp;<a href="http://research.google.com/pubs/author23969.html"><span style="color:#094382">David Ross</span></a>, Ruei-Sung Lin,&nbsp;<strong>International Conference on Computer Vision</strong>&nbsp;(2011).<br /> The paper describes a theory derived vector space transform that converts vectors into sparse binary vectors such that Euclidean space operations on the sparse binary vectors imply rank space operations in the original vector space. The transform a) does not need any data-driven supervised/unsupervised learning b) can be computed from polynomial expansions of the input space in linear time (in the degree of the polynomial) and c) can be implemented in 10-lines of code. We show competitive results on similarity search and sparse coding (for classification) tasks.<br /> <br /> <strong>NLP</strong><br /> <br /> &#8220;<a href="http://research.google.com/pubs/archive/37071.pdf" target="_blank"><span style="color:#094382">Unsupervised Part-of-Speech Tagging with Bilingual Graph-Based Projections</span></a>&#8221;, Dipanjan Das,&nbsp;<a href="http://research.google.com/pubs/author38945.html"><span style="color:#094382">Slav Petrov</span></a>,&nbsp;<strong>Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics (ACL '11)</strong>, 2011,&nbsp;<strong>Best Paper Award</strong>.<br /> We would like to have natural language processing systems for all languages, but obtaining labeled data for all languages and tasks is unrealistic and expensive. We present an approach which leverages existing resources in one language (for example English) to induce part-of-speech taggers for languages without any labeled training data. We use graph-based label propagation for cross-lingual knowledge transfer and use the projected labels as features in a hidden Markov model trained with the Expectation Maximization algorithm.<br /> <br /> <strong>Networks</strong><br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37517.html" target="_blank"><span style="color:#094382">TCP Fast Open</span></a>&#8221;, Sivasankar Radhakrishnan,&nbsp;<a href="http://research.google.com/pubs/author27276.html"><span style="color:#094382">Yuchung Cheng</span></a>,&nbsp;<a href="http://research.google.com/pubs/author39277.html"><span style="color:#094382">Jerry Chu</span></a>,&nbsp;<a href="http://research.google.com/pubs/author35943.html"><span style="color:#094382">Arvind Jain</span></a>, Barath Raghavan,&nbsp;<strong>Proceedings of the 7th International Conference on emerging Networking EXperiments and Technologies (CoNEXT)</strong>, 2011.<br /> TCP Fast Open enables data exchange during TCP&#8217;s initial handshake. It decreases application network latency by one full round-trip time, a significant speedup for today's short Web transfers. Our experiments on popular websites show that Fast Open reduces the whole-page load time over 10% on average, and in some cases up to 40%.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37486.html" target="_blank"><span style="color:#094382">Proportional Rate Reduction for TCP</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author39115.html"><span style="color:#094382">Nandita Dukkipati</span></a>, Matt Mathis,&nbsp;<a href="http://research.google.com/pubs/author27276.html"><span style="color:#094382">Yuchung Cheng</span></a>, Monia Ghobadi,&nbsp;<strong>Proceedings of the 11th ACM SIGCOMM Conference on Internet Measurement 2011, Berlin, Germany - November 2-4, 2011</strong>.<br /> Packet losses increase latency of Web transfers and negatively impact user experience. Proportional rate reduction (PRR) is designed to recover from losses quickly, smoothly and accurately by pacing out retransmissions across received ACKs during TCP&#8217;s fast recovery. Experiments on Google Web and YouTube servers in U.S. and India demonstrate that PRR reduces the TCP latency of connections experiencing losses by 3-10% depending on response size.<br /> <br /> <strong>Security and Privacy</strong><br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37199.html" target="_blank"><span style="color:#094382">Automated Analysis of Security-Critical JavaScript APIs</span></a>&#8221;, Ankur Taly,&nbsp;<a href="http://research.google.com/pubs/ulfar.html"><span style="color:#094382">&#218;lfar Erlingsson</span></a>, John C. Mitchell,&nbsp;<a href="http://research.google.com/pubs/author35958.html"><span style="color:#094382">Mark S. Miller</span></a>, Jasvir Nagra,&nbsp;<strong>IEEE Symposium on Security &amp; Privacy (SP)</strong>, 2011.<br /> As software is increasingly written in high-level, type-safe languages, attackers have fewer means to subvert system fundamentals, and attacks are more likely to exploit errors and vulnerabilities in application-level logic.&nbsp;</span>&nbsp;<span style="font-family:Helvetica;color:#333333;">This paper describes a generic, practical defense against such attacks, which can protect critical application resources even when those resources are partially exposed to attackers via software interfaces.&nbsp;In the context of carefully-crafted fragments of JavaScript, the paper applies formal methods and semantics to prove that these defenses can provide complete, non-circumventable mediation of resource access; the paper also shows how an implementation of the techniques can establish the properties of widely-used software, and find previously-unknown bugs.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37198.html" target="_blank"><span style="color:#094382">App Isolation: Get the Security of Multiple Browsers with Just One</span></a>&#8221;, Eric Y. Chen, Jason Bau,&nbsp;<a href="http://research.google.com/pubs/author37904.html"><span style="color:#094382">Charles Reis</span></a>, Adam Barth, Collin Jackson,&nbsp;<strong>18th ACM Conference on Computer and Communications Security</strong>, 2011.<br /> We find that anecdotal advice to use a separate web browser for sites like your bank is indeed effective at defeating most cross-origin web attacks.&nbsp;</span>&nbsp;<span style="font-family:Helvetica;color:#333333;">We also prove that a single web browser can provide the same key properties, for sites that fit within the compatibility constraints.<br /> <br /> <strong>Speech</strong><br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37631.html" target="_blank"><span style="color:#094382">Improving the speed of neural networks on CPUs</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author37534.html"><span style="color:#094382">Vincent Vanhoucke</span></a>,&nbsp;<a href="http://research.google.com/pubs/author37792.html"><span style="color:#094382">Andrew Senior</span></a>, Mark Z. Mao,&nbsp;<strong>Deep Learning and Unsupervised Feature Learning Workshop, NIPS 2011.</strong><br /> As deep neural networks become state-of-the-art in real-time machine learning applications such as speech recognition, computational complexity is fast becoming a limiting factor in their adoption. We show how to best leverage modern CPU architectures to significantly speed-up their inference.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/archive/37567.pdf" target="_blank"><span style="color:#094382">Bayesian Language Model Interpolation for Mobile Speech Input</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author130.html"><span style="color:#094382">Cyril Allauzen</span></a>,&nbsp;<a href="http://research.google.com/pubs/author125.html"><span style="color:#094382">Michael Riley</span></a>,&nbsp;<strong>Interspeech 2011.</strong><br /> Voice recognition on the Android platform must contend with many possible target domains - e.g. search, maps, SMS. For each of these, a domain-specific language model was built by linearly interpolating several n-gram LMs from a common set of Google corpora. The current work has found a way to efficiently compute a single n-gram language model with accuracy very close to the domain-specific LMs but with considerably less complexity at recognition time.<br /> <br /> <strong>Statistics</strong><br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37483.html" target="_blank"><span style="color:#094382">Large-Scale Parallel Statistical Forecasting Computations in R</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/MurrayStokely.html"><span style="color:#094382">Murray Stokely</span></a>,&nbsp;Farzan Rohani, Eric Tassone,&nbsp;<strong>JSM Proceedings, Section on Physical and Engineering Sciences</strong>, 2011.<br /> This paper describes the implementation of a framework for utilizing distributed computational infrastructure from within the R interactive statistical computing environment, with applications to timeseries forecasting. This system is widely used by the statistical analyst community at Google for data analysis on very large data sets.<br /> <br /> <strong>Structured Data</strong><br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37217.html" target="_blank"><span style="color:#094382">Dremel: Interactive Analysis of Web-Scale Datasets</span></a>&#8221;, Sergey Melnik, Andrey Gubarev, Jing Jing Long, Geoffrey Romer, Shiva Shivakumar, Matt Tolton,&nbsp;<strong>Communications of the ACM</strong>, vol. 54 (2011), pp. 114-123.<br /> Dremel is a scalable, interactive ad-hoc query system. By combining multi-level execution trees and columnar data layout, it is capable of running aggregation queries over trillion-row tables in seconds. Besides continued growth internally to Google, Dremel now also backs an increasing number of external customers including BigQuery and UIs such as AdExchange front-end.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub36988.html" target="_blank"><span style="color:#094382">Representative Skylines using Threshold-based Preference Distributions</span></a>&#8221;,&nbsp;<a href="http://research.google.com/pubs/author39644.html"><span style="color:#094382">Atish Das Sarma</span></a>, Ashwin Lall, Danupon Nanongkai, Richard J. Lipton, Jim Xu,&nbsp;<strong>International Conference on Data Engineering (ICDE)</strong>, 2011.<br /> The paper adopts principled approach towards representative skylines and formalizes the problem of displaying k tuples such that the probability that a random user clicks on one of them is maximized. This requires mathematically modeling (a) the likelihood with which a user is interested in a tuple, as well as (b) how one negotiates the lack of knowledge of an explicit set of users. This work presents theoretical and experimental results showing that the suggested algorithm significantly outperforms previously suggested approaches.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/DataManagement.html" target="_blank"><span style="color:#094382">Hyper-local, directions-based ranking of places</span></a>&#8221;, Petros Venetis, Hector Gonzalez,&nbsp;<a href="http://research.google.com/pubs/author1112.html"><span style="color:#094382">Alon Y. Halevy</span></a>, Christian S. Jensen,<strong>PVLDB</strong>, vol. 4(5) (2011), pp. 290-30.<br /> Click through information is one of the strongest signals we have for ranking web pages. We propose an equivalent signal for raking real world places: The number of times that people ask for precise directions to the address of the place. We show that this signal is competitive in quality with human reviews while being much cheaper to collect, we also show that the signal can be incorporated efficiently into a location search system.<br /> <br /> <strong>Systems</strong><br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37062.html" target="_blank"><span style="color:#094382">Power Management of Online Data-Intensive Services</span></a>&#8221;, David Meisner, Christopher M. Sadler,&nbsp;<a href="http://research.google.com/pubs/LuizBarroso.html"><span style="color:#094382">Luiz Andr&#233; Barroso</span></a>,&nbsp;<a href="http://research.google.com/pubs/author10649.html"><span style="color:#094382">Wolf-Dietrich Weber</span></a>, Thomas F. Wenisch,&nbsp;<strong>Proceedings of the 38th ACM International Symposium on Computer Architecture</strong>, 2011.<br /> Compute and data intensive Web services (such as Search) are a notoriously hard target for energy savings techniques. This article characterizes the statistical hardware activity behavior of servers running Web search and discusses the potential opportunities of existing and proposed energy savings techniques.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37124.html" target="_blank"><span style="color:#094382">The Impact of Memory Subsystem Resource Sharing on Datacenter Applications</span></a>&#8221;, Lingjia Tang, Jason Mars, Neil Vachharajani,&nbsp;<a href="http://research.google.com/pubs/author38135.html"><span style="color:#094382">Robert Hundt</span></a>, Mary-Lou Soffa,&nbsp;<strong>ISCA</strong>, 2011.<br /> In this work, the authors expose key characteristics of an emerging class of Google-style workloads and show how to enhance system software to take advantage of these characteristics to improve efficiency in data centers. The authors find that across datacenter applications, there is both a sizable benefit and a potential degradation from improperly sharing micro-architectural resources on a single machine (such as on-chip caches and bandwidth to memory). The impact of co-locating threads from multiple applications with diverse memory behavior changes the optimal mapping of thread to cores for each application. By employing an adaptive thread-to-core mapper, the authors improved the performance of the datacenter applications by up to 22% over status quo thread-to-core mapping, achieving performance within 3% of optimal.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/archive/37204.pdf" target="_blank"><span style="color:#094382">Language-Independent Sandboxing of Just-In-Time Compilation and Self-Modifying Code</span></a>&#8221;, Jason Ansel, Petr Marchenko,&nbsp;<a href="http://research.google.com/pubs/ulfar.html"><span style="color:#094382">&#218;lfar Erlingsson</span></a>, Elijah Taylor,&nbsp;<a href="http://research.google.com/pubs/author37895.html"><span style="color:#094382">Brad Chen</span></a>, Derek Schuff, David Sehr,&nbsp;<a href="http://research.google.com/pubs/author38542.html"><span style="color:#094382">Cliff L. Biffle</span></a>, Bennet S. Yee,&nbsp;<strong>ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)</strong>, 2011.<br /> Since its introduction in the early 90's, Software Fault Isolation, or SFI, has been a static code technique, commonly perceived as incompatible with dynamic libraries, runtime code generation, and other dynamic code.&nbsp;</span>&nbsp;<span style="font-family:Helvetica;color:#333333;">This paper describes how to address this limitation and explains how the SFI techniques in Google Native Client were extended to support modern language implementations based on just-in-time code generation and runtime instrumentation. This work is already deployed in Google Chrome, benefitting millions of users, and was developed over a summer collaboration with three Ph.D. interns; it exemplifies how Research at Google is focused on rapidly bringing significant benefits to our users through groundbreaking technology and real-world products.<br /> <br /> &#8220;<a href="http://research.google.com/pubs/pub37474.html" target="_blank"><span style="color:#094382">Thialfi: A Client Notification Service for Internet-Scale Applications</span></a>&#8221;, Atul Adya, Gregory Cooper,&nbsp;<a href="http://research.google.com/pubs/author54699.html"><span style="color:#094382">Daniel Myers</span></a>,&nbsp;<a href="http://research.google.com/pubs/MichaelPiatek.html"><span style="color:#094382">Michael Piatek</span></a>,<strong>Proc. 23rd ACM Symposium on Operating Systems Principles (SOSP)</strong>, 2011, pp. 129-142.<br /> This paper describes a notification service that scales to hundreds of millions of users, provides sub-second latency in the common case, and guarantees delivery even in the presence of a wide variety of failures.&nbsp;</span>&nbsp;<span style="font-family:Helvetica;color:#333333;">The service has been deployed in several popular Google applications including Chrome, Google Plus, and Contacts.</span></p>  <p><br />翻译进行中.<br />&nbsp;</p></div><img src ="http://www.blogjava.net/shijian/aggbug/372604.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shijian/" target="_blank">石建 | Fat Mind</a> 2012-03-24 11:39 <a href="http://www.blogjava.net/shijian/archive/2012/03/24/372604.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>clojure之HelloWrold</title><link>http://www.blogjava.net/shijian/archive/2012/03/18/372159.html</link><dc:creator>石建 | Fat Mind</dc:creator><author>石建 | Fat Mind</author><pubDate>Sun, 18 Mar 2012 15:33:00 GMT</pubDate><guid>http://www.blogjava.net/shijian/archive/2012/03/18/372159.html</guid><wfw:comment>http://www.blogjava.net/shijian/comments/372159.html</wfw:comment><comments>http://www.blogjava.net/shijian/archive/2012/03/18/372159.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shijian/comments/commentRss/372159.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shijian/services/trackbacks/372159.html</trackback:ping><description><![CDATA[<br />今天开始尝试clojure，遇到的问题、经验整理<br /><br />1.了解clojure<br /><div><div><a href="http://metaphy.iteye.com/blog/458872">http://metaphy.iteye.com/blog/458872</a></div><br />2.开始HelloWrold<br />&nbsp;&nbsp; &nbsp;- 搭建开发环境（对于从Java过来的人，肯定习惯eclipse）<br />&nbsp;&nbsp; &nbsp; &nbsp;在线安装的速度比乌龟还慢，推荐全手动方式安装插件<br />&nbsp;&nbsp;&nbsp;&nbsp;（eclipse手动安装插件&nbsp;<a href="http://www.blogjava.net/shijian/archive/2012/03/18/372141.html">http://www.blogjava.net/shijian/archive/2012/03/18/372141.html</a>）<br />&nbsp;&nbsp; &nbsp; &nbsp;离线zip：&nbsp;<a href="http://roysong.iteye.com/blog/1260147">http://roysong.iteye.com/blog/1260147</a><br />&nbsp;&nbsp; &nbsp;- 跑起来<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;- 先'黑窗口'吧&nbsp;<a href="http://clojure.org/getting_started">http://clojure.org/getting_started</a>，热热身<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;- eclipse开发（提醒：必须把clojure-xxx.jar加入classpath）<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;- 阅读&nbsp;<a href="http://www.ibm.com/developerworks/cn/opensource/os-eclipse-clojure/">http://www.ibm.com/developerworks/cn/opensource/os-eclipse-clojure/</a>，再练习<br /><br />3.如何学习<br />&nbsp;&nbsp; <a href="http://weiyongqing.iteye.com/blog/1441743">http://weiyongqing.iteye.com/blog/1441743</a><br /><span class="Apple-style-span" style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25px; ">&nbsp;&nbsp;&nbsp;&nbsp;引 &#8220;我就应该一步一步来，先把clojure的doc文档网站上的core都敲打一遍，然后，学习孙宁的RPC框架，空闲时做4clojure的问题&#8221;<br /><br /><br /></span></div><img src ="http://www.blogjava.net/shijian/aggbug/372159.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shijian/" target="_blank">石建 | Fat Mind</a> 2012-03-18 23:33 <a href="http://www.blogjava.net/shijian/archive/2012/03/18/372159.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>eclipse使用整理</title><link>http://www.blogjava.net/shijian/archive/2012/03/18/372141.html</link><dc:creator>石建 | Fat Mind</dc:creator><author>石建 | Fat Mind</author><pubDate>Sun, 18 Mar 2012 13:10:00 GMT</pubDate><guid>http://www.blogjava.net/shijian/archive/2012/03/18/372141.html</guid><wfw:comment>http://www.blogjava.net/shijian/comments/372141.html</wfw:comment><comments>http://www.blogjava.net/shijian/archive/2012/03/18/372141.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shijian/comments/commentRss/372141.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shijian/services/trackbacks/372141.html</trackback:ping><description><![CDATA[<br />
<span style="; font-family: Arial; ">一、快捷键<br />
</span><br />
<span style="; font-family: Arial; ">1.常用快捷键</span><br />
<div><span style="line-height: 19px; "><span style="; font-family: Arial; ">&nbsp;&nbsp; &nbsp;a. crtl + h 查找内容<br />
</span><span style="; font-family: Arial; ">&nbsp;&nbsp; &nbsp;b. ctrl + shift + r 快速打开资源文件<br />
</span><font class="Apple-style-span" face="Arial">&nbsp;&nbsp; &nbsp;c. ctrl + shift + t 快速打开类文件<br /></font><font class="Apple-style-span" face="Arial" size="2">&nbsp; &nbsp; d. alt + shift + o &nbsp;快速打开 '选中相同词，出现阴影'<br /></font>
<font class="Apple-style-span" face="Courier" size="2"><br />
</font></span></div>
<span style="; font-family: Arial; ">2.如何设置自己特定的快捷键</span><br />
&nbsp;&nbsp; &nbsp;<br />
<br />
<br />
<span style="; font-family: Arial; ">二、插件<br />
</span><br />
<span style="; font-family: Arial; ">请</span><span style="; font-family: Arial; ">务必阅读：</span><br />
&nbsp;&nbsp; &nbsp;<a href="http://wiki.eclipse.org/FAQ_How_do_I_install_new_plug-ins%3F"><span style="; font-family: Arial; 
">http://wiki.eclipse.org/FAQ_How_do_I_install_new_plug-ins%3F</span></a><span style="; font-family: Arial; ">&nbsp;（为什么推荐使用eclipse update manager）
</span><br />
&nbsp;&nbsp; &nbsp;<a href="http://www.venukb.com/2006/08/20/install-eclipse-plugins-the-easy-way/"><span style="; font-family: Arial; 
">http://www.venukb.com/2006/08/20/install-eclipse-plugins-the-easy-way/</span></a><span style="; font-family: Arial; ">&nbsp;（主要讲解'manual install'安装
方式）</span><br />
<br />
<span style="; font-family: Arial; ">1.插件安装方式</span><br />
<span style="; font-family: Arial; ">&nbsp;&nbsp; &nbsp;1.1 在线安装<br />
</span><span style="; "><font class="Apple-style-span" face="Arial">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;官网wiki写的很清楚，优势：1.插件之间依赖管理、版本兼容性管理 &nbsp;2.如同你在Windows安装软件一样，当你不需要的时候可以通过update manage很容易的卸载；当你安装更多的plguin时，更容易管理。<br /></font><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="line-height: 19px; ">&nbsp;&nbsp; &nbsp;eclipse wiki对manual install的看法：This obviously is a more dangerous approach, as no certification takes place about the suitability of the plug-in; it may rely on other plug-ins not available in your installation. In the case of compatibility conflicts, you won&#8217;t find out until you use the plug-in that it might break.<br />
</span></font></span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;可惜的是，很多时候网络的情况不是很理想，尝试很多遍后，依然失败；这是促使manual install根本的原因。 &nbsp;<br />
<span style="; font-family: Arial; ">&nbsp;&nbsp; &nbsp;1.2 手动安装<br /></span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;a、第一种方式：下载plugin到本地，解压后复制features、plugin到%eclipse_home%下对应的目录<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;如此图&nbsp;<a href="http://static.flickr.com/75/219742315_9ee663e2c8_o.png">http://static.flickr.com/75/219742315_9ee663e2c8_o.png</a><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;优势：绝对简单；缺点：正好是通过update manager安装的优点，插件之间的依赖、版本兼容性，以及后续的管理，都需要手动操作。<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;b、第二种方式：通过.link的方式，解决'后续管理问题'<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b-1、eclipse目录创建 links 目录<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b-2、创建对应的.link文件，如：subversive.link<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b-3、创建subversive/eclipse/，拷贝features、plugin到此目录<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b-4、修改subversive.link文件，如：path=E:/dev/eclipse-t/thrid-plugins/subversive<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b-5、重启eclipse（重启后，发现要使用svn，必须安装subversive connector；验证手动安装的缺点）<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; c、提示：<br /><span class="Apple-style-span" style="line-height: 19px; font-family: Arial; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - 手动安装插件时，务必仔细阅读，此插件的先前条件（否则出问题，很难排查）。<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如：m2eclipse先决条件<div style="display: inline-block; "><div>subeclipse</div></div>、mylyn。<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;或 &#8220;<span style="font-family: arial, sans-serif; font-size: 13px; line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">Pre-requisite: an Eclipse version including Java Support (e.g. with the JDT : Java Development Tools, as in Eclipse For Java Developers, Eclipse For RCP/RAP developers, Eclipse for JavaEE developers, etc.)</span>&#8221;&nbsp;<a href="http://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin">http://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin</a><br /></span><font class="Apple-style-span" face="Arial"><span class="Apple-style-span" style="line-height: 19px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -&nbsp;</span><span class="Apple-style-span" style="line-height: 19px; "><div style="display: inline-block; "><div>eclipse 手动安装plugin，.link文件的path路径 必须使用绝对路径</div></div></span><span class="Apple-style-span" style="line-height: 19px; "><br /></span></font>
<br />总结：对eclipse插件安装，首先推荐update manager；仅当网络环境不允许时，安装失败时，再尝试手动安装。<br /><br />
<span style="; font-family: Arial; ">2.插件资源收集</span><br />
<br />
<div><span style="line-height: 19px; ; font-family: Arial; ">2.1、 m2eclipse插件安装<br />
</span><span style="line-height: 19px; ; font-family: Arial; ">&nbsp;&nbsp; &nbsp;1）先决条件<br />
</span><span style="line-height: 19px; ; font-family: Arial; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;a、eclipse3.2或更高版本（可忽略，一般使用的eclipse已经3.5以上
版本）<br />
</span><span style="line-height: 19px; ; font-family: Arial; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;b、jdk高于1.4版本；eclipse运行在jdk环境，非jre环境<br />
</span><span style="line-height: 19px; ; font-family: Arial; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;c、必须先安装插件：subeclipse（svn）、mylyn（任务管理）；
mylyn在eclipse3.5以上版本，已默认存在，无需安装<br />
</span><span style="line-height: 19px; ; font-family: Arial; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;svn插件在线安装地址（网络不确定性，更推荐下载zip，archive选择本地文件安装）<br /><a href="http://subclipse.tigris.org/servlets/ProjectProcess;jsessionid=290480ED68C2C7E781DCCE66CE657FC2?pageID=p4wYuA" style="color: #0066aa; 
text-decoration: none; "><span style="; font-family: Arial; 
">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://subclipse.tigris.org/servlets/ProjectProcess;jsessionid=290480ED68C2C7E781DCCE66CE657FC2?pageID=p4wYuA</span></a><br />
</span><span style="line-height: 19px; ; font-family: Arial; ">&nbsp;&nbsp; &nbsp; 2）安装m2eclipse，未找到可下载到本地的zip，只能在线安装，地址&nbsp;<span style="font-family: Arial; color: #0066aa; text-decoration: none; "><a href="http://www.eclipse.org/m2e/download/" style="color: #0066aa; text-decoration: none; ">http://www.eclipse.org/m2e/download/</a><br /><br /><br /></span></span></div><img src ="http://www.blogjava.net/shijian/aggbug/372141.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shijian/" target="_blank">石建 | Fat Mind</a> 2012-03-18 21:10 <a href="http://www.blogjava.net/shijian/archive/2012/03/18/372141.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>泛型 [core Java 阅读笔记]</title><link>http://www.blogjava.net/shijian/archive/2012/03/08/371545.html</link><dc:creator>石建 | Fat Mind</dc:creator><author>石建 | Fat Mind</author><pubDate>Thu, 08 Mar 2012 13:05:00 GMT</pubDate><guid>http://www.blogjava.net/shijian/archive/2012/03/08/371545.html</guid><wfw:comment>http://www.blogjava.net/shijian/comments/371545.html</wfw:comment><comments>http://www.blogjava.net/shijian/archive/2012/03/08/371545.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shijian/comments/commentRss/371545.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shijian/services/trackbacks/371545.html</trackback:ping><description><![CDATA[<br />题记：单元测试的过程中，遇到泛型mock的问题；重新温习一遍，阅读（core java 泛型）<br /><br /><img src="http://www.blogjava.net/images/blogjava_net/shijian/generic.PNG" width="800" alt="" height="300" /><br /><br />xmind格式（可下载） ：<a title="整理过程中，记录为xmind格式" href="/Files/shijian/generic.rar">整理过程中，记录为xmind格式</a><br /><br />单元测试遇到的问题，简化后如下：<br /><br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; ">&nbsp;1</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">public</span><span style="color: #000000; ">&nbsp;List</span><span style="color: #000000; ">&lt;?</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">extends</span><span style="color: #000000; ">&nbsp;Date</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">&nbsp;getDateT()&nbsp;{<br /></span><span style="color: #008080; ">&nbsp;2</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">return</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">;<br /></span><span style="color: #008080; ">&nbsp;3</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;}<br /></span><span style="color: #008080; ">&nbsp;4</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">public</span><span style="color: #000000; ">&nbsp;List</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">Date</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">&nbsp;getDate()&nbsp;{<br /></span><span style="color: #008080; ">&nbsp;5</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">return</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">;<br /></span><span style="color: #008080; ">&nbsp;6</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;}<br /></span><span style="color: #008080; ">&nbsp;7</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">public</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">void</span><span style="color: #000000; ">&nbsp;mockGetDate()&nbsp;{<br /></span><span style="color: #008080; ">&nbsp;8</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TestMain&nbsp;main&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;mock(TestMain.</span><span style="color: #0000FF; ">class</span><span style="color: #000000; ">);<br /></span><span style="color: #008080; ">&nbsp;9</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when(main.getDate()).thenReturn(</span><span style="color: #0000FF; ">new</span><span style="color: #000000; ">&nbsp;ArrayList</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">Date</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">());&nbsp;</span><span style="color: #008000; ">//</span><span style="color: #008000; ">编译OK</span><span style="color: #008000; "><br /></span><span style="color: #008080; ">10</span>&nbsp;<span style="color: #008000; "></span><span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000; ">/*</span><span style="color: #008000; "><br /></span><span style="color: #008080; ">11</span>&nbsp;<span style="color: #008000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;method&nbsp;thenReturn(List&lt;capture#2-of&nbsp;?&nbsp;extends&nbsp;Date&gt;)&nbsp;in&nbsp;the&nbsp;type&nbsp;<br /></span><span style="color: #008080; ">12</span>&nbsp;<span style="color: #008000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;OngoingStubbing&lt;List&lt;capture#2-of&nbsp;?&nbsp;extends&nbsp;Date&gt;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;is&nbsp;not&nbsp;applicable&nbsp;for&nbsp;the&nbsp;arguments&nbsp;(ArrayList&lt;Date&gt;)<br /></span><span style="color: #008080; ">13</span>&nbsp;<span style="color: #008000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000; ">*/</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">14</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when(main.getDateT()).thenReturn(</span><span style="color: #0000FF; ">new</span><span style="color: #000000; ">&nbsp;ArrayList</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">Date</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">());&nbsp;</span><span style="color: #008000; ">//</span><span style="color: #008000; ">编译错误</span><span style="color: #008000; "><br /></span><span style="color: #008080; ">15</span>&nbsp;<span style="color: #008000; "></span><span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when(main.getDateT()).thenReturn(</span><span style="color: #0000FF; ">new</span><span style="color: #000000; ">&nbsp;ArrayList</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">Timestamp</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">());&nbsp;</span><span style="color: #008000; ">//</span><span style="color: #008000; ">编译错误</span><span style="color: #008000; "><br /></span><span style="color: #008080; ">16</span>&nbsp;<span style="color: #008000; "></span><span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when(main.getDateT()).thenReturn(</span><span style="color: #0000FF; ">new</span><span style="color: #000000; ">&nbsp;ArrayList</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">Object</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">());&nbsp;</span><span style="color: #008000; ">//</span><span style="color: #008000; ">编译错误</span><span style="color: #008000; "><br /></span><span style="color: #008080; ">17</span>&nbsp;<span style="color: #008000; "></span><span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when(main.getDateT()).thenReturn(</span><span style="color: #0000FF; ">new</span><span style="color: #000000; ">&nbsp;ArrayList());&nbsp;</span><span style="color: #008000; ">//</span><span style="color: #008000; ">编译OK</span><span style="color: #008000; "><br /></span><span style="color: #008080; ">18</span>&nbsp;<span style="color: #008000; "></span><span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;}</span></div><br />仍没理解，哪位大仙，能帮我解释下 ？<img src ="http://www.blogjava.net/shijian/aggbug/371545.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shijian/" target="_blank">石建 | Fat Mind</a> 2012-03-08 21:05 <a href="http://www.blogjava.net/shijian/archive/2012/03/08/371545.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>记录贴：日常问题</title><link>http://www.blogjava.net/shijian/archive/2011/12/15/366443.html</link><dc:creator>石建 | Fat Mind</dc:creator><author>石建 | Fat Mind</author><pubDate>Thu, 15 Dec 2011 07:55:00 GMT</pubDate><guid>http://www.blogjava.net/shijian/archive/2011/12/15/366443.html</guid><wfw:comment>http://www.blogjava.net/shijian/comments/366443.html</wfw:comment><comments>http://www.blogjava.net/shijian/archive/2011/12/15/366443.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shijian/comments/commentRss/366443.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shijian/services/trackbacks/366443.html</trackback:ping><description><![CDATA[<br />1.应用 jar 冲突<br />&nbsp; &nbsp; log4j冲突导致，应用报错。类型转换冲突。<br />&nbsp; &nbsp; 需求：定位某个类实际从那个jar加载 ？ -verbose:class 参数（或者&nbsp;<div style="display: inline-block; "></div><span class="Apple-style-span" style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25px; background-color: #ffffff; ">-XX:+TraceClassLoading</span>），详细的记录了加载了那些类、从那个jar加载。<br /><br />参见：<a href="http://agapple.iteye.com/blog/946603">http://agapple.iteye.com/blog/946603</a><br /><br />2.性能测试过程<br />&nbsp;&nbsp; linux有什么命令、或软件，可以同时收集cpu、load、上下文切换、mem、网络IO、磁盘IO等数据吗 ？<br />&nbsp;&nbsp; vmstat 含义详解 ？ -&gt; &nbsp;图形化报表 （痛苦的是要'人工'看着记录数据，这简直是程序员的污点呀）<br />&nbsp;&nbsp; （vmstat的IO统计的是块设备（如磁盘）的数据，网卡没有对应的设备文件（<a href="http://oss.org.cn/kernel-book/ch11/11.2.3.htm">http://oss.org.cn/kernel-book/ch11/11.2.3.htm</a>），网络IO统计使用iftop）&nbsp;<br />&nbsp;&nbsp; vmstat&nbsp;<a href="http://linux.about.com/library/cmd/blcmdl8_vmstat.htm">http://linux.about.com/library/cmd/blcmdl8_vmstat.htm</a><br /><br />3.Jboss启动错误&nbsp;<br /><div>java.sql.SQLException: Table already exists: JMS_MESSAGES in statement [CREATE CACHED TABLE JMS_MESSAGES]<br /><span class="Apple-style-span" style="color: #3d3d3d; font-family: Arial, Helvetica, simsun, u5b8bu4f53; line-height: 25px; background-color: #ffffff; "><em>参见：ht<a href="http://dinghaoliang.blog.163.com/blog/static/126540714201082764733272/">tp://dinghaoliang.blog.163.com/blog/static/126540714201082764733272/</a></em><br />%jboss_home%/server/default/deploy/hsqldb-ds.xml这个文件中有一个DefaultDS数据源配置，临时解决删除hsqldb-ds.xml文件。原因未知。<br /><br />4.logback 0.9.19 版本，引入&lt;encoder&gt;，放弃 &lt;appender&gt;&lt;layout&gt;&lt;/appenader&gt;<br /></span><span class="Apple-style-span" style="color: #3d3d3d; font-family: Arial, Helvetica, simsun, u5b8bu4f53; line-height: 25px; background-color: #ffffff; "><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">encoder</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; "><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">pattern</span><span style="color: #000000; ">&gt;%</span><span style="color: #000000; ">m</span><span style="color: #000000; ">%</span><span style="color: #000000; ">n</span><span style="color: #000000; ">&lt;/</span><span style="color: #000000; ">pattern</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; "><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">charset&nbsp;</span><span style="color: #0000FF; ">class</span><span style="color: #000000; ">=</span><span style="color: #000000; ">"</span><span style="color: #000000; ">java.nio.charset.Charset</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">UTF</span><span style="color: #000000; ">-</span><span style="color: #000000; ">8</span><span style="color: #000000; ">&lt;/</span><span style="color: #000000; ">charset</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; "><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000; ">&lt;/</span><span style="color: #000000; ">encoder</span><span style="color: #000000; ">&gt;<br /><br /><div>源码：OutputStreamAppender.java</div><div><div>&nbsp; protected void writeOut(E event) throws IOException {</div><div>&nbsp; &nbsp; this.encoder.doEncode(event);</div><div>&nbsp; }</div></div></span></div>对日志文件charset指定，经过debug调试，必须通过此方式配置才有效。否则取系统默认编码。<br /><br />5.设置linux系统编码<br /><div><a href="http://linux.vbird.org/linux_basic/0320bash.php#variable_locale">http://linux.vbird.org/linux_basic/0320bash.php#variable_locale</a><br />其实&#8216;系统编码&#8217;设置，即设置对应的系统变量，则所有可设置系统变量的文件都可设置编码，export使其生效<br />locale 查看当前用户使用的编码（），locale -a 查看机器所支持的所有编码<br />默认设置：<br />&nbsp; a、系统级别 &nbsp;/etc/profile -&gt; /etc/sysconfig/i18n，设置 LANG （无效显示export生效）（YY：i18n有个LANGUAGE设定，不知其含义，删除无影响）<br />&nbsp; b、用户级别 ~/bash_rc、~/bash_profile、~/bash_login、~/profile，读取有限顺序：从左向右；必须显示export生效<br />&nbsp;&nbsp;<div style="display: inline-block; "><div><a href="http://linux.vbird.org/linux_basic/0320bash.php#settings_bashrc">http://linux.vbird.org/linux_basic/0320bash.php#settings_bashrc</a></div></div><br /><span style="background-color: yellow; ">設定 LANG 或者是 LC_ALL 時，則其他的語系變數就會被這兩個變數所取代</span>。总之一句话：在当前用户设置LANG，是最优方案。<br /><br /></div></span></div><img src ="http://www.blogjava.net/shijian/aggbug/366443.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shijian/" target="_blank">石建 | Fat Mind</a> 2011-12-15 15:55 <a href="http://www.blogjava.net/shijian/archive/2011/12/15/366443.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>