<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
  <channel>
    <title>Lucy有话讲</title>
    <description></description>
    <link>http://tiantian911.javaeye.com</link>
    <language>UTF-8</language>
    <copyright>Copyright 2003-2008, JavaEye.com</copyright>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>JavaEye - 做最棒的软件开发交流社区</generator>
      <item>
        <title>Alpine Messaging System, the alternative to Pine. </title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/223351" style="color:red;">http://tiantian911.javaeye.com/blog/223351</a>&nbsp;
          发表时间: 2008年08月02日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          I just tried Alpine the email program from Washington University. Alpine is released under the Apache License, Version 2.0. All of the source needed to build Unix, Windows, and Web-based mail user agents is included. Alpine was developed by the department of Computing & Communications at the University of Washington. It’s as if it was based on Pine. Duh! It is. It is similar to Pine and it’s very easy to use. I didn’t notice any difference in the way I use it which is to say I like to use alpine for my gmail account. Here is what I’ve done. I got the source from the Washington website located here. I then compiled it with the normal configuration like so<br /><br />./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --disable-debug<br /><br />make<br /><br />and the final<br /><br />make install<br /><br />I’m running slackware-current as my linux distro of choice and because I have such an audience, I know that it will use all of my alloted bandwidth on westhost.com. Right?! I have produced a package with checkinstall. It it available here for your pleasure and laziness.<br /><br />alpine-1.00-i386-1.tgz<br /><br />I also configured it to check my gmail account. The way to do that is very simple. Let me take you through the steps.<br /><br />1. Type MSLA (Main> Setup> collectionLists> Add)<br /><br />2. Enter something like the following but replacing the information with your gmail account<br /><br />Nickname : Gmail<br />Server : imap.gmail.com/ssl/user=id@gmail.com<br />Path :<br />View :<br /><br />3. Let’s setup SMTP to use the gmail server. You will be able to send email from you gmail account which is very useful if you have a hostname that doesn’t resolve to your computer.<br /><br />SMTP Server (for sending) = smtp.gmail.com:587/tls/user=id@gmail.com<br /><br />4. I like using alpine configuration that comes out of the box. I only modified two more setting.<br /><br />[X] save-will-not-delete<br /><br />pruning-rule =<br />(*) don’t rename, don’t delete<br /><br />You can setup alpine to use a password file which could contain your gmail password but I do not recommend this as it not safe and usually not recommended. If you do want to use a password file you can go read some more here about it.<br /><br />That’s it. You should be able to run Alpine with your gmail account. Nice eh? If you want to setup more advance stuff like setting up two imap account and so on, check out ii.com. It is a tremendous information source.
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/223351#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 02 Aug 2008 16:12:58 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/223351</link>
        <guid>http://tiantian911.javaeye.com/blog/223351</guid>
      </item>
      <item>
        <title>制定to-do list的艺术</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/219966" style="color:red;">http://tiantian911.javaeye.com/blog/219966</a>&nbsp;
          发表时间: 2008年07月26日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          文章很有启发性,转之~<br /><br />to-do list 原文：The art of the doable to-do list<br /><br />翻译：cnexpro<br /><br />每个人都可以随意转载，只要你附带上面的信息。<br /><br /><br />没有比在你的to-do list（计划任务列表）里钩掉一个已经完成的项目更好的感觉了。完成！以上！Mission accomplished! 然而，你却很容易混过一天/一周，而没有从你的列表里减去任何一个已完成项目。嗯，to-do list可以成为你工作的向导，也可以成为嘲弄你徒然混日的明证。这取决于你怎么制订它。<br /><br />请把你的to-do list看成一堆老板的命令，而你就是那个老板，你也是你自己的狗腿。就像一个计算机程序，如果指令很明确，或者非常容易执行的，你就能从容应对了。如果不是这样，你将得到不需要的结果——比如恐惧，拖拉和自卑。今天，我将给你一些制订to-do list的技巧，让你轻松完成你列表里的项目。<br />你是自己的老板<br /><br />每个工作日，你都有两种模式：思考模式（这时你就是老板的身份）；执行模式（这时你就是助手的身份）当一个任务或企划出现时，你脑子里正在想构思怎么开始做事的时候，你就是思考模式/老板模式——你就是那个发送指令的人。你的 to-do list就是这些指令的集合，你的狗腿（执行模式的你）呆会儿将会去执行这些指令。<br /><br />所以，当你是在老板模式时，你要为你的助手写下“不用思考就能完成”的指令，Michael Buffington称之为“写下那些即便你是机器都可以完成的任务”<br />怎么运用<br /><br />那，怎么使你制定的任务可行呢？当你在to-do list里加入一个新的任务前，先停下来，用以下的方法来指导你思考一遍。<br /><br />    * 分解它——避免让你的计划成为一个灾难的最好办法就是分解它。 #原句是”The best way to make yourself avoid a task like the plague is to make it a vague monstrosity” 《Getting Things Done》一书里曾说过企划和任务的区别。 企划由许多小任务组成。这是一个非常重要的区别，请记在心里，因为你的to-do list里要写的不应该是企划。不要在你的to-do list里加上有要好几个任务才能完成的企划——比如“清理你的办公室”，应该把它打散了，比如“整理抽屉”、“把旧的废纸处理掉”、“把不再需要的书打包以便以后归还图书馆”之类的一个个小任务。因为如果你的老板模式只说了“清理办公室”的话，你的狗腿模式就要开始不知所措了。# 原句是”Because Assistant you is going to run for the hills when Boss you says “Clean out the office.” run for the hills”我觉得意思差不多。<br />    * 用“下一步”贯穿整个企划——如果你有了一个传说中多个动作组成的企划，要让列表连贯保持一直有下一步的动作存在。当一个动作完成了，回顾你的列表，并加入一个动作。任何时候，你的to-do list上只可以包含这个企划里下一个合理的动作，就是这样，要“一口口吃掉”整个企划。<br />    * 更具体的描述动作—— 当你告诉自己去做一件事时，要把它当作一个命令。一个叫“帐目核查”的项目名并没有命令你必须完成它。你要把它变成“打电话给Rob问一下帐目核查的事 ”。注意，我这里说的不是“联系Rob”，是“打电话给Rob”——联系可以通过电话、E-mail、网聊工具，你把其他这些去掉了，你的动作就更具体了。下次写to-do list的时候，请逐字的想象你自己在给第一天为你工作的狗腿描述你想要他完成什么。<br />    * 保持你的to-do list尽量的短—— 就像没有喜欢去看有2386个未读邮件的邮箱一样，每人喜欢有一个永无止境的to-do list，它将彻底淹没你，就像一个没有光亮的通道尽头。我保持我的to-do list包含20个动作以下（今天早上，只有17个，偶真是个大忙人啊~~~）这听起来太少了吗？记住，你的to-do list并不是倾泻你企划每个细节或者 “某天偶会去做XXX”的动作的地方。这些是你在最近——比如两周里会立刻完成的任务。 #这里有句，”Keep your projects and someday/maybe items elsewhere.”翻不出-_-b 你的to-do list一定要短，里面的事项都是你想好的肯定要做的。<br />    * 让to-do list更新起来—— 当我的to-dolist只有20个左右的项目时，他们每天都会更新。每天都有2-5个任务被完成，2-5个被新加入到我的列表。记住，你的to-do list是你的工作文档，而不是你用来卖弄自己的组织条理有多好的东西。<br />    * 合理分配优先次序—— 当你的to-do list上有20个项目时，你一天也只能完成其中的几个（假定你写在你to-do list上的不是“起床”，“洗澡”，“做咖啡”，“去上班”之类的…-_-b）。所以，请找出那些该呆在你的列表顶端的任务。你怎么排序取决你用什么工具或者软件来记录你的to-do list，但无论如何，一定要让自己知道下一个动作应该是哪个。<br />    * 清除——就想你应该知道哪个任务是你应该首要完成的一样，你也一定要知道哪个任务在你的列表里呆的时间最久了。可能是你现在的能力还不够完成这个任务，或者其实根本不需要做这个动作。有时从你的to-do list里删除一个项目比你钩去它还要好，因为这样节省了你的时间。<br />    * 记下你所完成的项目—— 就像一个好的狗腿，你一定很想让自己的老板知道你做好了多少事情。保留你完成的项目的记录，这让你以后可以为自己的高效率小小庆祝一下~~另一方面，你的 “done list”也是你的“to- do list”是否起作用的明证。如果2天了都还没完成一个项目呢？是你该好好重新写一个to-do list的时候了~~ <br /><br />实践它！<br /><br />这听起来很容易——只是动动手，在纸上写些简单的东西而已，但完成一件事，90%要靠一个好的计划，即使再微不足道的事也如此。就像一个好习惯，实践了才能更好的掌握。你越多运用这个技巧，你将越熟练，你在你的to-do list上去掉一个已完成任务也越轻松。
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/219966#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 26 Jul 2008 20:36:45 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/219966</link>
        <guid>http://tiantian911.javaeye.com/blog/219966</guid>
      </item>
      <item>
        <title>lftp中文问题</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/216438" style="color:red;">http://tiantian911.javaeye.com/blog/216438</a>&nbsp;
          发表时间: 2008年07月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>

	
	
	
	
	&lt;!--
		@page { size: 21cm 29.7cm; margin: 2cm }
		P { margin-bottom: 0.21cm }
	--&gt;
<p align="left">解决办法： 解决<span style="font-family: AR PL UMing CN,serif;">lftp</span>
中文乱码编码问题，修改<span style="font-family: AR PL UMing CN,serif;">/etc/lftp.conf</span>
，在最后插入：</p>
<p><span style="font-family: AR PL UMing CN,serif;">set ftp:charset &ldquo;gbk&rdquo;<br />
set
file:charset &ldquo;utf-8&Prime;</span>
</p>
</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/216438#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 19 Jul 2008 09:33:26 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/216438</link>
        <guid>http://tiantian911.javaeye.com/blog/216438</guid>
      </item>
      <item>
        <title>The greatest equations ever</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/215832" style="color:red;">http://tiantian911.javaeye.com/blog/215832</a>&nbsp;
          发表时间: 2008年07月17日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p class="standfirst">Maxwell's equations of electromagnetism and the
Euler equation top a poll to find the greatest equations of all time.
Robert P Crease discusses the results of his reader survey</p>
<div class="articleBody">
<p>Earlier this year I asked readers to send me their shortlists of
great equations. I also asked them to explain why their nominations
belonged on the list and why, if at all, the topic matters (<em>Physics World</em>
 May p19). 
</p>
<div class="articleThumbnailLeft"><a href="http://physicsworld.com/cws/article/print/20407/1/pwpov1_10-04" title="James Clerk Maxwell"><br />
James Clerk Maxwell</a>
</div>
<p>
I received about 120 responses -- including single candidates as well
as lists -- proposing about 50 different equations. They ranged from
obvious classics to &quot;overlooked&quot; candidates, personal favourites and
equations invented by the respondents themselves. </p>
<p>
Several people inquired about the difference between formulae, theorems
and equations -- and which I meant. Generally, I think of a formula as
something that obeys the rules of a syntax. In this sense, <em>E = mc</em>
<sup>2</sup>
 is a formula, but so is <em>E = mc</em>
<sup>3</sup>
.
A theorem, in contrast, is a conclusion derived from more basic
principles -- Pythagoras's theorem being a good example. An equation
proper is generally a formula that states observed facts and is thus
empirically true. The equation that describes the Balmer series of
lines in the visible spectrum is a good example, as are chemical
equations that embody observations about reactions seen in a
laboratory. </p>
<p>
However, these distinctions are not really so neat. Many classic physics equations --  including <em>E = mc</em>
<sup>2</sup>
and Schr&ouml;dinger's equation -- were not conclusions drawn from
statements about observations. Rather, they were conclusions based on
reasoning from other equations and information; they are therefore more
like theorems. And theorems can be equation-like for their strong
empirical content and value.
</p>
<p>It thus makes sense to classify both kinds as equations, which
is exactly what respondent David Walton from the University of
Manchester did. He distinguished between equations (such as <em>F = ma</em>
)
that comprise axiomatic models that &quot;define the interrelationships
between various observables for all circumstances&quot; and equations that
are approximate models (such as Hooke's law), which define &quot;the
interrelationships between the various observables over a defined range
and within a defined accuracy&quot;. I therefore interpreted the term
&quot;equation&quot; loosely.
</p>
<p>
<strong>Simplicity</strong>
</p>
<p>Respondents had many different criteria for
greatness in equations. Half a dozen people were so impressed with
simplicity that they proposed 1 + 1 = 2.
</p>
<p>&quot;I know that other equations have done more, express greater
power [and have a] broader understanding of the universe,&quot; wrote
Richard Harrison from Calgary in Canada, &quot;but there's something to be
said for the beauty of the simplest things of their kind.&quot; He then
recalled how 1 + 1 = 2 was the first equation he taught his son. &quot;I
remember [him] holding up the index finger of each hand as he learned
the expression, and the moment of wonder when he saw that the two
fingers, separated by his whole body, could be joined in a single
concept in his mind.&quot;
</p>
<p>Neil Blackie also voted for 1 + 1 = 2. &quot;For this equation to
come into being there had to be the invention of a method for
representing a physical reality, quantities had to be given names and
symbols,&quot; he argued. &quot;There had to be a system to show how these
quantities could be grouped together or taken apart. The writing down
of this equation gave us the ability to present ideas, to discuss
concepts, which led to an ever-expanding sphere of knowledge.&quot;
</p>
<p>
Other simple equations that were proposed included <em>v = H<sub>0</sub>
d</em>
, which Edwin Hubble composed in 1929 to describe the fact that the galaxies are moving away from us at a speed, <em>v</em>
, that is proportional to their distance, <em>d</em>
, where <em>H<sub>0</sub>
</em>
is the Hubble constant. Balagoj Petrusev, an undergraduate student at
the Institute of Physics in Skopje, Macedonia, suggested the
Hamiltonian variational principle in the form <em>&delta;<strong>S</strong>
 = 0</em>
. A proper selection of the form of <strong>S</strong>
articulates &quot;a universal principle that stands true in classical
mechanics, classical electrodynamics, relativistic mechanics,
non-relativistic quantum mechanics and so on&quot;. In fact, Andy Hone from
the University of Kent wrote a eulogy to this equation in <em>Physics World</em>
 last month (September p64).
</p>
<p>
The unifying power of a great equation is not as simple a criterion as
it sounds. A great equation does more than set out a fundamental
property of the universe, delivering information like a signpost, but
works hard to wrest something from nature. As Michael Berry from
Bristol University once said of the Dirac equation for the electron:
&quot;Any great physical theory gives back more than is put into it, in the
sense that as well as solving the problem that inspired its
construction, it explains more and predicts new things&quot; (<em>Physics World</em>
 February 1998 p38).
</p>
<p>
Great equations change the way we perceive the world. They
reorchestrate the world -- transforming and reintegrating our
perception by redefining what belongs together with what. Light and
waves. Energy and mass. Probability and position. And they do so in a
way that often seems unexpected and even strange.
</p>
<p>For this reason, several respondents proposed equations that
linked two or more disparate concepts, concrete and abstract things,
the visible and the invisible. They included Boltzmann's equation <em>S = k</em>
 In<em>W</em>
. 
</p>
<p>
It relates entropy, <em>S</em>
, which emerged as a concept
during the development of thermodynamics early in the 19th century, and
a purely abstract quantity, W, that emerged from the statistical
treatment of systems with many degrees of freedom. Bragg's equation (<em>n&lambda; = 2d</em>
sin&thetasym;)wrote
another respondent, &quot;links diffraction spots (visible reality) with the
underlying crystal structure (invisible reality) and can be easily
visualized with a standard textbook picture.&quot;
</p>
<p>
One of the most frequently mentioned equations was Euler's equation, e<sup>i&pi;</sup>
+ 1 = 0. Respondents called it &quot;the most profound mathematical
statement ever written&quot;; &quot;uncanny and sublime&quot;; &quot;filled with cosmic
beauty&quot;; and &quot;mind-blowing&quot;. Another asked: &quot;What could be more
mystical than an imaginary number interacting with real numbers to
produce nothing?&quot; The equation contains nine basic concepts of
mathematics -- once and only once -- in a single expression. These are:
e (the base of natural logarithms); the exponent operation;&pi;; plus (or
minus, depending on how you write it); multiplication; imaginary
numbers; equals; one; and zero.
</p>
<p>
<strong>Practicality</strong>
</p>
<p>Many respondents were impressed by equations
that have a practical influence on human life. These included: the
compound-interest equation, the implications of which from the
Renaissance to the present are &quot;obvious, staggering and unwelcome&quot;;
income-tax formulae; the simple ratio <em>a/b = c/d</em>
, which is basic to construction, surveying and so forth; simple electrical equations, such as <em>V = IR</em>
;
basic mechanical equations, such as work done = force x distance;
Shannon's capacity equation, which relates to the modern world through
the Internet and digital communication; and, last but not least,
Pythagoras's theorem.
</p>
<p>Roger Bailey nominated the &quot;sunrise equation&quot; cos(time) =
-tan(lat) x tan(dec), which identifies the time of sunrise or sunset as
a function of latitude and solar declination. This, he pointed out, is
&quot;fundamental to our sense of time&quot; and it &quot;fits on a T-shirt&quot;. Engineer
John Wilcher suggested the ideal-gas law, <em>PV = nRT</em>
,
pointing out that &quot;the relation of pressure, volume and temperature is
relevant to almost everything we do&quot;, including common but often
overlooked uses such as car tyres, angioplasty procedures and oil
drilling.
</p>
<p>
Meanwhile, Iain Christison, an emeritus professor of animal agriculture at the University of Saskatchewan, Canada, suggested <em>E<sub>M</sub>
 = H + P</em>
-- metabolized energy equals heat plus product. It describes the fact
that &quot;all of the useful energy consumed by animals, including people,
is released as heat or stored as product&quot;. The equation, he added,
&quot;carries within it an intricate balance of cause and effect that
influences all of us with every mouthful and with every step&quot;.
</p>
<p>
<strong>Historical relevance</strong>
</p>
<p>Some respondents proposed equations
that played key roles in the history of science. For example, Alan
Denham proposed the Balmer series 1/&lambda; = R (1/<em>n<sub>1</sub>
<sup>2</sup>
 + 1/n<sub>2</sub>
<sup>2</sup>
</em>
).
The long history of this equation stretches from Fraunhofer's studies
of the spectrum of sunlight in 1814, to Kirchhoff's suggestion in 1859
that each atomic species has a unique spectrum, to Angstrom's
publication of the wavelengths of a thousand Fraunhofer lines in 1868,
to schoolteacher Johann Balmer, who in 1885 noticed that the
frequencies of light emitted by hydrogen atoms were mathematically
related. The equation's history was continued by Lyman's observations
in the ultraviolet region and by others in the infrared, by Rydberg
(who gave his name to the constant <em>R</em>
in the equation), and by Bohr, whose work in 1913 explained the
equation. &quot;As soon as I saw Balmer's formula the whole thing was
immediately clear to me,&quot; Bohr once said.
</p>
<div class="articleThumbnailRight"><a href="http://physicsworld.com/cws/article/print/20407/1/pwpov2_10-04" title="The 20 greatest equations"><br />
The 20 greatest equations</a>
</div>
<p>&quot;Thus
this century-long story,&quot; Denham wrote, &quot;involving the theoretical and
practical investigation of science by some of its most distinguished
practitioners, would be incomplete without giving due honour to the
contribution of a secondary-schoolmaster who spotted that the published
scientific data conformed to a pattern that none of the scientists of
his day were aware of.&quot;
</p>
<p>
<strong>Maxwell's equations</strong>
</p>
<p>The responses suggested that there is
no single criterion for greatness, and that a truly great equation
ranks high in each of the above criteria. However, most votes were
given to Euler's equation and to Maxwell's equations, which describe
how an electromagnetic field varies in space and time. Although
Maxwell's equations are relatively simple, they daringly reorganize our
perception of nature, unifying electricity and magnetism and linking
geometry, topology and physics. They are essential to understanding the
surrounding world. And as the first field equations, they not only
showed scientists a new way of approaching physics but also took them
on the first step towards a unification of the fundamental forces of
nature. A firm called Ocean Optics in Florida even sells T-shirts with
Maxwell's equations on.
</p>
<p>Tony Watkins recalled how he learned the equations during his
second year as an undergraduate at Southampton University almost 20
years ago. &quot;I still vividly remember the day I was introduced to
Maxwell's equations in vector notation,&quot; he wrote. &quot;That these four
equations should describe so much was extraordinary...For the first
time I understood what people meant when they talked about elegance and
beauty in mathematics or physics. It was spine-tingling and a turning
point in my undergraduate career. After a year of rapidly dwindling
interest in physics (and rapidly decreasing results!), my passion was
reignited by four lines of symbols.&quot; He even renamed his next bicycle
Maxwell in honour of the great man, having previously ridden on his
Carnot Cycle. Sadly for him, he never got round to learning tensors to
see Maxwell's equations expressed even more simply.
</p>
<p>
<strong>The critical point</strong>
</p>
<p>Nobody accepted my invitation to
discuss why greatness in equations matters, which leaves me free to
address the topic myself. Debating the issue has drawbacks, for it can
foster the idea that equations are independent tools rather than
embedded in networks of other equations, practices and information.
Nevertheless, it helps us to recollect, among other things, what
Richard Harrison called that &quot;moment of wonder&quot; that was apparent in
his son's contemplation of 1 + 1 = 2.
</p>
<p>As adults, we lose that wonder. We come to think of equations
as just another set of tools that lie about ready-at-hand in the world.
We lose our appreciation for their origin, thinking that they are not
really of human origin: on the eighth day, God created equations as the
blueprint for His recent work. As Galileo wrote -- disingenuously,
polemically -- the Book of Nature is written in mathematical symbols.
That's untrue, of course. We write, and continually rewrite, the book
of nature.
</p>
<p>As the philosopher Immanuel Kant once wrote: &quot;When we discover
that two or more heterogeneous empirical laws of nature can be unified
under one principle that comprises them both, the discovery does give
rise to a noticeable pleasure...even an admiration that does not cease
when we have become fairly familiar with its object&quot;. This delight is
more than having our expectations fulfilled or surprised, more than
about the domination and control of nature, more than a biological
product. The pleasure, Kant continued, is a feature of the exercise of
the human intellect. &quot;Even the commonest experience would be impossible
without it,&quot; he wrote, which is why we &quot;gradually come to mix it with
mere cognition and no longer take any special notice of it.&quot;
</p>
<p>In reawakening that sense of wonder, debating what makes
equations great therefore re-educates us about the fundamental nature
of science, and knowledge, itself.</p>
</div>
<h3>About the author</h3>
<p><a href="mailto:rcrease@notes.cc.sunysb.edu">Robert P Crease</a>
is in the Department of Philosophy, State University of New York at
Stony Brook, and historian at the Brookhaven National Laboratory.</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/215832#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Thu, 17 Jul 2008 15:48:35 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/215832</link>
        <guid>http://tiantian911.javaeye.com/blog/215832</guid>
      </item>
      <item>
        <title>男士常见肌肤问题及针对方案</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/204651" style="color:red;">http://tiantian911.javaeye.com/blog/204651</a>&nbsp;
          发表时间: 2008年06月17日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>问题一：皮肤就象个大油田，常常看上去油光光的，可是感觉居然还是很干燥。感觉好糟糕。 <br />　　 <br />　　为什么会出现这些问题？ <br />　　首先和男性先天体质有关。80%的男性都属于油性肌肤。男性角质层厚，皮脂腺和汗腺都较大，再加上雄性荷尔蒙过旺，导致皮脂大量分泌，严重时还会造成肌肤表面老废角质堆积，造成毛细孔阻塞，也就是所谓的粉刺、青春痘。通常来说造成皮肤容易出油的因此有以下这些： <br />　　1.缺乏水分的水油不平衡。&ldquo;我的皮肤已经很油了，不需要补了吧？&rdquo;不少男性都会这样想。其实补水和补油是有区别的，关键是有了足够的水分，才不至于产生过多的油分。 <br />　　2.不洗脸就睡觉。 <br />　　会使毛孔处的化妆品酸化，导致毛囊发炎，皮脂溢出，油脂分泌更旺盛。 <br />　　3.清洁过度。 <br />　　你一天要洗几次脸呢？有些男性觉得皮肤上的油怎么都洗不干净，就一天三次、四次洗。心理上，你洗去了脸上的油污，事实上，洗得太干净，又没有及时滋润，干燥的环境让肌肤报复性地出油。同样，过多使用吸油纸也会使油脂增加。 <br />　　4.生活不规律，抽烟、喝酒强刺激。 <br />　　抽烟、喝酒、忙于夜间的应酬，这些习惯都在偷偷改变着你的激素和内分泌状况，让肌肤失去光彩的同时变得&ldquo;油光光&rdquo;。经常熬夜的肌肤更易出油。熬夜后血液循环失调，皮脂溢出且容易堆积，会使肌肤加速恶化。 <br />　　5.食物中的油脂。 <br />　　过于油腻的食物会加速油脂的分泌，肉类、油炸类以及快餐食品是油脂过盛的罪魁祸首。 <br />　　6.气温增高。 <br />　　温度每上升1度，皮肤的排油量就增加10％ 。同时到了夏天因为出汗的原因，会让整张脸看起来油光满面 。 <br />　　 <br />　　如何解决这些问题？ <br />　　重整&ldquo;肌&rdquo;质 并不难，你需要做的只有如下几点，帮你逐步逃离油光皮肤： <br />　　1.适当清洁，记住洗脸需要适当的次数和适当的水温。 <br />　　2.选择适合的有洁面产品，可以有效洗清面部油脂。 <br />　　3.洁面后立即用毛巾按干脸上的水分，防止蒸发。 <br />　　4.选用低油配方的面乳，不但能补充水分，深层滋润皮肤，而且能有效控制皮肤出油。 <br />　　5.定期作深层肌肤护理，从内而外改善肤质，控油补水，调节肌肤水油平衡。 <br />　　6.改掉不良的生活习惯，比如抽烟、喝酒以及用凉水洗脸。 <br />　　7.为肌肤补充足够的水分，多喝水并且注意保湿。 <br />　　8.有意识地多吃一些蔬菜、水果以及含有B族维他命的食物。尽量减少食用煎炸的食物和巧克力。 <br />　　9.尽量能给自己日光防护，涂抹一些防晒霜。 <br />　　 <br />　　 <br />　　 <br />　　问题二：恼人的痘痘总突然袭击，脸上红红肿肿的，好心情大大折扣！ <br />　　 <br />　　为什么会出现这些问题？ <br />　　对于已生成的痘痘，应分清其究竟是青春痘还是成人痘。因为只有改善复发的诱因才能真正有效控制痘痘的泛滥。 <br />　　1．青春痘 <br />　　在13～20岁左右的青春期发生最为频繁，多见于额头和两颊。主要由于青春期雄性激素增多，引起皮脂分泌过剩，毛囊皮脂腺堵塞、发炎，最终导致痘痘的形成。 <br />　　因为绝大部分青春痘的形成原因都和皮脂分泌过剩脱不了干系，所以说最要紧的是清除多余皮脂，保持肌肤清洁，及时消除炎症。 <br />　　2．成人痘 <br />　　早已过了青春期，却仍满脸痘痘，医学界称为Adult Acne。20岁后的痘痘，多见于下巴、唇周、脸部边缘等部位，容易在同一部位反复发作，易留下痘痕。成人痘主要因内分泌失调导致肌肤再生周期紊乱，常与精神压力、睡眠不足、黄体素分泌过多、便秘等身心方面的代谢不良密切相关。 <br />　　 <br />　　（相信绝大部分男性的痘痘都要划入成人痘的范畴了，那我们多了解一些关于成人痘的成因！） <br />　　1.老化角质。 有时脸上长痘并非仅因油脂分泌过多，而是老化角质堆积堵塞毛孔造成。尤其像发际、鼻翼、眉间这些部位。 <br />　　2.便秘问题。因体内毒素积聚无法正常排出，于是通过皮肤排出而引发痘痘。 <br />　　3.精神压力。长期处于高压之下，也容易冒出痘痘。因为疲劳过度、压力过大会影响自律神经，造成荷尔蒙失调、免疫力下降，于是从皮肤上反映出来。 <br />　　4.环境变迁。尤其是到了高温高湿的地方，皮肤油脂分泌就会随之增多，从而引发痘痘。 <br />　　 <br />　　如何解决这些问题？ <br />　　1.在加强日常清洁的基础上，每周做一次温和的去角质护理，在保持皮脂腺畅通的同时又不会刺激皮肤。切忌不能用手用力挤压。 <br />　　2.日常脸部清洁要彻底。最好选择清洁性适度的产品，适度清洁皮肤污垢细菌和油脂，但不会过分清洗皮肤本身油脂，否则肌肤自卫机能就会再分泌更多的油脂，导致油腻及痘痘更加猖獗。 <br />　　3.使用控油净脂功能的护肤品。控制皮脂腺的分泌机能，并在皮肤表面&ldquo;吸油&rdquo;，将油脂转化同时收缩毛孔，使油脂分泌量降低。 <br />　　4.痘痘皮肤一定要防晒！除非炎症特别严重，可以改用遮阳伞或帽子防晒；否则一定要涂防晒产品。因为紫外线会刺激痘痘使炎症更厉害，而且一旦经痘痘的伤口，穿透表皮层，会在伤口部位形成黑色斑点，即使在痘痘消失后，仍会留下像黑斑一样的灼伤痕迹。 <br />　　5.有痘痘的朋友，有时适度擦一些粉底或遮瑕膏，起到遮盖和美化的效果，但要避免油溶性的产品，以免恶化。 <br />　　6.要想加速痘痕消退，可使用含有维生素C的护肤品直接涂在痘痕上，加速黑色素代谢，淡化痘痕。 <br />　　7.改善饮食习惯，尽量不要频繁摄入刺激性食物。多摄取富含维生素的食物，多吃凉性的蔬菜水果。另外，多吃些含锌含钙的食物，锌可加速蛋白质合成及细胞再生，并促进伤口愈。 <br />　　8.放松心情，减轻压力，保证充足的睡眠。 <br />　　 <br />　　 <br />　　 <br />　　问题三：起屑，紧绷，条纹，过敏、骚痒 ，这些都是皮肤干燥的警报。特别在秋冬，还经常出油，干燥没有生气。 <br />　　 <br />　　为什么会出现这些问题？ <br />　　1.年龄增长。正常的皮肤角质层含有10%-30%的水分，随着年纪增长，皮肤老化，其保湿作用减弱，皮肤角质层水分含量加速蒸发减少。当其低于10%时，皮肤就会出现干燥、紧绷、粗糙及脱屑等。 <br />　　2.皮脂分泌不足。皮脂膜可帮助肌肤维持适当的水份。一旦皮脂分泌减少，就无法满足制造皮脂膜的需要，变得皮肤干燥。 <br />　　3.睡眠不足、疲劳。使身体受到相当程度的伤害，血液循环变差，肌肤没有活力，易产生皮肤干燥及粗糙。 <br />　　4.压力过大。当人的焦虑程度越高，皮肤透性障（保持水分和抗过敏的物质）的恢复速度就越低。 <br />　　5.体内营养失调。除了缺乏水分滋润，肌肤营养环境恶化，营养失调导致新城代谢加快才是主要的。 <br />　　6.气温下降。秋冬皮脂和汗水的分泌会急速减少，由于空气太干，皮肤水份逐渐蒸发，皮肤表面变得粗糙，抵抗力减弱。 <br />　　7.洗澡次数过多。容易把自动脱落的角质层和汗液混合的皮垢洗掉，减少了这些物质对皮肤的保护，细胞内的水分更容易蒸发，皮肤干燥。 <br />　　 <br />　　如何解决这些问题？ <br />　　1.洗脸时水勿过烫，使用适合肌肤类型无刺激的保湿护肤产品。 <br />　　2.简易脸部按摩。晚间护理时，在水分和精华素后，只需3分钟即可。每周按摩3次以上为最佳。不仅能促进面部血液循环，缓解干燥和水油不平衡，更能抵抗外界环境的刺激，预防和延缓松弛。 <br />　　3.肌肤水分容易流失，日霜晚霜未必能深层滋润，每星期建议最少做一次补湿面膜以滋养肌肤。 <br />　　4.多喝水。体内补充足够的水份，每天至少要喝6～8杯温凉开水。尤其是晨起一杯水，既能有效清理胃肠道，促进胃肠运动，又能补充一夜消耗的水分。 <br />　　5.多吃水果和蔬菜，在补充维生素的同时又补充了内在必要养分。多吃滋阴润肺之物，如芝麻、蜂蜜，尽量少吃葱、蒜等刺激性食物。西红柿可以健胃消食，抗衰老；胡萝卜可以减轻皮肤干燥。 <br />　　6.洗澡不要过于频繁、洗澡水不能过烫。洗澡后趁着毛孔张开时，在5分钟内将护肤乳液涂于全身。 <br />　　7.合理安排自己生活，早睡早起，避免精神压力过大，保证足够的睡眠、乐观的情绪。 <br />　　 <br />　　 <br />　　 <br />　　问题四：很多人认为色斑是女性的"专利"，与男性没什么关系。其实男性长有雀斑的也为数不少。 <br />　　 <br />　　为什么会出现这些问题？ <br />　　1.日晒或者其他可见光。如电脑屏幕辐射，让基底细胞受到破坏，从而引发黑色素在真皮层脱落，形成褐斑、雀斑。每一次暴晒，即使皮肤表面没有明显变化，但在皮肤的底层都会留下受伤印记。黑斑的叠加会加剧雀斑，脸就更黑了。 <br />　　2.使用劣质化妆品。其所含色素防腐剂，与汗水相混合，侵入皮肤内层，加速黑斑产生。 <br />　　3.强烈紫外线、污浊的空气。会使自由基的活性增强，自由基在攻击和破坏细胞过程中，细胞大量死亡和代谢紊乱，细胞内杂质无法代谢，造成色素沉积。 <br />　　4.年龄增长，皮肤老化。使皮肤血液不顺畅，色素不均衡，血液淤积与色素凝滞，黑色素细胞过多地分泌，也会使皮肤变黑。 <br />　　5.人体长期劳累，工作压力大，心情压抑。导致人体分泌神经紧张，新陈代谢减缓，分泌毛孔不畅，最终出现血液阻塞，皮肤将无法取得充足的养分。 <br />　　6.吸烟成瘾。引起皮肤色素发黄，身体内色素分布不均衡，色素分泌紊乱。 <br />　　7.生活无规律或不稳定。导致内分泌紊乱，血液循环不畅，毛血管阻塞，血液淤积，色素凝滞、沉淀。 <br />　　8.缺乏运动，膳食结构不合理。导致营养不良，导致色素生成沉着、色素垃圾滞留。 <br />　　 <br />　　如何解决这些问题？ <br />　　1.先去除老化角质。由于黑斑产生于皮肤的基底层，所以有效的淡斑护肤品应作用于肌肤深层，有效地去除老化角质，从内到外淡斑。 <br />　　2.脸部按摩要适度。每天一次，用手掌或手指有韵律地沿着肌肤脉络进行适度按摩，每次不超过5分钟，动作轻快温柔。过度按摩可能加速肌肤老化，更容易让色斑找到出头机会。 <br />　　3.定期使用有美白功能的面膜，令皮肤表层角质变干净，令色素从表皮细胞逐渐脱落。 <br />　　4.直接把精华素点在有斑点的地方，起到强化淡斑的作用。 <br />　　5.全年防晒，避免过长时间的日晒。 <br />　　6.祛斑是场持久战，一步到位不太可能。可用遮瑕的办法，起到即时修饰美化的作用。不要使用过白的遮瑕膏，选择与粉底同色或浅一号的遮瑕产品最合适。涂在斑点上，以按压的方式让它与皮肤融合。注意一定是按压，而非横向涂抹，再用粉底与周围肌肤均匀过渡，色斑就隐于无形了。 <br />　　7.服用维生素Ｃ，有褪色作用。每天喝一杯西红柿汁或柠檬汁加糖水，对防止祛斑有较好的作用。因西红柿中含有丰富的谷胱甘肽，可抑制黑色素；柠檬中含有大量维生素C、钙、磷、铁等，使色素减退或消失。 <br />　　8.注意适量的运动。 <br />　　9.保持充足的睡眠，心胸开朗，保持乐观情绪。 <br />　　 <br />　　 <br />　　 <br />　　问题五：眼睛周围的毛细血管会产生收缩，血液便不能顺畅流动，造成血液暂时停滞，进而引起了黑眼圈。 <br />　　 <br />　　为什么会出现这些问题？ <br />　　现代生活中越来越多的阅读、视频等更让眼睛疲劳加剧，且由于年龄增长，体内胶原蛋白逐渐减少，眼周自然就会开始出现皱纹。黑眼圈的成因有很多，如睡眠不足，营养不良，缺乏运动、毛细血管就会产生收缩，血液便不能顺畅流动，造成血液暂时停滞。滞缓的血液透过极其单薄的眼周肌肤依稀可见，引致沉淀的黑色素浮现。这就是黑眼圈的真实面目！ <br />　　 <br />　　如何解决这些问题？ <br />　　1.血管性静脉循环不良所引起的黑眼圈，在睡眠不足、过度疲劳时会更为明显。保持充足的睡眠、呼吸新鲜空气，多摄入氧气均可改善。经常轻柔地按摩眼部皮肤，加强微细血管的柔韧性对促进静脉循环回流也会有帮助。 <br />　　2.黑色素沉淀和过敏导致的黑眼圈，须先寻找出病源以治病着手，再配合一些祛斑用品及相应的眼霜予以护理。这种后天性的色素沉淀在经过一段正确的护理后是会淡化的。 <br />　　3.对于疲劳性的黑眼圈患者则需要从日常生活做起逐步清除黑眼圈。 <br />　　4.安排好生活，保证充足睡眠，绝不可熬夜。同时睡觉时仰睡而不是俯睡，并尽量使用柔软的枕头。 <br />　　5.尽量避免过度地搓揉眼部。 <br />　　6.当您起床时黑眼圈太过严重时，有一招急救法：将一条热毛巾敷在眼部，包括两侧的太阳穴；确定完全覆盖眼睛四周，大约敷二十分钟，毛巾的热力会促进血液流通再用冷毛巾同样敷三十秒至一分钟，令毛孔收缩，然后涂上眼霜。 <br />　　7.一些耗氧运动，使血液保持充足的氧分。亦可在早上或晚饭后出外散步，呼吸新鲜空气。 <br />　　 <br />　　 <br />　　 <br />　　问题六：拥有紧致健康皮肤想必是每个时尚男性的愿望，可偏偏有那些粗大的毛孔来扰局！尤其到了夏季，毛细血管舒张，汗水和油脂分泌也较其它季节更旺盛，毛孔粗大现象变得格外明显！ <br />　　 <br />　　为什么会出现这些问题？ <br />　　1.与遗传有关。从青春期开始，受荷尔蒙分泌影响，皮脂腺随之变大。若雄性激素分泌旺盛，皮脂腺发达，那么毛孔就显大，反之则显小。 <br />　　2.毛孔污物阻塞。会引起皮肤新陈代谢不顺利，皮脂腺容易与空气中的灰尘、污垢产生一些反应，堵塞在毛孔里面，无法如期脱落，致使毛孔扩大。 <br />　　3.皮肤松弛老化。随年龄增长，肌肤新陈代谢功能减退，角质层水分含量减少，毛孔附近的弹力纤维、胶原蛋白也逐渐断裂变形，于是毛孔壁失去弹性，支撑不住毛孔原有的形状，毛孔因此而变得更明显，并呈现下垂的椭圆形。 <br />　　4.抽烟。香烟会令血管收缩，血液循环减慢，养分无法顺利地送达皮肤细胞，脸部线条自然下垂，毛孔撑大。 <br />　　 <br />　　如何解决这些问题？ <br />　　虽说毛孔的大小在一定程度上取决于遗传，但后天的保养护理相当重要！通过合理的护肤措施，使它看上去不那么明显（形似缩小），或是减缓恶化。 <br />　　1.对因天生皮脂分泌旺盛而导致的毛孔粗大，最有效的手段就是充分做好清洁工作，定期去角质和控制皮脂分泌，使肌理整齐，那样毛孔看上去也就不那么明显突兀了。 <br />　　2.洗脸的水温不能太高，以温水为宜；蒸面和桑拿不宜常做，尤其是油性肤质的人，因为高温使皮肤膨胀、皮脂分泌加强，毛孔也随之张开，久而久之其本来就比正常人粗大的毛孔更加粗大。 <br />　　3.油性肌肤的人可以在洗脸时，在清水中滴入几滴柠檬汁，除了可收敛毛孔外，也能减少粉刺和面疱的产生。（但注意浓度不可太浓，且不可将柠檬汁直接涂抹在脸上。） <br />　　4.清洁完皮肤后，选用控油产品来平衡皮脂分泌，使皮肤达到水油平衡，使毛孔显得更细致。 <br />　　5.因老化而导致的毛孔粗大现象，绝对是可以预防的。首先应注重保湿，加强补充胶原蛋白。可使用含有抗氧化剂以及维他命A醇的护肤品，努力防止胶原蛋白的减少，预防衰老，提高皮肤的支撑力。 <br />　　6.日常调理是个长期的功课，要想即时让皮肤得到改善的效果，让毛孔隐形，也可以采用一些底妆产品来修饰，自然有效。 <br />　　 <br />　　 <br />　　 <br />　　问题七：肤色容易发黄、暗沉。皮肤无法表现健康的肤色，暗沉缺乏生气，不管穿什么帅气衣服都提不起精神。 <br />　　 <br />　　为什么会出现这些问题？ <br />　　东方黄种人的肤色容易发黄、暗沉。皮肤无法表现健康的肤色，暗沉缺乏生气，不管穿什么帅气衣服都提不起精神。具体来说，&ldquo;肤色暗沉&rdquo;指血液循环变差，脸色不再红润，失去光彩。另外，面部老化角质堆积，皮肤角质层缺水，肌肤失去透明感和光泽度时，也会显得晦暗。 研究显示，随着年龄增加导致皮肤新陈代谢能力下降、以及过度劳累、睡眠不足等因素都会引起身体状况的变化，再加上紫外线和空气干燥等来自外界环境的影响，多重因素叠加在一起，就会使肤色变得晦暗。导致肤色暗沉的六大原因： <br />　　1.洁面不彻底。如洁面不彻底，污垢残留在脸上，肤色就暗哑无光。皮质分泌最多的鼻翼是最要注意的，当鼻上毛孔附着污垢，问题就更严重。 <br />　　2.缺水。如果肌肤干燥，角质层水分不足，肤色灰暗、欠缺透明感的情况会更严重。 <br />　　3.紫外线。皮肤暗沉和老化紧密相关。而紫外线又是老化的主要杀手，它令纹理混乱血液循环不畅、黑色素积聚；深入破坏真皮层，侵害胶原纤维及弹力纤维，使其变质，在真皮层中残留成块，肌肤失去剔透感而泛黄、暗沉。 <br />　　4.电脑辐射。当你每天面对电脑长时间工作，是否发现皮肤越来越暗沉，你的肌肤已不知不觉遭遇&ldquo;电脑辐射&rdquo;。 <br />　　5.睡眠不足。晚上的睡眠时间是皮肤细胞更新最活跃的时刻。太晚睡或睡眠不足，新陈代谢功能不畅顺，造成老化角质层增厚，肌肤失去透明感，呈现泛灰晦暗颜色。 <br />　　6.压力。我们受压的时候，身体处于紧张状态，造成血管收缩，血液循环不良，脸色也暗沉下来。而当你过度疲累，肌肤的新陈代谢缓慢，脸色因角质积聚而变得更加暗沉。 <br />　　7.吸烟。吸烟会使微血管收缩、血液循环恶化，肌肤因而处于缺氧状态，脸色自然黯淡。香烟还会破坏维他命C，抽一根烟会令你流失25-100mg的维他命C，而维他命C具有抑制黑色素及帮助皮肤更新的作用。另外，烟雾也会弄脏毛孔，令肤色更暗哑。 <br />　　 <br />　　如何解决这些问题？ <br />　　正常肌肤的男性如果不注意防护，斑点和暗沉会自动找上门来，日常生活要多留个心眼，淡化或抑制尚未形成的黑色素，自然提亮肤色，神采奕奕面对工作生活的每一天。 <br />　　1.平日的清洁工作极其重要。通过洁面,乳液的基础步骤来进行肌肤护理。基础护肤能使皮肤新陈代谢回复正常状态，使厚而硬的皮肤角质变得柔软松弛。 <br />　　2.每周的深层清洁也是必须功课，彻底洗净肌肤毛孔脏污，彻底排毒，让皮肤能够深层呼吸。只有清洁到位了，肌肤才能吸收营养，令肌肤摆脱暗沉。 <br />　　3.如再加上具有较强促进代谢功能的按摩和面膜，效果则更佳。循环按摩操透过按摩手法及有效成分帮助肌肤苏活，同时还可拉提肌肤，让肤色重拾明亮、脸部线条更紧实！ <br />　　4.抓紧平时的防晒工作,建议不分四季,不分阴晴至少要擦上SPF15的产品，抑制色斑的产生。在白天护理之后使用隔离辐射的隔离霜，抵挡或减弱电磁波对皮肤的伤害。 <br />　　5.想要让暗沉肤色瞬间提亮，可选择有润色效果的饰底乳，一方面调整均匀肤色、另一方面也可肤质显得更饱满有光泽，是皮肤抵御外界污染的最后一道保护层。 <br />　　6.临睡前清洁基础护理后使用提亮精华素，更能让肌肤充分深层吸收美白成分。维生素C能够抑制色素沉着，促进血管微循环、排除肌肤组织中的毒素抗氧化，减缓肌肤老化；而维生素E能抵御游离基侵害皮肤，令皮肤中的血液明亮干净。 <br />　　7.保持充足的睡眠。肌肤的新陈代谢一般在夜间10至凌晨2点之间进行，这段时间里让肌肤得到充分的休息可促进新陈代谢。 <br />　　8.饮食中多多摄入可促进新陈代谢的维生素A。动物肝脏、蛋黄、乳制品、黄绿色蔬菜和鱼类食物中都含有维生素A。不要大量吸烟，保持良好的生活习惯。 <br />　　9.有氧运动。瑜伽、韵律操、慢跑 步行，可舒解压力、防止血管收缩，让皮肤健康红润。 <br />　　 <br />　　 <br />　　 <br />　　问题八：皱纹是时间刻在脸上的痕迹，男性20周岁后就会产生细纹，随着时间的推移皱纹会越来越明显。 <br />　　 <br />　　为什么会出现这些问题？ <br />　　1.皮肤弹力纤维减少。 皮肤真皮组织的绝大部分是由弹力纤维构成，随着人体生长，皮肤营养环境恶化，弹力纤维越来越少，皮肤失去弹性，皱纹聚拢。 <br />　　2.皮肤水分减少。皮肤中角质层通常会有10%--20%水份，在这个平衡范围内，肌肤柔软有弹性，当角质层的水分减至10%以下时，细纹便悄无声息地滋生了。 <br />　　3.胶原蛋白和弹性蛋白减少。脑垂体在不断衰老过程中，分泌的生长素越来越少，抑制了胶原蛋白和弹性蛋白的生长，而这两样物质是保持肌肤紧绷感和弹性感的最重要因素！ <br />　　4.眼部肌肤是脸上最娇嫩的部分。随年龄增长，水分更容易流失，而且眼部周围由于没有皮脂分布，无法分泌油脂，渐渐地便会失去弹性，皱纹便自然产生。 <br />　　5.日晒、干燥、寒冷、洗脸水温过高、表情丰富、吸烟、酒精。都会导致纤维组织弹性减退，产生鱼尾纹、表情纹、眼部细纹等。抽烟会导致口腔周围的皮肤提早老化，也因皮下微血管血液供应较少，而加速皱纹产生。酒精使脸部发肿撑开，待收缩时皱纹便因此而生。 <br />　　 <br />　　如何解决这些问题？ <br />　　我们虽无法阻止生命的生长与衰竭，但却可把皱纹出现的时间延迟： <br />　　1.选择滋润的护肤品，经常使用抗皱类精华，深层补充皮肤所需氧分。每次涂抹要连带上颈部，由下向上推抹，防止肌肤下垂松弛。 <br />　　2.全年使用防晒霜。由于臭氧层被破坏，阳光对皮肤的伤害越来越大，因此即使在冬季也要使用SPF8以上的防晒品。 <br />　　3.坚持每星期一次面部水分护理，提高肌肤含水度。土法也有用一个蛋黄加入一匙蜂蜜调匀，再加两滴橄榄油来润肤防皱。 <br />　　4.经常进行面部按摩。用食指、中指、无名指的指尖，从两颊下方向上推滑，反复6次。用拇指指尖和食指的第二指节，沿两颊下方向上推滑，反复6次。 <br />　　5.晚上12点以前睡觉。充足的睡眠对皮肤非常重要，晚上10点至凌晨2点是皮肤细胞新陈代谢最旺盛的时候，防皱品中的营养成分会得到最好的吸收。 <br />　　6.多吃富含碱性的食物，使血液呈弱碱性，减轻对皮肤侵蚀，包括绝大部分蔬菜、水、豆制品和海产品等；多吃富含胶原蛋白的食物，增加皮肤贮水功能，滋润皮肤，如猪皮、猪蹄、甲鱼等；多吃富含维生素A、C、E及微量元素铁、铜的食物。 <br />　　7.控制压力，培养运动习惯，使肌肤紧实红润有光泽。 <br />　　8.勿抽烟，少喝酒，养成良好生活习惯。 <br />　　 <br />　　对于最为敏感脆弱的眼部肌肤，我们也要给与特别的呵护： <br />　　1.每次清洁后涂上滋润眼霜，延缓皱纹和干纹的出现。 <br />　　2.每晚使用专为眼部而设计的眼霜外，最好每周敷1－2次眼膜。 <br />　　3.避免夸张的面部表情，或长时间眯起双眼看东西，外出遮阳戴太阳镜 <br />　　4.做眼部按摩，用少许按摩霜，以中指由眉心开始轻轻往外向下按压，顺着上下眼盖绕成一圆圈，重复做6次。 <br />　　 <br />　　 <br />　　 <br />　　问题九：眼袋就是下眼睑浮肿。这种现象很容易使男人显得苍老憔悴，给人臃肿的感觉。 <br />　　 <br />　　为什么会出现这些问题？ <br />　　1.皮层下组织中的体液积聚，造成肿胀。眼袋会随着年龄的增长而更加明显。 <br />　　2.常时间眼部肌肉紧张。因为工作紧张，眼部神经疲乏或老化，使得肌肉衰弱，累积脂肪，造成眼皮组织松弛现象。这种情况多出现在大城市办公室白领中。 <br />　　3.肾功能欠佳、怀孕期间、睡眠不足或疲劳。也会造成眼部体液堆积形成眼袋。 <br />　　 <br />　　如何解决这些问题？ <br />　　1.选择适合的眼部护理产品，收紧眼部肌肤。 <br />　　2.配合多做眼部按摩，帮助局部循环。用双手的大姆指按住太阳穴，然后用食指半弯形自内眼眶至外眼眶按摸，每天两次、每次100下；另外再用双手食指击打下眼袋100下。需注意力量一定要根据自己眼部的承受能力为宜。不但能去除下眼袋，而且能保持面部的肌肉活力。平时应避免随意牵拉下眼睑或将其向外过度伸展。 <br />　　3.保证充足睡眠。临睡前少喝水，并将枕头适当垫高，让容易堆积在眼睑部的水分通过血液循环而分散。 <br />　　4.清除体内毒素，早晨起床时喝一杯柠檬水，或少许柠檬榨汁，以一大杯温水稀释后喝下。 <br />　　5.上、下眼睑常有意识做闭合运动，每日最好坚持做100次以上，使眼睑肌有收缩与放松的感觉，延缓眼袋产生。 <br />　　6.多吃些胶体、优质蛋白、动物肝脏及番茄、土豆之类的食物，注意膳食平衡，可对眼部位组织细胞的新生提供必要的营养物质，对消除下眼袋非常有利。尽量减少吃太咸大辣的食物。</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/204651#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Tue, 17 Jun 2008 12:54:48 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/204651</link>
        <guid>http://tiantian911.javaeye.com/blog/204651</guid>
      </item>
      <item>
        <title>做软件外包就像农民种地一样</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/202465" style="color:red;">http://tiantian911.javaeye.com/blog/202465</a>&nbsp;
          发表时间: 2008年06月12日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p><span style="font-size: medium;"><span style="background-color: #ffffff;">中关
村软件园里，坐落着一幢带有玻璃幕墙的三层小楼。小楼的墙身上醒目地挂着&ldquo;PeopleSoft&rdquo;（仁科）的标志，不明就里的人很自然地以为这是又一家跨
国公司的中国分部。事实上，仁科的离岸研发中心就设在这里，只是目前归在&ldquo;文思创新软件技术有限公司&rdquo;的名下。2004年8月，软件外包企业文思与美国软
件巨头仁科签署协议，以B.O.T.（建设-经营-移交）的方式为仁科兴建中国研发中心。文思董事长兼CEO陈淑宁表示，研发中心建成并运行一段时间后，
将会以可观的价格&ldquo;卖&rdquo;给仁科。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">作为一家有着10年历史的民营软件外包企业，文思一直低调地&ldquo;埋头做事&rdquo;，不经意间， 
2004年的营业额达到了1亿元人民币，成为中国同行里的&ldquo;一线公司&rdquo;。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;"><strong>从程序员到老板</strong>
</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">1995年的时候，陈淑宁已经在长城计算机集团做了6年的程序员，正处于去留彷徨之际。IBM亚太区的一位高层人士找到他做OS/2中文版的协助测试工作，并建议他成立一家专门的公司。就这样，一个项目催生了一个公司的诞生。IBM也从此成为文思的长年业务伙伴。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">一位投资者给文思带来了30万元的合作协议，其中10万元作为天使投资，另外20万元作为&ldquo;过桥贷款（Bridge 
Loan）&rdquo;。协议规定，文思赢利后即刻偿还20万元，投资者占文思三分之一的股份。这是一个至今仍令陈淑宁津津乐道的协议，在当时，这种合作模式还是比较超前的。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">对于
10年前的陈淑宁而言，创业初期所能考虑的只是如何让公司生存下去。陈淑宁坦言自己当时对&ldquo;软件外包&rdquo;并没有概念，文思只是在为它惟一的客户IBM做一个
个软件项目。到了1997年底，文思的团队积累了一定的经验，建立起了严密组织的工作流程、严格的质量控制体系，锻炼了一批经验丰富的本地化开发队伍。随
着对软件外包业务的认识不断加深，陈淑宁重新给公司做了定位，文思成为一家专做软件外包的公司，它的客户名单里多了微软、SUN、Oracle、惠普、爱
普生、西门子的名字。与IBM的默契合作，是令其他海外企业关注文思的重要原因，微软方面的人士毫不讳言：&ldquo;IBM找你们做事情，肯定已经把你们培训好
了，所以微软会选择你们。&rdquo;</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">做了
老板的陈淑宁发现自己的工作并不轻松，创业以后相当长的一段时间里，他仍然要蹬自行车上班，当人手不足时也要亲自上阵写程序，甚至不得不&ldquo;节衣缩食&rdquo;来维
持公司运转。直到2000年，陈淑宁才开始给自己发工资。近几年来，他和他的团队工资年年递增，与之遥相辉映的是文思的业绩&mdash;&mdash;2002年业绩是1000
万元；2003年达到了3000万元；2004年更是突破1亿元人民币。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;"><strong>人才和资本</strong>
</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">&ldquo;外包企业中95%的员工是技术人员，而不像其他企业有很多销售和市场人员。&rdquo;陈淑宁说，&ldquo;公司业绩基本上可以按照人头计算，每个人年产值10万元-20万元人民币。&rdquo;</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">业内
人士普遍认为，人数多少决定着软件外包公司的规模和实力。目前文思拥有1000多名员工，然而在软件外包行业比较低迷的1997-1999年，陈淑宁不得
不反复向应聘者解释&ldquo;我的公司不是做软件产品外包装的&rdquo;。每年春节过后，陈淑宁都会站在办公室窗前&ldquo;期待&rdquo;员工的归来，冷冰冰的现实却是，大约一半的员工
选择不辞而别，因为在当时做软件外包被认为是没有前途的。自己做的事业甚至不能得到员工的认可，一度令陈淑宁心痛不已。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">软件
外包企业的主要成本是人力成本，企业要上规模，必须招募更多的员工。2003年以前的文思，一直处于&ldquo;小本经营&rdquo;的状态。不谙资本市场的陈淑宁奉行谨慎的
财务政策，用利润来扩大公司规模，引进员工，提高产能。企业的高速成长和市场需求的不断增大，开始让陈淑宁感受到资金方面的压力。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">对处
于起步阶段的中国企业来说，资金来源并不多。国内银行很少贷款给羽翼未丰的小公司，有组织的风险投资团体也不存在。于是陈淑宁决定寻求美国风险投资商的资
金，为了更好地对接海外资本，迎合美国投资者的需要，他重建了公司的管理团队，补充了COO、CFO、VP都是有着海外背景的&ldquo;海归&rdquo;，高管层本土派和海
归派的比例达到1:1。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">2004
年，陈淑宁率领他的管理团队对公司进行重组，继续推行&ldquo;国际化&rdquo;，大量引进外籍技术人员，来自印度、菲律宾、日本、韩国、美国的新员工占到员工总数的
10%。为了预防人才流失，文思推行了期权制度，凡是在公司工作达到一定时间的员工，将根据岗位和贡献获得不同比例的期权，</span>
</span>
<span style="font-size: medium;"><span style="background-color: #ffffff;">2005
年4月，曾投资前程无忧和中芯国际的美国DCM（Doll Capital
Management）联合联想控股给文思注入了1000万美元的风险资金。&ldquo;风险投资可以帮助改善公司的管理架构、提高能力和迅速扩大规模。&rdquo;陈淑宁对
待资本的态度较从前有了很大的转变，他认为风险投资的进入将使公司有机会在较短的时间内达到扩大规模的目的。文思在上海和武汉的分公司都是通过收购小公司
建立起来的。目前文思还在与几家软件外包企业洽谈并购，其中包括一家美国公司，陈淑宁希望它成为文思在美国的办事处。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">对于文思的发展历程，陈淑宁没有采用时间段的划分方式，而是以员工人数作为划分标志。按照他的标准，&ldquo;800人&rdquo;是一个坎，800人以下的公司需要解决生存问题，800人-2000人的公司面临发展问题。&ldquo;我们现在刚过了生死线，接下来是如何发展的问题。&rdquo;</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;"><strong>&ldquo;牛市&rdquo;的背后</strong>
</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">&ldquo;做
软件外包就像农民种地一样。&rdquo;陈淑宁感慨道。软件外包业务的技术门槛并不高，是规模经济，由于中国具有低成本优势，且近几年中国软件人才不断增加，因而吸
引了不少国外企业。&ldquo;中国加入WTO以后，欧美国家不希望印度成为其惟一软件外包国家，这给了中国软件外包业很好的发展机会。&rdquo;业内资深人士、联合创新总
经理冯嵘分析国内软件外包业近几年快速成长的原因。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">然而，在中国软件外包行业一片繁荣的背后，还存在着一些隐忧。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">目前，全球最大的软件外包出口国家主要是面向美国的印度，以及面向西欧的爱尔兰。中国虽然发展速度很快，但只占全球软件外包市场3%左右的份额。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">对中
国软件外包企业来说，最大的困扰就是规模。据不完全统计，在国内500人以上的软件外包企业不到20家，国内最大的软件外包企业东软集团也仅仅达到
6000人的规模。根据国际上一些大型外包项目的操作经验，一般达到3500-4000人的规模才能够拿到大项目。对于印度软件企业动辄上万人的规模，陈
淑宁表露了自己的担忧。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">作为
国内少数几家获得风险投资的外包企业，中国最大的对美外包公司，陈淑宁并不掩饰对纳斯达克的向往。他计划先通过收购把公司规模做起来，&ldquo;做大&rdquo;以后再上
市。步入文思的办公区，你会发现他们的会议室全部以硅谷的城镇命名。办公区的主色调是蓝和灰&mdash;&mdash;微软的蓝，IBM的灰，这是陈淑宁在装修时就定下的色调。
对于文思，它们既是客户，也是榜样。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">目前国内排名前几位的专业软件外包公司，如中讯软件、文思创新、博彦科技，他们的背景极为相似，都是1993年-1995年创业成立的民营企业，在这一领域已经历了至少10年的历练。而入行不久的小公司大多举步维艰，它们成了文思下一步大举兼并的对象。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">就在采访结束的时候，文思的一位副总送来了一份收购协议，陈淑宁熟练地签上了自己的名字，一家名为&ldquo;联信永益&rdquo;的小公司就这样被文思收入囊中。陈淑宁很认真地说，当时机成熟的时候，他会收购一家印度的软件企业，&ldquo;他们的员工都说英语，便于和美方沟通&rdquo;。</span>
</span>
</p>
<p><span style="font-size: medium;"><span style="background-color: #ffffff;">来源：中国企业家</span>
</span>
</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/202465#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Thu, 12 Jun 2008 13:23:32 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/202465</link>
        <guid>http://tiantian911.javaeye.com/blog/202465</guid>
      </item>
      <item>
        <title>图书馆角落-纪念我的第一个一年计划~</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/196426" style="color:red;">http://tiantian911.javaeye.com/blog/196426</a>&nbsp;
          发表时间: 2008年05月24日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>好几天都没有更新博客了，工作的时候回来就很晚了，完全没有力气在电脑前打字，不上班的日子又放松的不行，也不会写，也就只有今天这样，很闲很无聊的日子，才会来这里吧。</p>
<p>最近北京真是热的离谱，弄得我都特别烦躁，跟更年期似的，好多事儿都挺烦的，抽烟！</p>
<p>&nbsp;</p>
<p>前些天突发奇想制定了我的第一个一年计划，呵呵，一定要成功，为了我打赌的500yuan也要。</p>
<p>想订sodaGreen的615演唱会跟她一起去，还没回我消息。</p>
<p>&nbsp;</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/196426#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 24 May 2008 20:06:20 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/196426</link>
        <guid>http://tiantian911.javaeye.com/blog/196426</guid>
      </item>
      <item>
        <title>RePast笔记</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/193249" style="color:red;">http://tiantian911.javaeye.com/blog/193249</a>&nbsp;
          发表时间: 2008年05月15日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>&nbsp;</p>
<p><br />REPAST-Recursive Porous Agent Simulation Toolkit </p>
<p>agent-based modeling<br />Douglas Samuelson and Charles Macal, "Agent-based Simulation Comes of Age," OR/MS Today, Vol. 33, Number 4, pp. 34-38, Lionheart Publishing, Marietta, GA, USA (August 2006). </p>
<p>agent based modeling and simulation</p>
<p>运行仿真：gui：<br />java -jar c:\repast\lib\repast.jar<br />或者：command-line：<br />java -cp path_to_your_model;c:/repast/lib/repast.jar uchicago.src.sim.engine.SimInit fullyQualifiedModelName<br />eg：</p>
<p>java -cp c:/repast/demo/bugs/bugs.jar;c:/repast/lib/repast.jar uchicago.src.sim.engine.SimInit uchicago.src.sim.heatBugs.HeatBugsModel<br />加载参数文件：<br />java -cp c:/repast/demo/bugs/bugs.jar;c:/repast/lib/repast.jar uchicago.src.sim.engine.SimInit uchicago.src.sim.heatBugs.HeatBugsModel c:\params\bugs.pf</p>
<p>1.parameter必须是getInitParam返回的String[]中的<br />2.必须有accessor</p>
<p>runs正在batch模式下表示多少次？</p>
<p>multi-keywords：start end incr iterator<br />single-keywords：set 是numerical <br />&nbsp;set_list<br />&nbsp;set_boolean<br />&nbsp;set_string<br />&nbsp;set_boolean_list<br />&nbsp;set_boolean_string_list<br />可以嵌套nested</p>
<p>runs: 1<br />Food {<br />&nbsp;start: 10<br />&nbsp;end: 30<br />&nbsp;incr: 10<br />&nbsp;{<br />&nbsp;&nbsp; runs: 10<br />&nbsp;&nbsp; MaxAge {<br />&nbsp;&nbsp;&nbsp;&nbsp; start: 0<br />&nbsp;&nbsp;&nbsp;&nbsp; end: 40<br />&nbsp;&nbsp;&nbsp;&nbsp; incr: 1<br />&nbsp;&nbsp; }<br />&nbsp;}<br />}</p>
<p>&nbsp;</p>
<p>list是这样的：<br />set_list: 1.2 3 10 12 84</p>
<p><br />simple model：</p>
<p><br />2步：<br />1st.setup preparing<br />2nd.actual running</p>
<p>如果是两个player的囚徒困境。setup阶段就是创建两个player，提供初始状态，比较tit-for-tat，每一次选择依赖与stragtegy和上一个tick。</p>
<p>SimpleModel：extends SimpleModel：</p>
<p>setup(),teardowm()<br />buildModel()<br />preStep()-&gt;step()-&gt;postStep()</p>
<p><br />&nbsp; public void step() {<br />&nbsp;&nbsp;&nbsp; int size = agentList.size();<br />&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; size; i++) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Player p = (Player)agentList.get(i);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.play();<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp; }</p>
<p><br />step每一步做的事情</p>
<p>投票算法中就要用到preStep和postStep</p>
<p>自动的step机制迭代所有的agent调用他们自身的step方法。agent必须实现Stepable接口，这个接口只有step()方法，更复杂的通过schedule来实现。</p>
<p><br />When the setup button is clicked, the code in the setup() method is executed. When the initialize button is clicked, the code in buildModel() is executed. When the step button is clicked, the code in buildModel() is executed and the preStep(), step(), and postStep() sequence is executed once. When the start button is clicked, buildModel() is executed, and the preStep(), step(), and postStep() sequence is executed repeatedly until the user clicks the stop or pause button.</p>
<p>&nbsp;</p>
<p>no knobs to twiddle-using parameters</p>
<p>使用accessor，例如：</p>
<p>public void setP1Strategy(int val) {<br />&nbsp;&nbsp;&nbsp; p1Strategy = val;<br />&nbsp; }</p>
<p>&nbsp; public int getP1Strategy() {<br />&nbsp;&nbsp;&nbsp; return p1Strategy;<br />&nbsp; }</p>
<p>public MyModel() {<br />&nbsp;&nbsp;&nbsp; params = new String[] {"P1Strategy"};<br />&nbsp; }</p>
<p>是model能够aware到参数。</p>
<p>public MyModel() {<br />&nbsp;&nbsp;&nbsp; name = "Example Model";<br />&nbsp; }<br />来命名一个model</p>
<p>&nbsp;</p>
<p><br />setStoppingTime(long time) can be used set the time step at which the current simulation run will stop. <br />setRngSeed(long seed) can be used to set the seed for the default random number generator. Note that the seed defaults to 1. <br />getNextIntFromTo(int from, int to) returns the next random integer between from and to, inclusive of from and to. <br />getNextDoubleFromTo(double from, double to) returns the next random double between from and to, exclusive of from and to. <br />atPause() the body of this method will be executed whenever your simulation is paused. You'll need to override this method. <br />atEnd() the body of this method will be executed whenever your simulation ends. You'll need to override this method. </p>
<p><br />build a display？</p>
<p>private DisplaySurface dsurf;</p>
<p>&nbsp; ...</p>
<p>&nbsp; private void buildDisplay() {<br />&nbsp;&nbsp;&nbsp; ...<br />&nbsp; }</p>
<p>&nbsp; public void buildModel() {<br />&nbsp;&nbsp;&nbsp; ...<br />&nbsp;&nbsp;&nbsp; buildDisplay();<br />&nbsp; }</p>
<p>batch-run：整个过程不需要人为的参与，仿真的过程可以自动的进行。<br />non-batch-run:人为的参与到整个过程中，中间可以图形化的显示和操作agent的状态。<br />每种类型至少有两个类，model和agent</p>
<p><br />Repast provides an abstract class SimModelImpl that partialy implements this interface and it is expected that most if not all models will extend this class.</p>
<p><br />space：作为agent的容器。</p>
<p><br />social network：</p>
<p>node，edge</p>
<p>edgeFactory<br />每个节点都是一个node</p>
<p><br />BasicAction </p>
<p>Scheduling BasicActions for execution is done via the Schedule object. It allows you to schedule actions to occur every tick beginning at some specified tick, once at some specified tick, at intervals, at a pause in the simulation, and at the end of the simulation. (A tick is a single iteration over all the BasicActions scheduled for execution at that time.) </p>
<p>schedule：每一定的间隔就发生，暂停时发生，模拟结束的时候发生。</p>
<p><br />dataRecoder:record data from a variety of sources and write that data out in tabular format to a file</p>
<p>recorder = new DataRecorder("./data.txt", this, "A Comment");&nbsp; //header comment~头注释<br />第二个参数是与他关联的model的引用，这里在model的内部，所以可以用this<br />recoder会从数据源记录数据当收到record()消息时。</p>
<p>包裹在NumericDataSouce和DataSource中才可以被dataRecoder所接受。</p>
<p><br />3 kinds of property descriptors：<br />boolean-checkbox<br />properties-list<br />numerical-textbox</p>
<p><br />A BooleanPropertyDescriptor is typically setup in a model's constructor as follows: </p>
<p>BooleanPropertyDescriptor bd1 = new BooleanPropertyDescriptor("RecordData", false);<br />descriptors.put("RecordData", bd1);</p>
<p>&nbsp;</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/193249#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Thu, 15 May 2008 12:59:27 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/193249</link>
        <guid>http://tiantian911.javaeye.com/blog/193249</guid>
      </item>
      <item>
        <title>Bless</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/192773" style="color:red;">http://tiantian911.javaeye.com/blog/192773</a>&nbsp;
          发表时间: 2008年05月14日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>今天一天一直在关注地震的事儿，看了好多灾区的图片，真难受，捐了些钱，实在微不足道，希望他们都能平安，死亡数字再也不要涨了。</p>
<p>论坛里为了捐钱的事儿竟然吵了起来，sb的人都能把好事办成坏事，真tmd，晕死我了，就好像他组织捐款他就高尚了，别人没组织提问题就是泼冷水不想出力，我tmd真受不了这个，又不好出来喷他，学院太小，都抬头不见低头见的，还逼着别人认错，tmd，只能写在这发泄发泄，真想问问他，去了那个垃圾日公司就不知道自己姓什么了吧？真想告诉他，其实日公司是很一般的公司，你的周围有很多在比日好的多公司工作的同学，拜托您低调一点好么，要说nb，你还是不够。</p>
<p>bless</p>
<p>&nbsp;</p>
<p>明天又上班，呵呵。</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/192773#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 14 May 2008 00:54:54 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/192773</link>
        <guid>http://tiantian911.javaeye.com/blog/192773</guid>
      </item>
      <item>
        <title>MDA-ZZ</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/191782" style="color:red;">http://tiantian911.javaeye.com/blog/191782</a>&nbsp;
          发表时间: 2008年05月10日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>&nbsp;&nbsp; MDA(Model Driven Architecture)是模型驱动架构，它是由OMG定义的一个软件开发框架。它是一种基于UML以及其他工业标准的框架，支持软件设计和模型的可视化、存储和交换。和UML相比，MDA能够创建出机器可读和高度抽象的模型，这些模型独立于实现技术，以标准化的方式储存。MDA把建模语言用作一种编程语言而不仅仅是设计语言。MDA的关键之处是模型在软件开发中扮演了非常重要的角色。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA源自于众所周知的把系统操作的规范从系统利用底层平台能力的方式细节中分离出来的思想，MDA提供了一种途径（通过相关的工具）来规范化一个平台独立的系统、规范化平台、为系统选择一个特定的实现平台，并且把系统规范转换到特定的实现平台。MDA的三个主要目标是：通过架构性的分离来实现轻便性、互操作性和可重用性。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 模型驱动架构（MDA）是OMG组织近年来一直热炒的一个新的技术体系，同时也是众多搞软件模型研究人员的一个新热点。MDA（模型驱动）核心的思路是希望通过对商业模型（比如企业信息化或建筑领域的解决方案）的领域研究。进而提炼出一个相对核心的领域模型，同时抽象出一个PIM（平台无关模型）。之后根据不同的开发平台（例如.net或J2EE），应用平台（windows或unix）形成相应的 PSM（平台相关模型）。依照相应的工具，例如 ArcStyler可以完整地生成相应的代码和软件系统。当然这里只是罗列出一个大致的思路和方法。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 MDA理论还处在一个探索期，很多理论和方法并不成熟，当然无从谈起有成熟的工具，从目前的趋势而言，从理论到实际的工具都离OMG组织所提出的预想有较大距离，至少还需要数年的努力才能成型 。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2目前无论是国外的开源组织还是国内的一些组织对MDA都只是处在一个草创阶段，很多人所谓的应用MDA 其实都只是在MDA的体系中作一个最初的探索和尝试。例如 ORM就是在一定层次上实现MDA 在数据库应用方面的探索，但也只是解决了一个实体模型映射的问题。前几天一个面试人员用 ArcStyler4.X 做了一个银行POS系统的应用模型，生成了一点还需要修改的框架代码。就告诉我说他已经掌握了 MDA，斯等水准真是让我汗颜！佩服！</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 MDA的第一个热点可能是桥接器，而在MDA领域中，映射是个很重要的点，而转换和交互都只是在这个点上的延伸 。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4 目前而言，最有可能在MDA体系中得以实现的语言是 JAVA，尽管我很讨厌JAVA的一些愚蠢方法。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5 MDA的核心是PIM，因为他是最抽象和协同性最高的。同时就当前形势而言，PIM也是一个瓶颈！同时就目前的 UML2.0（从OMG那里得到最新的）而言，还不足以作为建立整个MDA体系的语言。同时对于MOF中的一些定义似乎还有提升的必要。因为对于整个体系而言，MOF应该更多的作为一个标准，只有在标准成熟的前提下，才有可能产生正确的映射规则。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6 等到MDA风光无限的那天，会使一部分程序员失业，但不会是全部，起码MDA工具要有人做，因为一个MDA工具不足以应付所有的领域。这就好比没有一个财务系统能适应所有的企业一样。因为各个领域的标准化不同。</p>
<p>一、MDA（模型驱动架构）背景</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA目前在以下领域得到了应用： </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *银行业 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *保险业 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *公共企业(特别在金融管理领域) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *嵌入式系统 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *后勤保障系统 </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 您将会看到，MDA确在其中起到了作用。 </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA的流程<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA的实现主要集中在以下3个步骤： </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 首先，您用UML对您的应用领域进行高度抽象的建模，这个模型和实现它的技术（或者底层技术）完全没有关系。这个模型我们称之为平台无关模型(PIM)。 </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 然后，PIM将被转换为一个或多个平台相关模型(PSM)。这个翻译的过程一般是自动实现的。PSM将用一个特定的实现技术来描述您的系统。它将用到这种技术所提供的种种架构，比如EJB, 数据库模型，COM组件等等。 </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 最后，PSM将被翻译成源代码。因为每个PSM已经完全依靠某种特定的技术，这个步骤一般是比较简单的。 </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA流程中最难的一步，是从PIM生成一个PSM。它要求您对您要应用的基础技术具有丰富且巩固的知识，另一方面，源模型(PIM)必须具备自动生成PSM所要求的足够信息量。 </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 通过模板生成：MDA-light?! </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 在MDA的实际应用当中，一个较容易的实现是通过模板(我们称之为MDA-light)。这样，平台相关模型这一步可以说是被跳过了，您可以直接从高度抽象的PIM生成源代码。您将继续在MDA-light的基础上进行真正意义的编程：您必须在源代码，而不是UML，编写细致的应用逻辑。 </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 使用MDA的前提</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 业界(甚至是整个世界)一个被广泛接受的事实是：只有变化是永恒的。技术永远在革新。这在中间件领域尤其明显，当然还有数据库技术，操作系统，甚至是编程语言都经常变化。这些技术明显比应用领域的基本概念要变化的快。 </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 如果您在某一特定的应用领域工作，在这个领域中的项目都具有一定的相似性。整个应用程序族或者不同的项目都属于同一个应用领域，那么，MDA或者生成流程将特别适合于您 <br />。 </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA的优点</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 您对建模的投资将更加持久的有效--远长于您目前实现它所应用的技术。这将更有利于保护您的投资。 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 您具有了技术上的灵活性。 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 您将不再受技术或应用所具有的不同变化周期的影响--在MDA的帮助下，您可以中立的保持两方面的多样性。 </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA的缺点</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * MDA意味着更多的"组装"而不是"开发"--在为一个应用建立PIM的时候，您基本上没有技术上的周旋空间。这对于今天的很多开发人员来说，还是难以想象的。 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 软件开发的创造性在一定程度上减弱了。开发人员常常觉得，就一种新技术展开争论，在技术的前沿工作，是十分吸引人的。可是在MDA流程下，大量的工作是建立模型，这和具体的技术相距甚远，但符合OMG的建议。 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 潜在的不成熟性。UML2.0还在幼年时代。MDA工具出现的时间也相对很短。这里还隐藏了很多风险。 </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA流程和生成开发中有待解决的问题</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 数据和应用程序的移植：目前在商业领域经常需要面对的问题是，大量的数据和应用程序如何向新的，MDA为基础的系统中移植。纯粹的MDA流程将把数据模型和数据库表结构看成是技术细节。它们不应该对平台无关模型(PIM)层产生任何影响--那么，您的MDA工具或生成器也负责生成数据库脚本吗？ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 软件维护：编制不同的发行版本，补丁或者升级，是对目前正在运行的程序进行维护的重要组成部分。MDA怎么处理这些问题呢？每次进行一次全新的安装？ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 投资报酬率(Return-on-Investment)：从什么样的环境和系统开始计算？从应用MDA的第二个项目？还是从第五个开始？ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 购买软件架构还是自主开发？ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 生成器和相关工具造成了对其生产商的依赖--这种对生产商的依赖是我们以往一直极力避免的。 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 企业应用整合(EAI)：高度的抽象，听起来不错--但是对于已经在运转的应用系统，怎么得到这种抽象呢？ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 您可以看到--潜在很多实际问题（其回答都具有重要的意义）。这些问题正是我们创立openMDA的原因：在很多项目当中，某些以上的问题已经得到了实验性的回答，您（和我们）都将从中获益！ </p>
<p>二、MDA的软件开发周期</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在MDA中软件开发过程是由软件系统的建模行为驱动的。下面是MDA的软件开发周期：</p>
<p>&nbsp;</p>
<p><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA生命周期和传统生命周期没有大的不同，主要的区别在于开发过程创建的工件，包括PIM（Platform Independent Model，平台无关模型）、PSM（Platform specific Model，平台相关模型）和代码。PIM是具有高抽象层次、独立任何实现技术的模型。PIM被转换为一个或多个PSM。PSM是为某种特定实现技术量身定做。例如，EJB PSM是用EJB结构表达的系统模型。开发的最后一步是把每个PSM变化为代码， PSM同应用技术密切相关。传统的开发过程从模型到模型的变换，或者从模型到代码的变换是手工完成的。但是MDA的变换都是由工具自动完成的。从PIM到PSM，再从PSM到代码都可以由工具实现。PIM, PSM,和Code 模型被作为软件开发生命周期中的设计工件，在传统的开发方式中是文档和图表。重要的是，它们代表了对系统不同层次的抽象，从不同的视角来看待我们的系统，将高层次的PIM 转换到PSM 的能力提升了抽象的层次。能够使得开发人员更加清晰地了解系统的整个架构，而不会被具体的实现技术所&ldquo;污染&rdquo;，同时对于复杂系统，也减少了开发人员的工作量。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA的出现，为提高软件开发效率，增强软件的可移植性、协同工作能力和可维护性，以及文档编制的便利性指明了解决之道。MDA被面向对象技术界预言为未来两年里最重要的方法学。当今建模的主要问题在于，对于很多企业来说它只是纸面上的练习。这就造成了模型和代码不同步的问题，代码会被不断修改，而模型不会被更新，这样模型就失去了意义。弥补建模和开发之间的鸿沟的关键就在于将建模变为开发的一个必不可少的部分。MDA 是模型驱动开发的框架，MDA 的愿景是定义一种描述和创建系统的新的途径。MDA 使得UML 的用途走得更远，而不仅仅是美丽的图画。很多专家预言MDA 有可能会带领我们进入软件开发的另一个黄金时代。</p>
<p>&nbsp;</p>
<p>三、MDA框架</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA 将软件系统的模型分离为平台无关模型PIM 和特定平台模型PSM，同时又能通过转换规则将它们统一起来，以这样的方式试图去摆脱需求变更所带来的困境。平台无关模型PIM 是对系统高层次的抽象，其中不包括任何与实现技术相关的信息；特定平台模型PSM是特定平台相关的模型。在MDA 框架中，首先使用平台无关的建模语言来搭建平台无关的模型PIM，然后根据特定平台和实现语言的映射规则，将PIM 转换以生成平台相关的模型PSM，最终生成应用程序代码和测试框架。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA框架的&ldquo;建筑材料&rdquo;包括：高层次模型；一种或多种标准、精确定义的语言，用来编写高层次模型；如何把PIM变换到PSM的定义；编写这些定义的语言，这种语言能够被变换工具执行；能够执行变换定义的工具；能够执行PSM到代码的变换工具。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 上图是MDA的框架，它的主要元素有模型、PIM、PSM、语言、变换、变换定义、以及变换工具。MDA 是一个开放的，中立于软件供应商的架构，它广阔地支持不同的应用领域和技术平台，能够成为应用领域和具体技术平台之间的杠杆。在MDA 开发途径中，PIM 代表对需求的建模，PSM 代表应用具体技术后的模型，这使得MDA 成为需求和技术之间的杠杆；它们各自的改变都可以是相互独立的，不会造成商业逻辑和实现技术的紧密藕合，同时MDA 又可以通过转换来弥补它们之间的鸿沟，从而保护我们的投资。MDA 开发途径使得我们的系统能够灵活地被实现、集成、维护和测试，系统的轻便性、互操作性和可重用性都是可以长期保持的，能够应对未来的变化。</p>
<p>四、MDA的现状</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MDA 还处在一个发展的过程中，MDA还在不断的演进。虽然MDA正朝气蓬勃地走来，但是人们也能看出它所存在的问题。MDA最大的好处就是业务模型的持久价值，但是付出的代价是增加了抽象层，而目前看来，层之间的转换并不是我们所期待的那样顺畅，至少，从PIM到PSM，从PSM到代码，这个实现的过程要远比从3GL生成机器代码来得困难。在建模技术方面，UML正在暴露其固有的缺陷，它需要扩展更多的机制来支持精确建模和分析模型，虽然目前OCL为精确建模提供了一定的支持，但是这种支持距离可执行模型的理想还很遥远。回顾MDA的历史，我们可以看出UML的巨大成功为MDA的产生奠定了坚实的基础，同时也感觉到：在由软件工艺到软件工程的漫漫长路中，MDA只不过是向前迈进了一小步，但却给整个软件业掀起了一场波澜，它在模型定义、开发过程等诸多方面都将对未来IT技术产生深远的影响。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 目前在MDA开发工具市场上的情形是：由于从PIM 到PSM转换方法的标准化尚未完成，IBM、Borland等大型厂商大都持谨慎态度，虽然也纷纷在他们的开发工具中提供部分的MDA功能，但并没有完全遵循OMG定义的MDA规范。虽然如此，IBM除了在Rational中增加MDA功能之外，在开源项目Eclipse中，也提出了EMF（Eclipse Modeling Framework）这一创新的MDA代码生成系统项目，由此可见IBM对MDA这一发展中的技术的重视程度。Borland公司宣称他们也在关注MDA技术，并且准备在Together中配置基于MDA的模型自动生成功能。相对于业界大厂的冷静和矜持，一些中小厂商反而特别活跃，像Interactive Objects公司著名的ArcStyler、Compuware公司著名的OptimalJ，还有开放源码的AndroMDA等遵循OMG标准规范的MDA工具已在一些项目中得到了广泛的运用，并取得了显著的成效。</p>
<p>五、MDA的相关标准</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 为了实现MDA这一宏大构想，OMG制定了一系列的标准：</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UML：UML被MDA用来描述各种模型。它并不是为MDA而生，但是作为目前最为风行的建模语言，UML已经占据了全球建模语言领域90％的市场份额，成为了建模语言事实上的标准，因此OMG将它作为MDA技术的基础是自然而然的明智选择。它是MDA的基础，也是MDA最有力的武器。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MOF：MOF（Meta Object Facility 元对象机制）是比UML更高层次的抽象，它的目的是为了描述UML的扩展或者其它未来可能出现的类UML的建模语言。虽然MOF也不是为MDA而生的，但是我们可以体味到OMG的工程师们良苦的用心和长远的目光。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XMI：XMI（XML-based metadata Interchange）是基于XML的元数据交换。它通过标准化的XML文档格式和DTDs（Document Type Definitions）为各种模型定义了一种基于XML的数据交换格式。这使得作为最终产品的模型可以在各种不同的工具中传递，这一点是非常重要的，它保证了MDA不会在打破了一种束缚之后再被加上一层新的束缚。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CWM：CWM（Common Warehouse Metamodel 公共仓库元模型）提供了一种数据格式变换的手段，在任意级别的模型上都可以使用CWM来描述两种数据模型之间的映射规则，比如将数据实体从关系数据库变换为XML格式。在MOF的框架下，CWM使得通用的数据模型变换引擎成为可能。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在OMG的蓝图中，UML、MOF、XMI、CWM等一系列标准分别解决了MDA的模型建立、模型扩展、模型交换、模型变换这几个方面的问题。OMG试图通过标准化的定义，扩大MDA的应用范围。同时通过这样一个可扩展的建模语言环境，IT厂商可以自由实现自己的建模语言，以及语言到可执行代码的映射，然而不管怎么样，都必须处于OMG的标准化框架之下。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/191782#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 10 May 2008 20:20:14 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/191782</link>
        <guid>http://tiantian911.javaeye.com/blog/191782</guid>
      </item>
      <item>
        <title>凌晨写博客</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/190808" style="color:red;">http://tiantian911.javaeye.com/blog/190808</a>&nbsp;
          发表时间: 2008年05月08日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>明天去ir面试了，今天的几个同学去ir有喜有忧，再次印证了上次跟某萍同学得到的结论，呵呵，最近受双子座普遍低迷的大趋势影响，加上自身的努力不足，导致气场衰弱，浑身散发黑气，估计明天又被鄙视了，算了，爷我都看开了，只要有人要我就行了。</p>
<p>今天爸爸打来电话问问我工作的事，我很欣慰。</p>
<p>下午的erp课很无聊，lhp美女虽然美，但是总归讲课太差，听得我烦死了，只一会儿就走了，出了教室就轻松多了，没想到，不尊敬老师是要遭到报应的！不过，这个报应也来的太快一点了吧，下午讲的是scm木有听，接到ir的面试电话，恍然间发现明天竟然面试scm的小组的intern，天哪，还有更巧合的事情么。于是匆匆的补了点scm的东西，虽然很零碎，但是勉勉强强知道scm是什么了= =||，哎，资质太低，木有办法。</p>
<p>&nbsp;</p>
<p>洗完澡就开始看看java，复习了一下，还好，每次面试貌似都能学到些东西，因为这次看，发现好多都已经会了，好吧，我也在面试中学习，在挫折中成长，最后再让我在offer中辉煌好了。</p>
<p>昨天晚上的文章，没上blog首页，没贴到bbs，为什么还有16人次的浏览呢，这是为什么呢。</p>
<p>&nbsp;</p>
<p>睡去了，明天还得长途跋涉去软件园，好吧，让我万里迢迢接受大家的鄙视吧。</p>
<p>&nbsp;</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/190808#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Thu, 08 May 2008 00:43:47 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/190808</link>
        <guid>http://tiantian911.javaeye.com/blog/190808</guid>
      </item>
      <item>
        <title>只许你大步的向前走</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/190435" style="color:red;">http://tiantian911.javaeye.com/blog/190435</a>&nbsp;
          发表时间: 2008年05月07日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>借用许飞的一句歌词，这几天把《恰许同学年少》这张听了n遍，真该买正z版，实在是太不好意思了，虽然名字拗口，虽然出身超女，但是绝对是值得一听，再听，再听的一张。</p>
<p>下午受到i公司的邮件，说要安排二面，招个intern也要二面，要是有三面四面就天理难容了，呵呵，管他呢。今天还是没给s公司打电话，哎，我是怎么了。</p>
<p>今天和明天都有同学去i公司面试，不过都是r的，牛。</p>
<p>psp死机了，汗，拔电池，又充电。</p>
<p>&nbsp;</p>
<p>明天早上起来就洗澡，然后换衣服去上erp的无聊课，然后继续做gc的作业，这两天写的很有心得，中间穿插tij4，顺便看看LG老师的课件，呵呵，估计i r的面试也不远了，别给师兄师姐丢脸啊。</p>
<p>《陪我唱歌》估计去不了了，没找到一起去的人，下次去taipei小巨蛋吧，呵呵。</p>
<p>这两天idsl都被冷落了，禽兽森林好久没去了，也不知道柯柯怎么样了，还有小狐狸，其他的小动物就算了~</p>
<p>点根烟，接着写。</p>
<p>blue path也投了5个职位，3个cdl，1一个crl，一个gts，三个cdl的都是java ee的开发，好容易挑了3个最简单的，其他的要求太高了，又是c++，又是soa，又是web services，又是什么什么的，觉得自己差的太多了，frank开学的时候问我的问题，现在遇到挫折的时候很总是回想起，总是质疑自己的选择，或许他说的对，记得当时我还自信满满的，听许飞的《吉林到北京》，很有同感，&ldquo;只许你大步的向前走&rdquo;~</p>
<p>r的职位我是想去的，虽然嘴里说谁给钱多就给谁干活，可是还是想做点research的，至少是能做点有点意义的东西，虽然要求很高，可还是想争取，希望能有机会。</p>
<p>gts的好像是mainframe的开发，去试试。</p>
<p>今天她问我，最近是不是不开心，我说，没什么，还好。</p>
<p>&nbsp;</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/190435#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 07 May 2008 01:14:17 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/190435</link>
        <guid>http://tiantian911.javaeye.com/blog/190435</guid>
      </item>
      <item>
        <title>对酒当歌，人生几何</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/189955" style="color:red;">http://tiantian911.javaeye.com/blog/189955</a>&nbsp;
          发表时间: 2008年05月05日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>忙碌的一天，提交了两个作业，另一个作业也完成了大半，话说用java还真是比c sharp效率高很多，当然是对我来说了。</p>
<p>退了一个面试，一点也不后悔，这些天总被考，都倦了，每次都没有一个好的结果，每次都失败的莫名其妙。</p>
<p>&nbsp;</p>
<p>明天soc还有一个报告，临近期末，事儿突然多了起来。</p>
<p>记得给s公司打一个电话道歉，呵呵。</p>
<p>还有，准备一下i公司的面试，这次是师兄推荐的，还有个美女师姐，不能让他们为难，鄙视一下自己。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/189955#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 05 May 2008 23:09:25 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/189955</link>
        <guid>http://tiantian911.javaeye.com/blog/189955</guid>
      </item>
      <item>
        <title>java socket-message-作业慢慢写~今天就到这</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/189522" style="color:red;">http://tiantian911.javaeye.com/blog/189522</a>&nbsp;
          发表时间: 2008年05月04日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <pre name="code" class="java">package org.tiantian.message.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
	private int port;

	public Server(int listenPort) {
		this.port = listenPort;
	}

	public void handleConnection(Socket connectionToHandle) {
		new Thread(new ConnectionHandler(connectionToHandle)).start();
	}

	public void acceptConnections() {
		try {
			ServerSocket server = new ServerSocket(port, 100);
			Socket incomingConnection = null;
			while (true) {
				incomingConnection = server.accept();
				handleConnection(incomingConnection);
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		System.out.println("Server start.");
		Server s= new Server(25000);
		s.acceptConnections();
		
	}
}
</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<pre name="code" class="java">package org.tiantian.message.server;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

public class ConnectionHandler implements Runnable {
	protected Socket toHandle;

	public ConnectionHandler(Socket s) {
		this.toHandle = s;
		try {
			PrintWriter streamWriter = new PrintWriter(toHandle
					.getOutputStream());
			BufferedReader streamReader = new BufferedReader(
					new InputStreamReader(toHandle.getInputStream()));
			streamWriter.println("OK from server.");
			System.out.println(streamReader.readLine());
			streamWriter.close();
			streamReader.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	@Override
	public void run() {

	}

}
</pre>
<p>&nbsp;</p>
<pre name="code" class="java">package org.tiantian.message.client;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;

public class Client {
	protected BufferedReader socketReader;
	protected PrintWriter socketWriter;
	protected String hostIp;
	protected int hostPort;

	public Client(String hostIp, int hostPort) {
		super();
		this.hostIp = hostIp;
		this.hostPort = hostPort;
	}

	public void setUpConnection() {
		try {
			Socket client = new Socket(hostIp, hostPort);
			socketReader = new BufferedReader(new InputStreamReader(client
					.getInputStream()));
			socketWriter = new PrintWriter(client.getOutputStream());
		} catch (UnknownHostException e) {
			System.out
					.println("Error1 setting up socket connection: unknown host at "
							+ hostIp + ":" + hostPort);
		} catch (IOException e) {
			System.out.println("Error2 setting up socket connection: " + e);
		}
	}

	public void tearDownConnection() {
		try {
			socketWriter.close();
			socketReader.close();
		} catch (IOException e) {
			System.out.println("Error tearing down socket connection: " + e);
		}
	}

	public void talk() {
		StringBuffer sb = new StringBuffer();
		try {
			socketWriter.println("Hi,I'm client.");
			socketWriter.flush();
			String line = null;
			while ((line = socketReader.readLine()) != null)
				sb.append(line + "\n");
			System.out.println(sb.toString());
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	public static void main(String[] args) {
		Client c = new Client("127.0.0.1", 25000);
		c.setUpConnection();
		c.talk();
		c.tearDownConnection();
	}

}
</pre>
<p>&nbsp;作业慢慢写~今天就到这~</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/189522#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sun, 04 May 2008 21:10:57 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/189522</link>
        <guid>http://tiantian911.javaeye.com/blog/189522</guid>
      </item>
      <item>
        <title>Html解析生成纯文本-使用SAX以及htmlcleaner</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/185225" style="color:red;">http://tiantian911.javaeye.com/blog/185225</a>&nbsp;
          发表时间: 2008年04月22日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <pre name="code" class="java">package testlucene;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
import org.htmlcleaner.HtmlCleaner;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;

public class SAXxhtml extends DefaultHandler {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(SAXxhtml.class);

	public StringBuffer sb = new StringBuffer();
	public boolean usable = true;
	private String sPath = &quot;&quot;;

	public SAXxhtml() {
		super();
		// TODO Auto-generated constructor stub
		// PropertyConfigurator.configure(&quot;log4j.properties&quot;);
		BasicConfigurator.configure();
	}

	public void startElement(String namespaceURI, String localName,
			String rawName, Attributes atts) throws SAXException {
		if (rawName.equals(&quot;style&quot;) || rawName.equals(&quot;script&quot;)) {
			usable = false;
		}

	}

	// 解析完成后的统计工作
	public void endDocument() throws SAXException {
		try {
			PrintWriter pw = new PrintWriter(new FileOutputStream(sPath));
			pw.print(sb.toString());
			pw.flush();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void characters(char[] ch, int start, int length) {
		String charEncontered = new String(ch, start, length);
		/*
		 * if (!charEncontered.startsWith(&quot;&lt;!&quot;)||!charEncontered.startsWith(&quot;&lt;
		 * &quot;)) { sb.append(&quot;\n&quot;); sb.append(charEncontered); }
		 */
		if (usable) {
			sb.append(charEncontered);
			sb.append(&quot;\n&quot;);
		}

		usable = true;

	}

	
	
	/**
	 * @param args
	 */

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		/*
		 * SAXParserFactory spf = SAXParserFactory.newInstance(); XMLReader
		 * xmlReader = null; SAXParser saxParser = null; try { //
		 * 创建一个解析器SAXParser对象 saxParser = spf.newSAXParser(); //
		 * 得到SAXParser中封装的SAX XMLReader xmlReader = saxParser.getXMLReader();
		 * saxParser.parse(new File(&quot;d:/sina.xml&quot;), new SAXxhtml()); } catch
		 * (Exception ex) { logger.error(&quot;main(String[]) - &quot; + ex, ex);
		 * System.exit(1); }
		 */

	}

	@Override
	public void endElement(String arg0, String arg1, String arg2)
			throws SAXException {
		// TODO Auto-generated method stub
		super.endElement(arg0, arg1, arg2);

	}

	public void parse(String sPath, String Scontent) {
		this.sPath = sPath;
		try {
			// System.out.println(Scontent);
			HtmlCleaner hc = new HtmlCleaner(Scontent);
			hc.clean();
			PrintWriter pw = new PrintWriter(new FileOutputStream(&quot;e:/tmpfile/tmp.txt&quot;));
			pw.print(sb.toString());
			pw.flush();
			pw.close();
			FileInputStream fis = new FileInputStream(new File(&quot;e:/tmpfile/tmp.txt&quot;));
			String mid = hc.getBrowserCompactXmlAsString();
			StringReader sr = new StringReader(mid);
			InputSource iSrc = new InputSource(sr);
			System.out.println(iSrc.toString());
			SAXParserFactory spf = SAXParserFactory.newInstance();
			XMLReader xmlReader = null;
			SAXParser saxParser = null;
			// 创建一个解析器SAXParser对象
			saxParser = spf.newSAXParser();
			// 得到SAXParser中封装的SAX XMLReader
			xmlReader = saxParser.getXMLReader();
			saxParser.parse(fis, new SAXxhtml());

		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ParserConfigurationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SAXException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}


	}
}
</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>具体思路是Html-&gt;xml,然后就可以用sax对xml解析，但是程序总调不通，有人能帮助解决一下么？</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/185225#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Tue, 22 Apr 2008 01:00:10 +0800</pubDate>
        <link>http://tiantian911.javaeye.com/blog/185225</link>
        <guid>http://tiantian911.javaeye.com/blog/185225</guid>
      </item>
      <item>
        <title>每天晚上躺在床上是我思维最活跃的时候</title>
        <author>tiantian911</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://tiantian911.javaeye.com">tiantian911</a>&nbsp;
          链接：<a href="http://tiantian911.javaeye.com/blog/184681" style="color:red;">http://tiantian911.javaeye.com/blog/184681</a>&nbsp;
          发表时间: 2008年04月20日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>上床之后，有时候很快就睡着了，有时就得过一会儿，回想很多事情。</p>
<p>今天白天发生的，明天白天即将发生的。</p>
<p>想起白天做错了什么事情，提醒自己以后不要这样了；想起白天没有写完很烦的代码，甚至可以在脑中勾勒出大概的轮廓，很清晰，设计精良。</p>
<p>&nbsp;</p>
<p>所以我打算～现在就上床～</p>
          <br/>
          <span style="color:red;">
            <a href="http://tiantian911.javaeye.com/blog/184681#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/115' target='_blank'><span style="color:red;font-weight:bold;">JavaEye图灵杯第2届问答大赛开始了！8月4日至8月17日，奖品丰厚！</span></a></li></ul