﻿<?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-选择java 进入自由开放的国度</title><link>http://www.blogjava.net/soochow_hhb/</link><description>&lt;style&gt;
#glowtext{
filter:glow(color=green,strength=2);width:100%;
}
&lt;/style&gt;
&lt;span id="glowtext"&gt;
&lt;script language="JavaScript1.2"&gt;
var message=" 具有丰富知识和经验的人，比只有一种知识和经验的人更容易产生新的联想和独到的见解。"
var neonbasecolor="#FF930D"
var neontextcolor="#00B3FD"
var flashspeed=300  //in milliseconds

var n=0
if (document.all){
document.write('&lt;font color="'+neonbasecolor+'"&gt;')
for (m=0;m&lt;message.length;m++)
document.write('&lt;span id="neonlight" class="content"&gt;'+message.charAt(m)+'&lt;/span&gt;')
document.write('&lt;/font&gt;')

//cache reference to neonlight array
var tempref=document.all.neonlight
}
else
document.write(message)

function neon(){

//Change all letters to base color
if (n==0){
for (m=0;m&lt;message.length;m++)
tempref[m].style.color=neonbasecolor
}

//cycle through and change individual letters to neon color
tempref[n].style.color=neontextcolor

if (n&lt;tempref.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",1500)
return
}
}

function beginneon(){
if (document.all)
flashing=setInterval("neon()",flashspeed)
}
beginneon()

&lt;/script&gt;
&lt;/span&gt;</description><language>zh-cn</language><lastBuildDate>Tue, 28 Apr 2026 14:30:27 GMT</lastBuildDate><pubDate>Tue, 28 Apr 2026 14:30:27 GMT</pubDate><ttl>60</ttl><item><title>两个项目经理的对话（转）</title><link>http://www.blogjava.net/soochow_hhb/archive/2006/11/18/81941.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Sat, 18 Nov 2006 09:32:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2006/11/18/81941.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/81941.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2006/11/18/81941.html#Feedback</comments><slash:comments>14</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/81941.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/81941.html</trackback:ping><description><![CDATA[
		<p>李明：“陈兄，你好，好久不见，近来可好”<br />陈默：“别提了，最近老睡不好，都快崩溃 ”</p>
		<p>李明：“是不是升官了，很兴奋，以前你当程序员的时候，好象都不会这样”<br />陈默：“当程序员只要做好自己的事情，烦恼就少多了，加上我也很聪明，所以做程序员的工作就很轻松啊，刚被认为为项目经理的时候，只兴奋了不到一个星期，后面就，唉”</p>
		<p>李明：“差别会很大吗？”<br />陈默：“刚开始时认为，项目经理应该很好当，我以前怎么做的就要求别人怎么做就行了，后来做的过程才发现，那根本就行不通”</p>
		<p>李明：“很多人都是这么去想的啊”<br />陈默：“我开始做管理的时候，发现的第一个问题是：每个程序员都觉得自己是聪明人，就象我自己一样，所以当我要求他们象我那样去做的时候，除了三个刚毕业的学生会去执行外，其他人根本就不听，他们说我都做了好几年了，也没有发现我的方法比你的差，我做完就行了，你别管那么多”</p>
		<p>李明：“这样也没有什么啊，任务能完成就好了”<br />陈默：“是啊，开始我也是这么想，慢慢的就发现问题很多”</p>
		<p>李明：“一般的软件开发都有点象黑盒，彼此之间能衔接起来就行了”<br />陈默：“说起来是这样，可实际情况就有很多出乎意料的地方。举个例子，我有个程序员，小梅，就是你见过的那个湖北的小丫头，做程序员都没有的说的，三年来都做的很不错，几个月前我们开始做一个银行的国债项目，她是主要程序员，因为财政部马上要推出储蓄国债，我们公司事先知道，所以先帮一个客户提前设计这个软件，计划在元旦时间完成，和财政部推出的时间基本一致。本来我计划的好好的，结果这个小丫头给我来了一下子”</p>
		<p>李明：“她不是和你私人关系也不错，怎么会给你来一下子，看不出来啊”<br />陈默：“是啊，所以我开始就很放心的把主要任务交给她，谁知道二个月前她告诉我说要请假，如果请不了假就辞职”</p>
		<p>李明：“是不是要求加薪？”<br />陈默：“她不是那样的人，她告诉我这样的事情，二个月前她不小心有了，本来为了工作想去做掉，医生检查的时候，和她说，你的身体状况不好，这次不要，以后可能很难怀上，而且这一胎还要静养保胎，不然也有危险，她老公和和她都是独生子女，双方的家长都要她把孩子生下来，你说我怎么办，要是关系普通我就把这事情推给人事部门去处理，就是关系不错，所以，我就只好帮她想想罗，把自己给郁闷死。”</p>
		<p>
				<br />李明：“那你怎么办？”<br />陈默：“只好我自己接她的工作，要命的是她写的很多程序我居然读不懂，她也没有写很仔细的说明，那天她感觉身体不好，匆匆就回去了，之后就没有办法再过来，我只好猜、猜、猜，有一天我还跑到她家里的闺房去询问，唉，别提有多难受呢，还不如自己重新写，可算算时间，实在是来不及”</p>
		<p>李明：“后来你怎么搞定的”<br />陈默：“想改改完就算了，就按黑盒子的方法处理，结果被老板训了一顿，老板说这么重要的软件，你就不怕在运行过程出点意外，每个错误可能造成很多金钱的损失，我们做的是金融的系统，不是一般的信息管理系统，一点的错误都可能造成不可估量的损失。我一听就傻了，那怎么办啊？”</p>
		<p>李明：“确实是很郁闷的”<br />陈默：“我头痛了一个晚上，最后没有办法，只能是我自己重新写过，每天只睡4个小时，赶了一个多月，才基本搞定，没有影响进度。”</p>
		<p>李明：“你老兄还是有两下子吗”<br />陈默：“可是你知道我付出多惨重的代价”</p>
		<p>李明：“不惨啊，才一个多月的辛苦啊，奖金可是大把的哦”<br />陈默：“结果是我得了颈锥劳损，经常要摇一下脖子，喀嚓一下才会觉得舒服一点，同事们都说我吃摇头丸过量，居然白天还在摇。。。”</p>
		<p>李明：“是有点惨，不够也总算完成了”<br />陈默：“唉！”</p>
		<p>。。。。。。。。。。。</p>
		<p>陈默：“我的项目终于结束了，晚上请你喝一杯”<br />李明：“你舒服了，我可完蛋了” </p>
		<p>陈默：“你的黑盒子方法不是一直很管用嘛，再说，你的程序员都是男的，也不用保胎，有什么问题呢”<br />李明：“唉，有个程序员走了” </p>
		<p>陈默：“走了就走了，有什么好叹气的”<br />李明：“客户的硬盘坏了，我们去重装系统，我把所有的源程序都重新编译了一下，结果出大事情了。” </p>
		<p>陈默：“重新编译很正常，我们也经常这样做，怎么会出大事情呢？”<br />李明：“那家伙留下来的源程序与之前的运行程序不一致，也就是说他给我们留下的不是原来运行的那个，他做了手脚。” </p>
		<p>陈默：“这么恶劣，可以告他？”<br />李明：“外地的员工，现在人也不知道跑那里去了，之前的运行程序我们也没有备份，告他也没有证据啊，要是他一口咬定最后移交的就是这样的东西，我们都认可了他才走的，我们也无话可说。” </p>
		<p>陈默：“项目经理很难当啊，还不如做程序员轻松呢”<br />李明：“是啊，可是谁不想职位高一点，钱多赚一点，象我们这行吃青春饭的，真很悲哀。” </p>
		<p>陈默：“经历过这些事情以来，我就在想，难道没有好的方法来管理吗？”<br />李明：“有啊，引进CMM啊” </p>
		<p>陈默：“这谁都会想的到，可是费用太高，而且效率也不高，对我们这种不大不小的软件公司来说，不是很合适的，”<br />李明：“那就在开发规划上，以及注释上做的详细一点。” </p>
		<p>陈默：“这也只能改进，无法解决根本问题。”<br />李明：“我们上网去找找看，有没有什么东西可以启发或者借用的。” </p>
		<p>陈默：“好啊，以后我们也不要老扯这些烦恼的事情，我们还是只能多想想解决问题的方法，不然以后真不知道怎么办？”<br />李明：“是的。” </p>
		<p>。。。。。。。。。</p>
		<p>陈默：“李兄，我有一个好消息告诉你，晚上见一面如何？”<br />李明：“好啊， 我刚好也有一个好消息要告诉你。” </p>
		<p>陈默：“是我先说，还是你先说？你要告诉我什么。”<br />李明：“我先说吧，我几天前上网，找到了一个工具，可以把开发效率提高好几倍，更重要的是可以辅助管理各种开发的资源，编码的实现都很智能化、标准化，我准备给老板推荐一下。” </p>
		<p>陈默：“哦，是这样的呀，我老板前几天找到我，说他买了一套开发工具，让我以后按照这套工具来开发软件，他说他不想以后看到我在面前摇头晃脑的。看了头晕。”<br />李明：“是什么工具啊？” </p>
		<p>陈默：“国内最新的产品：网航Web Studio开发平台”<br />李明：“等等。不会这么巧吧，我要说的也是这个东西也，我最近比较了好多工具，好不容易才分出优劣，你老板真有眼光啊。” </p>
		<p>陈默：“我老板做了将近二十年的软件，还是不错的，和IBM等公司也来往密切，以前想买国外的软件，可是几十万的价位，实在下不了这个决心，国外的产品做应用，对国内的客户也不容易接受，不够通俗吧。所以就一直没有买，这套国内的产品，价位还不到十万，很划算的，功能比国外的产品还好。”<br />李明：“功能我是都分析过了，没的说的，本来我还以为要几十万一套呢，没有想到还这么便宜，是要给老板建议一下，买一套，不知道他肯不肯花这个钱” </p>
		<p>陈默：“应该没有问题吧。你们做的软件起码也都是几十万一套的，成本也都要二三十万吧，如果用这套工具来做，一个项目就算节省一半的费用，工具的钱就出来，再加上软件资源管理做的很规范，对该项目将来的升级，产品改造都很方便，也不怕程序员的流动或者做手脚。多好啊，你老板又不是傻瓜，他会不懂这些道理吗？”<br />李明：“说的也是啊。我明天就去说。这东西可靠吗？” </p>
		<p>陈默：“可靠，我查过他的一些案例，有一些是金融的，我还打电话到这些应用单位去询问过，反映都不错，就是目前的名气还不大。”<br />李明：“东西好，名气是迟早的事情，我争取用上，也给我们那些同行朋友们推荐一下，以后我们喝酒的时间就多一些了。” </p>
		<p>陈默：“应该是的，来，干一杯。”<br />李明：“干杯！” </p>
		<p>from：<a href="http://community.csdn.net/Expert/topic/5159/5159226.xml?temp=.4152338">http://community.csdn.net/Expert/topic/5159/5159226.xml?temp=.4152338</a><br />大家看看有什么启发？或者有什么感想？</p>
<img src ="http://www.blogjava.net/soochow_hhb/aggbug/81941.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2006-11-18 17:32 <a href="http://www.blogjava.net/soochow_hhb/archive/2006/11/18/81941.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>按期完成IT项目的10条建议(转)</title><link>http://www.blogjava.net/soochow_hhb/archive/2006/11/06/79417.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Mon, 06 Nov 2006 08:02:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2006/11/06/79417.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/79417.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2006/11/06/79417.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/79417.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/79417.html</trackback:ping><description><![CDATA[
		<p>变化无常的时间计划，或高估或低估时间期限，也就是所谓的“需求渐变问题”，以及突如其来的员工生病事件或供应失败等等——这些都是会导致您的IT项目出错（或可能出错）的因素。</p>
		<p>按期成功完成一个项目的关键在于积极的计划和合理的时间、资源管理。本文关于项目管理的这些建议会帮助您计划好下一个项目，确保在预算范围内以高质量水平按时完成。</p>
		<p>也许您曾听说过“时不待我。”这虽然只是陈词滥调，但并不意味着它一点可取之处也没有，尤其是在邻近IT项目截止日期的情况下。变化无常的时间计划，或高估或低估时间期限，也就是所谓的“需求渐变问题”，以及突如其来的员工生病事件或供应失败等等——这些都是会导致您的IT项目出错（或可能出错）的原因。</p>
		<p>因为时间是当今社会衡量效率的一般标准，所以因这些事由导致的计划推迟、延误都会最终带来相当规模的财产损失（除了名誉受到损害之外）。</p>
		<p>有没有解决办法呢？当然有！合理的计划，良好的执行，考虑到可能会出现的困难，这些一定能确保项目成功执行并完成。大部分项目经理清楚这些，并花大量时间制定项目时间表和交付时限表。然而，常常并导致他们出错的是，他们没能认识到项目计划是一个持续性的活动，必须在项目进展周期中积极地、持续地发生，而不是收到客户预支款项后便告一段落。</p>
		<p>在本文中，我将提出一些建议，帮助您有效地进行下个项目的计划，并确保在预算前提下以高质量水平按时完成项目。</p>
		<p>问题</p>
		<p>首先，让我们看看导致项目延误的几个原因：</p>
		<p>野心过大的估计和不恰当的任务评估：往往，一个项目团队对于完成既定任务不能做出恰当的时间和精力的估算，而制定出过于积极乐观的时间计划。客户带来的压力也会迫使一个团队去尝试在本已有限的时间内完成过多的任务——这是最终会导致最终产品产生质量风险的自我挫败战略。 </p>
		<p>不合理的项目规模：往往，对于一个团队所给定的时限，一些项目过于庞大。管理人员（或客户）有时在未实际分析项目可行性的情况下，便尝试无理地把尽可能多的特性和发展任务压缩在一起。 </p>
		<p>任务分派不明确：有时，任务没有明确分工，团队成员角色不明确导致成员间的产生误解。 <br />缺乏风险管理系统：有些团队盲目自信，相信他们可以在最后一秒拯救一个计划，相信所有危险可以放到第二天的会议上得到解决。这是个不切实际的想法。所有项目都不可避免的会有问题存在；任何一个问题都可能摧毁整个计划，使项目不堪重击而失败。如果这些问题不能够被明确查出，并在良好的基础上不能提前解决，那么结果只会往更坏的方向发展。 </p>
		<p>缺乏资源：“这个项目需要五名开发人员，但是我们只有四名。没关系，我们会处理好的。”听起来熟悉吗？如果是，那么就要清楚这样是行不通的——一个需要五名成员的项目，如果少了一位，并不能如期完成。另外一种类似情况是一个项目在开始之时有着合适的成员数量，但在项目过程中，一些成员被“分派”去参加其他的项目（通常这是因为某些高层领导认为他们在资源分配上比项目经理懂得更多）。 </p>
		<p>基础设备不完善或遭破坏：一些项目的延误常常是因为对于一个项目的成功完成必不可少的基础设备——如硬件、软件、工具、文档等——在最需要它们的时候无法得到或不能正常运行。<br />?<br />解决方案（10点建议）</p>
		<p>然而，一切并非只剩黯淡和无望。以下的措施将会缓和这些问题并保证项目按照计划运行和如期完成。</p>
		<p>详细分析要求：仔细理解与项目有关的各个方面，具体到最细小的要点。对于模糊不清的方面要提出问题直至清楚理解。最后，雇佣专业人员归类整理业务要求，操作细节和设计要求。小心需求的渐变；一不小心，它便会摧毁您所做的一切努力。如果有必要，要大胆地缩小项目规模或避免添加计划外的新方案，因为这必定需要更高要求的时间整合。 </p>
		<p>合理配置可利用资源：按照要求配置可利用资源，确保足够的人员来完成工作。在项目运行启动之前确保项目顺利执行的各种基础设施——硬件、软件、人力资源、工具、文本信息等——都已到位。 </p>
		<p>进行培训和知识迁移：如果有培训，培训也该算作是项目时限内的一部分。不要把培训当作员工工作时间以外的任务，而应该把其列入项目计划和预算之内。 <br />识别风险：确认潜在风险和准备突发事件预案以备不时之需。制定后备计划以备在突发情况和人力方案失败之时如期完成；这种“B计划”方案是在项目未按计划成功进行情况下的支持性系统。 </p>
		<p>估算与分配：给每位组员分派角色和任务，确保每项任务具有明确的负责人。运用项目管理工具和甘特图表记录每位成员的任务以及每项任务开始和完成的日期。如果在任务责任分派制这一环节上失败会导致责任重叠、精力无谓重复、时间浪费和产品质量低下。 </p>
		<p>工作任务模块化：把每项主要工作任务划分为几项子任务，直至每项工作都是一个完整的个体，与其他工作互相独立。以逻辑顺序整理排列，然后以发生先后为序开始执行最细小的一项工作任务。 </p>
		<p>避免过多会议：策划关于项目状态的讨论会，或在以需要为基础的前提下即刻点明问题所在。冗长的、无休止的、没有明确议程、明确结果的会议只是浪费时间。 </p>
		<p>做好记录：记录项目的成功与失败。这一点很重要；这会成为其他项目中相应工作任务的历史参考信息。使用项目纪录板以图表的形式在更高层次综观项目，更好地衡量项目进程。在每一步重大转折时对项目进行检查鉴定，并依此更新项目纪录板。 </p>
		<p>认识全天候发展模式：如果有一种全天候发展模式（一种在全球范围内持续不断进行的工程作业环境），确保在不同部门团队成员间和跨国团队成员间明确沟通，避免误会。定期做好协调工作以避免不必要问题的出现。 </p>
		<p>逐步上报问题：当问题出现时，要第一时间报告管理层，并尽可能多地制定解决方案。在事态严重到无法补救以前，要尝试各种弥补办法便是您最后需要做的一件事。 <br />必须清楚，按期成功地完成项目关键在于前期计划和合理的时间，资源管理。采纳以上建议，您的项目将会如期完成，并达到目标。祝您好运！</p>
<img src ="http://www.blogjava.net/soochow_hhb/aggbug/79417.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2006-11-06 16:02 <a href="http://www.blogjava.net/soochow_hhb/archive/2006/11/06/79417.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jsp-java-mysql字符集统一</title><link>http://www.blogjava.net/soochow_hhb/archive/2006/11/03/78845.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Fri, 03 Nov 2006 01:03:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2006/11/03/78845.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/78845.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2006/11/03/78845.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/78845.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/78845.html</trackback:ping><description><![CDATA[1、在jsp中，字符集由&lt;%@ page language="java" contentType="text/html;charset=GBK"%&gt;来指定，如果处理中文，需指定为gbk。所以提交的数据全部都使用gbk编码；<br />2、在java中，从jsp提交过来的数据是gbk编码的，而java默认的处理方式是使用ISO-8859-1编码，所以若在java中能显示jsp提交过来的gbk编码方式的数据，就要进行一个转换：将gbk转换为ISO-8859-1，这样数据就可正常显示。<br />3、如果要将jsp提交的数据经过java后台处理，然后放入数据库中，就又多了一个数据编码方式：数据库的数据编码方式。以mysql为例，默认字符集为latin，所以若将gbk的数据放入，必然出现乱码，所以首先应改变数据库的编码方式为gbk。<br /><br />综上，简单的设置方法如下：<br /><br />jsp (gbk)     ----&gt;     java(ISO-8859-1)  -------&gt; mysql(gbk)<br />                                                                转换<br />这样设置之后，还有一种情况会出现乱码：当你在jsp端提交一个id号，然后在java处理端通过id号得到数据库中的gbk（汉字）数据，这是就会出现乱码，因为java处理的是ISO-8859-1，你在java到mysql中有了一个ISO-8859-1到gbk的转换，而这些数据本身就是ISO-8859-1,所以转换后就出现问题了。<br />解决办法：将在java中处理的gbk数据转换为ISO-8859-1即可。<br /><br />总之：在jsp，java，mysql三者之间的编码方式必须统一，不能错误的转换或者不转换。<img src ="http://www.blogjava.net/soochow_hhb/aggbug/78845.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2006-11-03 09:03 <a href="http://www.blogjava.net/soochow_hhb/archive/2006/11/03/78845.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>IoC的初步理解</title><link>http://www.blogjava.net/soochow_hhb/archive/2006/09/30/72966.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Sat, 30 Sep 2006 02:37:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2006/09/30/72966.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/72966.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2006/09/30/72966.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/72966.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/72966.html</trackback:ping><description><![CDATA[
		<p>好久写有关java技术的文章了，这几天在图书馆看到《Spring in Action》就借过来随手翻翻，觉得第一章的IoC的概念讲的很好，现在整理如下。<br /><font style="BACKGROUND-COLOR: #ffffff" color="#a52a2a"><strong>（1）从类的耦合说起<br /></strong></font>在实际的系统中，要多个类共同协作来完成某一项任务，一般称为复合。在系统的设计过程中，耦合是不可避免的，是必须的，但是它会带来以下问题：<br />－－难以测试：看下面的两个类：<br />KnightOfTheRoundTable<br />                  |<br />                  |  new<br />                 V<br />         HolyGrailQuest<br />在KnightOfTheRoundTable类中使用了HolyGrailQuest类，并且可能使用不同的Quest类。这两个类的功能是骑士去执行不同的任务，HolyGrail只是代表了一种任务。这种通过国new的方式，使得knight和quest两个类紧密的耦合在一起。设计完成后做单元测试，看下面的代码：<br />KnightOfTheRoundTable knight = new KnightOfTheRoundTable("Bedivere");<br />HolyGrail grail = knight.embarkOnQuery();<br />assertNotNull(grail);<br />assertTrue(grail.isHoly());<br />在测试KnightOfTheRoundTable类的时候，间接的测试了HolyGrailQuest类，但是对于HolyGrailQuest类的情况并没有很显式的测试，所以使用了最后的两行代码来测试，显得很笨拙。不知道是否测试了所有可能的情况。<br />－－难以维护<br />如果以后修改了代码，或者增加了/改变了knight的任务，代码必须改动，测试代码也要改动，并且改动一个地方，可能会影响到其他很多地方，为日后的维护工作带来了麻烦<br />－－紧耦合<br />提示：这种模式引起的问题，主要是因为紧耦合所致，所以要解决这种问题的首要方案就是解耦合，但如何来解耦合呢？请继续看：<br /><font color="#a52a2a"><strong>（2）解耦合——通过接口interface来实现<br /></strong></font>因为骑士可能执行不同的任务，也有不同种类的骑士，所以我们可以将任务和骑士抽象为接口，将具体的实现隐藏在接口之下，这样就不必在knight类中通过显示的 HolyGrailQuest quest = new HolyGrailQuest ()这样的语句来创建Quest对象，而可以通过接口Quest quest ＝ new HolyGrailQuest()来实现。这样就形成了如下的类图：<br /><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><img src="http://www.blogjava.net/images/blogjava_net/soochow_hhb/1228/r_.bmp" /></span></p>
		<p>
				<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">这样，虽然使用了接口，使得层次分明，通过接口Quest来实现探险，但是还是只能从事一种探险任务，而如何才能让骑士从事任何一种任务呢？请继续看！<br /><font color="#a52a2a"><strong>（3）给予与获得</strong></font><br />骑士执行探险任务有两种方式：<br />第一、让骑士主动获得探险任务，前面的实现方式属于这类，通过new来实现；<br />第二，让骑士被动的获得任务，即给予骑士某项探险任务，这样就解决了上面的问题（让骑士可以从事任何一种任务，只要给他们分配即可）。<br />实际实现的方式很简单，看如下代码：<br />public void setQuest(Quest quest){<br />   this.quest = quest;<br />}<br /><font color="#0000ff"><strong>简单的代码实现了方式的改变，这样给KnightOfTheRoundTable类传入任何的Quest任务，都可以接受了。<br />到这里可以很明显的看出来，我们将以前的new方式，翻转过来，即不是让主动获得依赖类，而是被动的获得依赖类，这就是IoC的核心，实际Fowler说得依赖注入也很贴切，即向类中“注入”它依赖的其他类。<br /></strong></font><br />好了，到这里，应该知道了IoC的基本概念了吧，也知道了IoC的基本功能了吧。<br />要想更深入的了解，请关注我的文章。</span>
		</p>
<img src ="http://www.blogjava.net/soochow_hhb/aggbug/72966.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2006-09-30 10:37 <a href="http://www.blogjava.net/soochow_hhb/archive/2006/09/30/72966.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>创业文章：长风破浪会有时</title><link>http://www.blogjava.net/soochow_hhb/archive/2006/08/05/61977.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Sat, 05 Aug 2006 11:24:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2006/08/05/61977.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/61977.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2006/08/05/61977.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/61977.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/61977.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align="center">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 14pt; FONT-FAMILY: 黑体">长风破浪会有时，直挂云帆济沧海<span lang="EN-US"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align="center">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 14pt; FONT-FAMILY: 楷体_GB2312">
								<span lang="EN-US">
										<o:p>
										</o:p>
								</span>
						</span>
				</b> </p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 33.75pt; mso-char-indent-count: 2.5">
				<span style="FONT-SIZE: 13.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">创业到底需要具备什么条件？对我而言，完全是一种冲动，去年九月份，我们两个接到一个项目，非常的兴奋，有天需求方问我怎么出票，我怎么收钱的问题？积在心中的创业的火焰一下子燃烧了，和同学一拍即合，注册公司。当初的想法是多么的简单啊！</span>
				<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Verdana">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 33.75pt; mso-char-indent-count: 2.5">
				<span style="FONT-SIZE: 13.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">我现在觉得创业需要几个条件：勇气、愿景、团队和技术。勇气是前提，必须迈出第一步；愿景是目标，公司要做什么，要在哪个方面发展，必须要明确；团队对于创业初期是非常重要的，在创业初期由于经验不足，可能会走很多的弯路，也会碰到很多的困难，一个勇于开拓，团结一心的团队对于公司的发展起着至关重要的作用；对于科技型公司来说，技术就是你的法宝，一定要在某一项技术上能够深入下去，能够独树一帜，在公司的发展过程中一定要能沉淀出有自己特色的核心技术。</span>
				<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Verdana">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 33.75pt; mso-char-indent-count: 2.5">
				<span style="FONT-SIZE: 13.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">对于创业者来说，如何迈出第一步是勇气的问题，特别对于我们在校大学生而言，虽然现在有很多呼声鼓励大学生创业，但是具体的配套措施和孵化措施还很不到位，只有一个想法、点子也是不行的，还需要启动资金，需要持续的业务。我们是幸运的，通过我们的努力，顺利的完成了我们的第一个项目，顺利的得到了我们的启动资金。虽然创业的初衷是冲动，但是我们已经迈出了坚实的第一步。</span>
				<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Verdana">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 33.75pt; mso-char-indent-count: 2.5">
				<span style="FONT-SIZE: 13.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">创业当然要有</span>
				<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Verdana">“</span>
				<span style="FONT-SIZE: 13.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">业</span>
				<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Verdana">”</span>
				<span style="FONT-SIZE: 13.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">，当初的冲动并不能保证将来的成功，有了一点的积累之后，就要好好确定一下自己的创业方向了（当然，大部分是最初都有的），也就是公司的愿景，就和一个人的目标一样，要在某段时期内作出什么东西，将来要达到什么程度必须明确。这是最最关键的了，并且要定位好，不能看到别人在哪个方面赚钱了，自己就跟着去做，从而迷失了自己的方向。我们在拿到第一笔启动资金之后，就确定了公司发展的两条主线，第一是利用我们的技术和经验为公司提供高效的信息系统；第二是我们的长远目标，就是为企业提供灵活、方便、快捷的多媒体通信服务。第一条线在前期资金短缺的情况下，为第二条线上的产品研发提供资金支持。</span>
				<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Verdana">
						<br />       </span>
				<span style="FONT-SIZE: 13.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">团队是初期创业公司的灵魂，如果没有一支能够吃苦、高效、有毅力的团队，对于公司初期的发展是很不利的。在创业的过程中，特别是对于第一次创业者来说，会遇到很多以前根本想不到的困难，有时也会遇到一点资金都没有的状况，如何从前期的困难中走出，从而开辟一条生存之路，是首先要考虑的问题。因为我们两个都是学生，创业的初衷是年青人的冲动，对很多问题的看法简单话，遇到了很多问题和困难。这里首先要感谢吴中区科技创业园对我们的支持和鼓励，尤其是朱芹主任给了我们很大的鼓励，努力帮助我们走出困境。当她看到我们正在研发的一个有关多媒体网络通信的软件时，立即鼓励我们去申报市科技据的科技项目，并且邀请了科技局的一些领导和专家来听取我们的项目汇报，我们从中学到了很多东西，并且更重要的是得到很多领导和专家的鼓励和支持，通过科技园的积极推荐，我们获得了很多重要的机会。</span>
				<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Verdana">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 33.75pt; mso-char-indent-count: 2.5">
				<span style="FONT-SIZE: 13.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">技术对于科技型企业来说是生存之本，在创业初期，不可能有很多人才，也不可能搞资本运作，也很难拉到社会上的投资，所以唯有依靠自身的技术实力来开拓市场，研发产品。在公司的发展中，一定要积累出自身的核心技术，积累一些重要的技术成果，同时也要注重知识管理，这些知识会在公司的不断发展中形成公司的核心竞争力，就不会出现由于某一两个人的离去而使公司受到重创。</span>
				<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Verdana">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 33.75pt; mso-char-indent-count: 2.5">
				<span style="FONT-SIZE: 13.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">创业不是玩家家，创业是实实在在的东西，创业是要你能按照规则生存下去，可能因为冲动而创业，但创业后不能老冲动，冲动一下，可能你要考虑一些东西。</span>
				<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Verdana">
						<br />      </span>
				<span style="FONT-SIZE: 13.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">“行路难，行路难，多歧路，今安在，长风破浪会有时，直挂云帆济沧海”，李白的这句诗用来形容创业之路再贴切不过，在创业之初肯定会遇到很多困难，但是只要团队团结一致，勇于开拓，就一定会有成功的一天。</span>
				<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Verdana">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 33.75pt; mso-char-indent-count: 2.5">
				<span style="FONT-SIZE: 13.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">我们现在还处于创业初期，但是我觉得不只是创业本身使我获益匪浅，同时也让我有了一般大学生所没有的人生体验。</span>
				<span lang="EN-US" style="FONT-SIZE: 14pt">
						<o:p>
						</o:p>
				</span>
		</p>
<img src ="http://www.blogjava.net/soochow_hhb/aggbug/61977.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2006-08-05 19:24 <a href="http://www.blogjava.net/soochow_hhb/archive/2006/08/05/61977.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>stat the schema of solution</title><link>http://www.blogjava.net/soochow_hhb/archive/2006/07/17/58606.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Mon, 17 Jul 2006 09:03:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2006/07/17/58606.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/58606.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2006/07/17/58606.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/58606.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/58606.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 1 /*------------------------------------------------------------------------  2                         stat. the schema of solution  3 ----------------------------------------------------------------...&nbsp;&nbsp;<a href='http://www.blogjava.net/soochow_hhb/archive/2006/07/17/58606.html'>阅读全文</a><img src ="http://www.blogjava.net/soochow_hhb/aggbug/58606.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2006-07-17 17:03 <a href="http://www.blogjava.net/soochow_hhb/archive/2006/07/17/58606.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Getting Started with CGI Programming in C (转，译)</title><link>http://www.blogjava.net/soochow_hhb/archive/2006/06/26/55055.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Mon, 26 Jun 2006 00:41:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2006/06/26/55055.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/55055.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2006/06/26/55055.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/55055.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/55055.html</trackback:ping><description><![CDATA[
		<div>
				<cite>
						<a href="http://www.cs.tut.fi/%7Ejkorpela/indexen.html">IT and communication</a>
				</cite>:
<cite><a href="http://www.cs.tut.fi/%7Ejkorpela/www.html">Web authoring and surfing</a></cite>:
<cite><a href="http://www.cs.tut.fi/%7Ejkorpela/forms/index.html">Forms</a></cite>:</div>
		<h1>
Getting Started with CGI Programming in C
</h1>
		<p class="summary">
This is an introduction to writing CGI programs in the
<a href="http://www.eskimo.com/%7escs/C-faq/top.html" title="comp.lang.c Frequently Asked Questions">C language</a>.
The reader is assumed to know the basics of C as well how
to write simple
<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/index.html" title="Annotated links to tutorials, references, and specialized documents about HTML forms">forms</a>
in
<a title="Getting Started with HTML; a primer by J. Korpela" href="http://www.cs.tut.fi/%7Ejkorpela/html-primer.html">HTML</a>
and to be able to install CGI scripts on
a Web server.
The principles are illustrated with very simple examples.
</p>
		<div class="warning">
Two important warnings:
<ul><li>
To avoid wasting your time, please check--from applicable local
documents or by contacting local webmaster--whether you can
install and run CGI scripts written in C on the server.
At the same time, please check how to do that in detail--specifically,
where you need to put your CGI scripts.
</li><li>This document was written to illustrate the idea of CGI
scripting to C programmers. In practice, CGI programs are usually
written in other languages, such as
<a href="http://www.cs.tut.fi/%7Ejkorpela/perl/index.html">Perl</a>,  and for good reasons:
except for very simple cases, CGI programming in C is clumsy
and error-prone.
</li></ul></div>
		<h2>Content</h2>
		<ul>
				<li>
						<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/cgic.html#why">Why CGI programming?</a>
				</li>
				<li>
						<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/cgic.html#what">So what is CGI programming?</a>
				</li>
				<li>
						<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/cgic.html#get">How to process a simple form</a>
				</li>
				<li>
						<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/cgic.html#post">How to process a form with <code>METHOD="POST"</code></a>
				</li>
		</ul>
		<h2>
				<a name="why">Why CGI programming?</a>
		</h2>
		<p>
As my document
<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/index.html" title="Annotated links to tutorials, references, and specialized documents about HTML forms"><cite>How to write HTML forms</cite></a> briefly explains,
you need a <em>server side-script</em> in order to use HTML
forms reliably. Typically there are simple server-side scripts
available
for
simple, common ways of processing form submissions, such as sending
the data in text format by E-mail to a specified address.
</p>
		<p>
But for more advanced processing, such as collecting data into
a file or database, or retrieving information and sending it back,
or doing some calculations with the submitted data, you will
probably need to write a server-side script of your own.
</p>
		<p>
CGI is simply an <em>interface</em> between HTML forms and server-side
scripts. It is not the only possibility--see the excellent tutorial
<a href="http://www.garshol.priv.no/download/text/http-tut.html"><cite>How the web works: HTTP and CGI explained</cite></a>
by
<a href="http://www.garshol.priv.no/">Lars Marius Garshol</a>
for both an introduction to the concepts of CGI and notes on other
possibilities. But CGI is widely used and useable.
</p>
		<p>
If someone suggests using JavaScript as an <em>alternative</em> to CGI,
ask him to read my
<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/javascript.html"><cite>JavaScript and HTML: possibilities and caveats</cite></a>.
Briefly, JavaScript is inherently unreliable at least if not "backed up"
with server-side scripting.

</p>
		<h2>
				<a name="what">So what is CGI programming?</a>
		</h2>
		<p>
The above-mentioned 
<a href="http://www.garshol.priv.no/download/text/http-tut.html"><cite>How the web works: HTTP and CGI explained</cite></a>
is a great tutorial. There are some shorter introductions like
<a href="http://www.virtualville.com/library/cgi.html"><cite>Introduction to the Common Gateway Interface (CGI)</cite></a>
in the
<a href="http://www.virtualville.com/library.html">Virtualville Library</a>.
The following introduction of mine is just another attempt to present
the basics; please consult other sources if you get confused or need
more information.
</p>
		<p>
				<a name="simpleform">Let us consider the following simple HTML form:</a>
		</p>
		<pre>
				<code class="html">&lt;FORM ACTION="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/mult.cgi"&gt;<br />&lt;P&gt;Please specify the multiplicands:<br />&lt;INPUT NAME="m" SIZE="5"&gt;<br />&lt;INPUT NAME="n" SIZE="5"&gt;&lt;BR&gt;<br />&lt;INPUT TYPE="SUBMIT" VALUE="Multiply!"&gt;<br />&lt;/FORM&gt;<br /></code>
		</pre>
		<p>It will look like the following on your current browser:
</p>
		<form action="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/mult.cgi">
				<div>Please specify the multiplicands:
<input name="m" size="5" /><input name="n" size="5" /><br /><input value="Multiply!" type="submit" /></div>
		</form>
		<p>You can try it if you like. Just in case the server used isn't
running and accessible when you try it, here's what you would get
as the result:
</p>
		<blockquote>
				<h3>Multiplication results</h3>
				<p>The product of 4 and 9 is 36.
</p>
		</blockquote>
		<p>
What we discuss here is <em>how</em> it works.
</p>
		<p>
Assume that you type <kbd>4</kbd> into one input field and
<kbd>9</kbd> into another and then invoke submission (typically,
by clicking on a submit button), your browser will
send, by HTTP, a request to the server at
<code>www.cs.tut.fi</code>. The browser pick up this server name
from the value of <code>ACTION</code> attribute where it
occurs as the host name part of a URL.
(Quite often the <code>ACTION</code> attribute refers, often using
a relative URL, to a script on the same server as the document
resides on, but this is not necessary, as this example shows.)
</p>
		<p>
When sending the request, the browser provides additional information,
specifying a relative URL, in this case<br /><code>/cgi-bin/run/~jkorpela/mult.cgi?m=4&amp;n=9</code><br />
This was constructed from that part of the <code>ACTION</code> value
which follows the host name, by appending a question mark
<code>?</code> and the form data in
<a href="http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type" title="Specification of the application/x-www-form-urlencoded encoding">a specifically encoded format</a>.
</p>
		<p>
The server to which the request was sent
(in this case, <code>www.cs.tut.fi</code>)
will then process
it according to its own rules. Typically, the server's configuration
defines how the relative URLs are mapped to file names and which
directories/folders are interpreted as containing CGI scripts.
As you may guess, the part <code>cgi-bin/</code> in the URL causes
such interpretation in this case. This means that instead of just
picking up and
sending back (to the browser which sent the request) an HTML document
or some other file, the server <em>invokes</em> a script or a program
specified in the URL (<code>mult.cgi</code> in this case) and passes
some data to it (the data <code>m=4&amp;n=9</code> in this case).</p>
		<p>
				<small>It depends on the server how this really happens.
In this particular case, the server actually runs the (executable)
program in the file <code>mult.cgi</code> in the subdirectory
<code>cgi-bin</code> of user
<code>jkorpela</code>'s home directory. It could be something
quite different, depending on server configuration.</small>
		</p>
		<p>
The often-mysticized abbreviation <dfn>CGI</dfn>, for
<dfn>Common Gateway Interface</dfn>, refers just to a convention on how
the invocation and parameter passing takes place in detail.
<dfn>Invocation</dfn> means different things in different cases.
For a <a href="http://www.cs.tut.fi/%7Ejkorpela/perl/index.html">Perl</a> script, the server would invoke a Perl interpreter and
make it execute the script in an interpretive manner. For an
executable program, which has typically been produced by a compiler
and a loader from a source program in a language like C, it would
just be started as a separate process.
Although the word <em>script</em> typically suggests that the code
is interpreted, the term <dfn>CGI script</dfn> refers both to such
scripts and to executable programs.
See
<a href="http://www.webthing.com/tutorials/cgifaq.1.html#2">answer to question <i>Is it a script or a program?</i></a>
in
<a href="http://www.webthing.com/tutorials/cgifaq.html"><cite>CGI Programming FAQ</cite></a> by
Nick Kew.</p>
		<p class="warning">
				<a name="compile">You need to <strong>compile and load</strong></a>
your C program on the
<strong>server</strong> (or, in principle, on a system with the
same architecture, so that binaries produced for it are executable
on the server too).</p>
		<p> And you need to put the executable into
a suitable directory and name it according to server-specific conventions
For example, if the server runs some flavor of Unix and has the
Gnu C compiler available, you would typically use a compilation
command like <code>gcc -o mult.cgi mult.c</code> and
then move (<code>mv</code>) <code>mult.c</code> to a directory with
a name like <code>cgi-bin</code>. But you really need to check local
instructions for such issues.</p>
		<p>
				<a name="ext">The <strong>filename extension <code>.cgi</code></strong></a>
has no fixed meaning in general. But there can be <em>server-dependent</em>
(and operating system dependent) rules for naming executable files.
<em>Typical</em> extensions for executables are <code>.cgi</code>
and <code>.exe</code>.</p>
		<h2>
				<a name="get">How to process a simple form</a>
		</h2>
		<p class="important">For forms which use <code>METHOD="GET"</code> (as our
<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/cgic.html#simpleform">simple example</a> above uses, since
this is the default),
CGI specifications say that the data is passed to
the script or program in an environment variable called
<code>QUERY_STRING</code>.
</p>
		<p>
It depends on the scripting or programming
language used how a program can access the value of an environment
variable. In the C language, you would use the
library function <code>getenv</code> (defined in the
standard library <code>stdlib</code>) to access the value as
a string. You might then use various techniques to pick up data
from the string, convert parts of it to numeric values, etc.
</p>
		<p>
The <em>output</em> from the script or program to "primary output
stream" (such as <code>stdin</code> in the C language) is handled
in a special way. Effectively, it is directed so that it gets sent
back to the browser. Thus, by writing a C program that it writes
an HTML document onto its standard output, you will make that document
appear on user's screen as a response to the form submission.
</p>
		<p>
In this case, <a href="http://www.cs.tut.fi/%7Ejkorpela/forms/mult.c" title="The source program as a separate document">the source program</a>
in C is the following:
</p>
		<pre>
				<code class="C">#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br />int main(void)<br />{<br />char *data;<br />long m,n;<br />printf("%s%c%c\n",<br />"Content-Type:text/html;charset=iso-8859-1",13,10);<br />printf("&lt;TITLE&gt;Multiplication results&lt;/TITLE&gt;\n");<br />printf("&lt;H3&gt;Multiplication results&lt;/H3&gt;\n");<br />data = getenv("QUERY_STRING");<br />if(data == NULL)<br />  printf("&lt;P&gt;Error! Error in passing data from form to script.");<br />else if(sscanf(data,"m=%ld&amp;n=%ld",&amp;m,&amp;n)!=2)<br />  printf("&lt;P&gt;Error! Invalid data. Data must be numeric.");<br />else<br />  printf("&lt;P&gt;The product of %ld and %ld is %ld.",m,n,m*n);<br />return 0;<br />}<br /></code>
		</pre>
		<p>
				<small>As a disciplined programmer, you have probably noticed
that the program makes no check against integer overflow, so it
will return bogus results for very large operands. In real life,
such checks would be needed, but such considerations would take us
too far from our topic.</small>
		</p>
		<p>Note: The first <code>printf</code> function call prints out
data which will be sent by the server as an HTTP header.
This is required for several reasons, including the fact that
a CGI script can send any data (such as an image or a plain text file)
to the browser, not just HTML documents.
For HTML documents, you can just use the <code>printf</code> function
call above as such; however, if your
<a href="http://www.cs.tut.fi/%7Ejkorpela/chars.html" title="A tutorial on character code issues">character encoding</a> is different from ISO 8859-1 (ISO Latin 1),
which is the most common on the Web, you need to replace
<code>iso-8859-1</code> by the
<a href="ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets" title="Official (IANA) registry of &quot;charset&quot; names">registered name of the encoding ("charset") you use</a>.

</p>
		<p>I have compiled this program and saved the executable program
under the name <code>mult.cgi</code> in my directory for CGI scripts
at <code>www.cs.tut.fi</code>.
This implies that <em>any</em>
form with 
<code>action="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/mult.cgi"</code>
will, when submitted, be processed by that program.</p>
		<p class="warning">As a consequence, anyone could write a form
of his own with the same <code>ACTION</code> attribute and pass
whatever data he likes to my program. Therefore, the program
needs to be able to <strong>handle any data</strong>.
Generally, you need to check the data before starting to process it.
</p>
		<h2>
				<a name="post">How to process a form with <code>METHOD="POST"</code></a>
		</h2>
		<p>Let us consider next a different processing for form data.
Assume that we wish to write a form which takes a line of text
as input so that the form data is sent to
a CGI script which
<em>appends the data to a text file</em> on the server.
(That text file could be readable by the author of the form and the
script only, or it could be made readable to the world through another
script.)
</p>
		<p>It might seem that the problem is similar to the
<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/cgic.html#get">example considered above</a>; one would just need
a different form and a different script (program).
But in fact, there is a difference. The example above can be regarded
as a "pure query" which does not change the "state of the world",
and in particular it is "idempotent", i.e. the same form data could
be submitted as many times as you like without causing any problems
(except minor waste of resources). But our current task needs
to cause such changes--a change in the content of a file which is
intended to be more or less permanent. Therefore, one should use
<code>METHOD="POST"</code>. This is explained in more detail in
the document
<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/methods.html"><cite>Methods <code>GET</code> and <code>POST</code> in HTML forms - what's the difference?</cite></a>
Here we will take it for granted that
<code>METHOD="POST"</code> needs to be used and consider the
technical consequences.
</p>
		<p class="important">For forms which use <code>METHOD="POST"</code>,
CGI specifications say that the data is passed to
the script or program
in the standard input stream (<code>stdin</code>), and the
length (in bytes, i.e. characters) of the data is passed
in an environment variable called
<code>CONTENT_LENGTH</code>.
</p>
		<p>Reading from standard input sounds probably simpler than
reading from an environment variable, but there are complications.
The server is <em>not</em> required to pass the data so that
when the CGI script tries to read more data than there is, it would
get an end of file indication! That is, if you read e.g. using
the <code>getchar</code> function in a C program, it is <em>undefined</em>
what happens after reading all the data characters; it is not guaranteed
that the function will return <code>EOF</code>.
</p>
		<p class="warning">
When reading the input, the program must not try to read more
than <code>CONTENT_LENGTH</code> characters.
</p>
		<p>
A relatively simple
<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/collect.c" title="The source program as a separate document">C program</a>
for accepting input via CGI and
<code>METHOD="POST"</code> is the following:
</p>
		<pre>
				<code class="C">#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br />#define MAXLEN 80<br />#define EXTRA 5<br />/* 4 for field name "data", 1 for "=" */<br />#define MAXINPUT MAXLEN+EXTRA+2<br />/* 1 for added line break, 1 for trailing NUL */<br />#define DATAFILE "../data/data.txt"<br /><br />void unencode(char *src, char *last, char *dest)<br />{<br /> for(; src != last; src++, dest++)<br />   if(*src == '+')<br />     *dest = ' ';<br />   else if(*src == '%') {<br />     int code;<br />     if(sscanf(src+1, "%2x", &amp;code) != 1) code = '?';<br />     *dest = code;<br />     src +=2; }     <br />   else<br />     *dest = *src;<br /> *dest = '\n';<br /> *++dest = '\0';<br />}<br /><br />int main(void)<br />{<br />char *lenstr;<br />char input[MAXINPUT], data[MAXINPUT];<br />long len;<br />printf("%s%c%c\n",<br />"Content-Type:text/html;charset=iso-8859-1",13,10);<br />printf("&lt;TITLE&gt;Response&lt;/TITLE&gt;\n");<br />lenstr = getenv("CONTENT_LENGTH");<br />if(lenstr == NULL || sscanf(lenstr,"%ld",&amp;len)!=1 || len &gt; MAXLEN)<br />  printf("&lt;P&gt;Error in invocation - wrong FORM probably.");<br />else {<br />  FILE *f;<br />  fgets(input, len+1, stdin);<br />  unencode(input+EXTRA, input+len, data);<br />  f = fopen(DATAFILE, "a");<br />  if(f == NULL)<br />    printf("&lt;P&gt;Sorry, cannot store your data.");<br />  else<br />    fputs(data, f);<br />  fclose(f);<br />  printf("&lt;P&gt;Thank you! The following contribution of yours has \<br />been stored:&lt;BR&gt;%s",data);<br />  }<br />return 0;<br />}<br /></code>
		</pre>
		<p>Essentially, the program retrieves the
information about the number of characters in the input
from value of the
<code>CONTENT_LENGTH</code> environment variable.
Then it unencodes (decodes) the data, since the data arrives in
<a href="http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type" title="Specification of the application/x-www-form-urlencoded encoding">a specifically encoded format</a>.
The program has been written for a form where the text input field
has the name <code>data</code> (actually, just the length of the name
matters here). For example, if the user types<br /><kbd>Hello there!</kbd><br />
then the data will be passed to the program encoded as
<kbd>data=Hello+there%21</kbd><br />
(with space encoded as <code>+</code> and exclamation mark encoded
as <code>%21</code>). The <code>unencode</code> routine in the program
converts this back to the original format. After that,
the data is appended to a file (with a fixed file name),
as well as echoed back to the user.
</p>
		<p>
Having compiled the program I have saved it as <code>collect.cgi</code>
into the directory for CGI scripts. Now a form like the following
can be used for data submissions:
</p>
		<pre>
				<code class="html">&lt;FORM ACTION="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/collect.cgi"<br /> METHOD="POST"&gt;<br />&lt;P&gt;Please type your input (80 chars max.):&lt;BR&gt;<br />&lt;INPUT NAME="data" SIZE="60" MAXLENGTH="80"&gt;&lt;BR&gt;<br />&lt;INPUT TYPE="SUBMIT" VALUE="Send"&gt;<br />&lt;/FORM&gt;<br /></code>
		</pre>
		<p>Finally, we can write
<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/viewdata.c">a simple program for viewing the data</a>;
it only needs to copy the content of a given text file onto
standard output:
</p>
		<pre>
				<code class="C">#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br />#define DATAFILE "../data/data.txt"<br />int main(void)<br />{<br />FILE *f = fopen(DATAFILE,"r");<br />int ch;<br />if(f == NULL) {<br />  printf("%s%c%c\n",<br />  "Content-Type:text/html;charset=iso-8859-1",13,10);<br />  printf("&lt;TITLE&gt;Failure&lt;/TITLE&gt;\n");<br />  printf("&lt;P&gt;&lt;EM&gt;Unable to open data file, sorry!&lt;/EM&gt;"); }<br />else {<br />  printf("%s%c%c\n",<br />  "Content-Type:text/plain;charset=iso-8859-1",13,10);<br />  while((ch=getc(f)) != EOF)<br />    putchar(ch);<br />  fclose(f); }<br />return 0;<br />}<br /></code>
		</pre>
		<p>Notice that this program prints (when succesful) the data
as plain text, preceded by a header which says this, i.e.
has <code>text/plain</code> instead of <code>text/html</code>.
</p>
		<p>
A form which invokes that program can be very simple, since
no input data is needed:
</p>
		<pre>
				<code class="html">&lt;FORM ACTION="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/viewdata.cgi"&gt;<br />&lt;P&gt;&lt;INPUT TYPE="SUBMIT" VALUE="View"&gt;<br />&lt;/FORM&gt;<br /></code>
		</pre>
		<p>Finally, here's what the two forms look like.
You can now test them:

</p>
		<h3>Form for submitting data</h3>
		<p>Please notice that anything you submit here will become
visible to the world:
</p>
		<form action="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/collect.cgi" method="post">
				<div>Please type your input (80 chars max.):<br /><input name="data" size="60" maxlength="80" /><br /><input value="Send" type="submit" /></div>
		</form>
		<h3>Form for checking submitted data</h3>
		<p>The content of the text file to which the submissions are
stored will be displayed as plain text.
</p>
		<form action="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/viewdata.cgi">
				<div>
						<input value="View" type="submit" />
				</div>
		</form>
		<hr title="Further reading" />
		<p>You may now wish to read
<a href="http://hoohoo.ncsa.uiuc.edu/cgi/interface.html"><cite>The CGI specification</cite></a>
which tells you all the basic details about CGI. The next step is
probably to see what the
<cite><a href="http://www.webthing.com/tutorials/cgifaq.html">CGI Programming FAQ</a></cite> contains.</p>
		<p>There is a lot of material, including
<a href="http://www.cgi-resources.com/Documentation/Introduction_to_CGI/">introductions</a> and
<a href="http://www.cgi-resources.com/Documentation/CGI_Tutorials/">tutorials</a>,
in the
<a href="http://www.cgi-resources.com/">CGI Resource Index</a>.
Notice in particular the section <a href="http://www.cgi-resources.com/Programs_and_Scripts/C_and_C++/Libraries_and_Classes/"><cite>Programs and Scripts: C and C++: Libraries and Classes</cite></a>
which contains libraries which can make it easier to process form data.
It can be instructive to parse simple data format by using code of
your own,
as was done in the simple examples above, 
but in practical application a library routine might be better.
</p>
		<hr title="Information about this document" />
		<div>
				<a title="ISO 8601, the date and time representation standard" href="http://www.cs.tut.fi/%7Ejkorpela/iso8601.html">
Date</a> of last update: 2001-04-15. Technical fix 2002-11-26.</div>
		<div class="footer">
This page belongs to division
<cite><a href="http://www.cs.tut.fi/%7Ejkorpela/www.html">Web authoring and surfing</a></cite>,
subdivision
<cite><a href="http://www.cs.tut.fi/%7Ejkorpela/forms/index.html">Forms</a></cite> in
the free information site
<cite><a href="http://www.cs.tut.fi/%7Ejkorpela/indexen.html">IT and communication</a></cite>
by
<a href="http://www.cs.tut.fi/%7Ejkorpela/personal.html" title="Jukka K. Korpela, an IT generalist and specialist (personal home page)">Jukka "Yucca" Korpela</a>.
</div>
<img src ="http://www.blogjava.net/soochow_hhb/aggbug/55055.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2006-06-26 08:41 <a href="http://www.blogjava.net/soochow_hhb/archive/2006/06/26/55055.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何操作控制面板 (control panel) 才能使p5服务器立即关机</title><link>http://www.blogjava.net/soochow_hhb/archive/2006/06/25/54988.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Sun, 25 Jun 2006 07:49:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2006/06/25/54988.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/54988.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2006/06/25/54988.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/54988.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/54988.html</trackback:ping><description><![CDATA[<BR>
<TABLE cellSpacing=3 cellPadding=4 width=590 border=0>
<TBODY>
<TR>
<TD vAlign=center align=middle width=59 bgColor=#d6e3f1><FONT face=宋体><B>环境</B></FONT></TD>
<TD align=left width=506 bgColor=#f0f0f0>
<P>平台：p520,p550,p570<BR></P></TD></TR>
<TR>
<TD vAlign=center align=middle width=59 bgColor=#d6e3f1><FONT face=宋体><B>问题</B></FONT></TD>
<TD align=left width=506 bgColor=#f0f0f0>
<P>p5服务器未接HMC, 由于某种原因系统无法登录了，需要重启服务器。此时按控制面板上的电源开关又不起作用，该怎么办？<BR></P></TD></TR>
<TR>
<TD vAlign=top align=middle width=59 bgColor=#d6e3f1 height=175><FONT face=宋体><B>解答</B></FONT></TD>
<TD vAlign=top align=left width=506 bgColor=#f0f0f0 height=175>
<P>使用控制面板上的功能8 ，可以使服务器立即关机。<BR>具体操作步骤：</P>
<P>a. 使用控制面板的 &lt;↑&gt; 或 &lt;↓&gt; 按钮选择功能2 <BR>面板显示如下<BR>02_ _ _ _ _ _ _ _ _ _ _ _ _ _<BR>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<BR>b. 按&lt; → &gt; 按钮 进入功能2，按&lt;→&gt; , 选中N, 使用&lt;↑&gt; 或 &lt;↓&gt; 按钮将 N(normal) 该成 M(maual)按2次&lt;→&gt; 退出 功能2. <BR>c. 用 &lt;↑&gt; 或 &lt;↓&gt; 按钮选择功能8 <BR>d. 按&lt;→&gt; 进入功能8，这时面板上显示 11 A1xx 8008 , 表示你选择了功能8。其中xx为0~9 或A~Z的任意字符<BR>e. 需要再一次进入功能8， 表示你确认要将服务器关机<BR>f. 等待，直到电源指示灯变成缓慢的闪烁状态，服务器就处于关机状态了。<BR>g. 按&lt; → &gt; 按钮 进入功能2，按&lt;→&gt; , 选中M, 使用&lt;↑&gt; 或 &lt;↓&gt; 按钮将 M该成 N按2次&lt;→&gt; 退出 功能2.<BR>h. 选择功能1 ，进入正常的操作模式</P></TD></TR></TBODY></TABLE><BR>转自：<A href="http://www-900.ibm.com/cn/support/viewdoc/detail?DocId=1811996B22000">http://www-900.ibm.com/cn/support/viewdoc/detail?DocId=1811996B22000</A><img src ="http://www.blogjava.net/soochow_hhb/aggbug/54988.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2006-06-25 15:49 <a href="http://www.blogjava.net/soochow_hhb/archive/2006/06/25/54988.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VNC的使用</title><link>http://www.blogjava.net/soochow_hhb/archive/2006/06/23/54744.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Fri, 23 Jun 2006 09:34:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2006/06/23/54744.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/54744.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2006/06/23/54744.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/54744.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/54744.html</trackback:ping><description><![CDATA[
		<strong>『VNC简介』</strong>
		<br />　　网络遥控技术是指由一部计算机（主控端）去控制另一部计算机（被控端），而且当主控端在控制端时，就如同用户亲自坐在被控端前操作一样，可以执行被控端的应用程序，及使用被控端的系统资源。 <br />　　VNC（Virtual Network Computing）是一套由AT&amp;T实验室所开发的可操控远程的计算机的软件，其采用了GPL授权条款，任何人都可免费取得该软件。VNC软件主要由两个部分组成：VNC server及VNC viewer。用户需先将VNC server安装在被控端的计算机上后，才能在主控端执行VNC viewer控制被控端。 <br />　　（在windows中也由一套著名的网络遥控软件――Symantec公司推出的pcAnywhere。 <br />　　VNC server与VNC viewer支持多种操作系统，如Unix系列（Unix，Linux，Solaris等），windows及MacOS，因此可将VNC server 及VNC viewer分别安装在不同的操作系统中进行控制。如果目前操作的主控端计算机没有安装VNC viewer，也可以通过一般的网页浏览器来控制被控端。 <br />　　整个VNC运行的工作流程如下： <br />　　（1） VNC客户端通过浏览器或VNC Viewer连接至VNC Server。 <br />　　（2） VNC Server传送一对话窗口至客户端，要求输入连接密码，以及存取的VNC Server显示装置。 <br />　　（3） 在客户端输入联机密码后，VNC Server验证客户端是否具有存取权限。 <br />　　（4） 若是客户端通过VNC Server的验证，客户端即要求VNC Server显示桌面环境。 <br />　　（5） VNC Server通过X Protocol 要求X Server将画面显示控制权交由VNC Server负责。 <br />　　（6） VNC Server将来由 X Server的桌面环境利用VNC通信协议送至客户端，并且允许客户端控制VNC Server的桌面环境及输入装置。 <br />　　<br />　　<b>『VNC的安装与使用』</b><br />　　本人的操作环境：被控端 Redhat8.0，主控端Windows XP。 <br />　　1． 载VNC Server与VNC viewer. <br />　　VNC Server下载地址：http://www.linuxeden.com/download/softdetail.php?softid=744 <br />　　VNC viewer下载地址：http://download.pchome.net/php/dl.php?sid=2603 <br />　　2．安装。 <br />　　rpm –Uvh vnc-3.3.6-2.i386.rpm (如果是源代码请看包里的说明) <br />　　安装winvnc.exe <br />　　3.在Linux上启动VNC Server <br />　　执行vncserver命令： <br />　　[root@linux root]# vncserver <br />　　You will require a password to access your desktops. <br />　　Password: ----为了不想任何人都可以任意遥控此计算机。因此当第 <br />　　Verify: ---1次启动VNC server时，会要求设置网络遥控的密码。 <br />　　New ‘X’ desktop is linux:1 ----一定要记住这一行稍后会用到。 <br />　　Creating default startup script /root/.vnc/xstartup <br />　　Starting applications specified in /root/.vnc/xstartup <br />　　Log file is /root/.vnc/linux:1.log <br />　　（经上述步骤后，便已启动了VNC Server。如果你想要更改VNC Server的密码，只要执行vncpasswd命令即可。） <br />　　4．在Microsoft Windows上运行VNC Viewer <br />　　直接运行“vncviewer.exe”,系统会出现”Connection details”对话框。 <br />　　在“Connection details”对话框中的“VNC server”文本框中输入VNC Server的IP地址（或主机名及显示装置编号，（请看3。在Linux上启动VNC server的这一行，New ‘X’ desktop is linux:1 得到此信息），例如：192.168.0.1：1（冒号后面的1是执行VNC Server生成的显示装置编号），单击“OK”按钮后，VNC Server即会开始检查所输入的信息，若是信息错误，系统会出现“Failed to connect to server”的错误信息：若是信息正确，则会接着出现“VNC Authentication”对话框。 <br />　　若是在“VNC Authentication”对话框中输入的密码正确，就可以成功地打开Linux的桌面窗口。 <br />　　5. 从浏览器远程遥控。 <br />　　启动VNC Server 后直接打开浏览器，在地址栏中输入被控端的网址或IP地址，并在网址后加上“：5800＋显示编号”的端口号即可操控该计算机。 <br />　　例如：http://192.168.01.:5801 (如果显示编号为1，一般第一次设置的显示编号都是1，就用5800＋1＝5801。) <br />　　<br />　　6．FAQ <br />　　A．为什么连接后，不能显示桌面，而只有一个Terminal窗口？ <br />　　试着修改/root/.vnc/xstartup,把最后一行 twm&amp; 改成 gnome-session&amp; or kde&amp;(据说KDE在目前的VNC Viewer上的表现不太稳定) <br />　　<br />　　B． 为什么重新启动VNC Server后，连接不上了？ <br />　　因为重新启动VNC Server时，系统会指定一个新的显示编号，需使用此新的编号，否则就无法连接。 <img src ="http://www.blogjava.net/soochow_hhb/aggbug/54744.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2006-06-23 17:34 <a href="http://www.blogjava.net/soochow_hhb/archive/2006/06/23/54744.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>创业报告——在科技园和大学创业基地揭牌仪式上</title><link>http://www.blogjava.net/soochow_hhb/archive/2006/06/23/54675.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Fri, 23 Jun 2006 06:52:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2006/06/23/54675.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/54675.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2006/06/23/54675.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/54675.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/54675.html</trackback:ping><description><![CDATA[
		<p>创业报告——在科技园和大学创业基地揭牌仪式上 2006年05月31日于吴中科技创业园报告厅<br /><br />非常高兴收到朱总的邀请，在科技园和苏州大学共建大学生创业基地揭牌仪式上做创业报告，实际创业几个月来，也有很多感悟，另外可以看到现在社会和学习都很重视创业，学生也很想创业，但是创业需要很多东西。<br />首先就是勇气，如果没有勇气迈出第一步，没有一个好的开始，创业之路就没法开始；两外要有机会，但是机会这东西，不是你想要就来的，需要你自己去寻找，去等待，去准备，也就是需要找到一个创业的突破口，以此开始你的创业之路；再者需要组建一个好的创业团队，寻找那么一些人，能精诚合作，能同甘共苦，能互相补充，能有所想法。但是这三者那个是容易的啊！所以创业的开始就已经有些障碍了。<br /><br /><img src="http://www.blogjava.net/images/blogjava_net/soochow_hhb/12451/r_1.JPG" /><br /><br /></p>
<img src ="http://www.blogjava.net/soochow_hhb/aggbug/54675.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2006-06-23 14:52 <a href="http://www.blogjava.net/soochow_hhb/archive/2006/06/23/54675.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>