锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲色大成网站www,亚洲综合精品网站在线观看,亚洲第一第二第三第四第五第六http://www.tkk7.com/freddychu/category/4012.html灝咼ava榪涜鍒板簳zh-cnTue, 27 Feb 2007 10:24:58 GMTTue, 27 Feb 2007 10:24:58 GMT60杞細sql浼樺寲 http://www.tkk7.com/freddychu/archive/2006/03/04/33624.html椋庤惂钀?/dc:creator>椋庤惂钀?/author>Sat, 04 Mar 2006 12:34:00 GMThttp://www.tkk7.com/freddychu/archive/2006/03/04/33624.htmlhttp://www.tkk7.com/freddychu/comments/33624.htmlhttp://www.tkk7.com/freddychu/archive/2006/03/04/33624.html#Feedback0http://www.tkk7.com/freddychu/comments/commentRss/33624.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/33624.htmlSql浼樺寲鏄竴欏瑰鏉傜殑宸ヤ綔錛屼互涓嬬殑涓浜涘熀鏈師鍒欐槸鏈漢鐪嬩功鏃舵墍璁板綍涓嬫潵鐨勶紝寰堟槑紜笖娌′粈涔堝簾璇濓細

1錛?/FONT>  绱㈠紩鐨勪嬌鐢細

錛?/SPAN>1錛?/SPAN>.褰撴彃鍏ョ殑鏁版嵁涓烘暟鎹〃涓殑璁板綍鏁伴噺鐨?/SPAN>10%浠ヤ笂錛岄鍏堥渶瑕佸垹闄よ琛ㄧ殑绱㈠紩鏉ユ彁楂樻暟鎹殑鎻掑叆鏁堢巼錛屽綋鏁版嵁鎻掑叆鍚庯紝鍐嶅緩绔嬬儲寮曘?/SPAN>

錛?/SPAN>2錛?/SPAN>.閬垮厤鍦ㄧ儲寮曞垪涓婁嬌鐢ㄥ嚱鏁版垨璁$畻錛屽湪where瀛愬彞涓紝濡傛灉绱㈠紩鏄嚱鏁扮殑涓閮ㄥ垎錛屼紭鍖栧櫒灝嗕笉鍐嶄嬌鐢ㄧ儲寮曡屼嬌鐢ㄥ叏琛ㄦ壂鎻忋傚錛?/SPAN>

浣庢晥錛?/SPAN>select * from dept where sal*12 >2500;

楂樻晥錛?/SPAN>select * from dept where sal>2500/12;

(3).閬垮厤鍦ㄧ儲寮曞垪涓婁嬌鐢?/SPAN>not鍜?/SPAN> 鈥?/SPAN>!=鈥濓紝绱㈠紩鍙兘鍛婅瘔浠涔堝瓨鍦ㄤ簬琛ㄤ腑錛岃屼笉鑳藉憡璇変粈涔堜笉瀛樺湪浜庤〃涓紝褰撴暟鎹簱閬囧埌not 鍜?/SPAN> 鈥?/SPAN>!=鈥濇椂錛屽氨浼氬仠姝嬌鐢ㄧ儲寮曡屽幓鎵ц鍏ㄨ〃鎵弿銆?/SPAN>

(4).绱㈠紩鍒椾笂>=浠f浛>

 浣庢晥錛?/SPAN>select * from emp where deptno > 3

 楂樻晥錛?/SPAN>select * from emp where deptno >=4

涓よ呯殑鍖哄埆鍦ㄤ簬錛屽墠鑰?/SPAN>dbms灝嗙洿鎺ヨ煩鍒扮涓涓?/SPAN>deptno絳変簬4鐨勮褰曪紝鑰屽悗鑰呭皢棣栧厛瀹氫綅鍒?/SPAN>deptno絳変簬3鐨勮褰曞茍涓斿悜鍓嶆壂鎻忓埌絎竴涓?/SPAN>deptno澶т簬3鐨勩?/SPAN>

(5).闈炶瀵逛竴涓嬌鐢ㄥ嚱鏁扮殑鍒楀惎鐢ㄧ儲寮曪紝鍩轟簬鍑芥暟鐨勭儲寮曟槸涓涓緝濂界殑鏂規銆?/SPAN>

2. 娓告爣鐨勪嬌鐢細

   褰撳湪嫻烽噺鐨勬暟鎹〃涓繘琛屾暟鎹殑鍒犻櫎銆佹洿鏂般佹彃鍏ユ搷浣滄椂錛岀敤娓告爣澶勭悊鐨勬晥鐜囨槸鏈鎱㈢殑錛屼絾鏄父鏍囧張鏄繀涓嶅彲灝戠殑錛屾墍浠ユ紜嬌鐢ㄦ父鏍囧崄鍒嗛噸瑕侊細

   (1). 鍦ㄦ暟鎹娊鍙栫殑婧愯〃涓嬌鐢ㄦ椂闂存埑錛岃繖鏍鋒瘡澶╃殑緇磋〃鏁版嵁緇存姢鍙拡瀵規洿鏂版棩鏈熶負鏈鏂版椂闂寸殑鏁版嵁鏉ヨ繘琛岋紝澶уぇ鍑忓皯闇瑕佺淮鎶ょ殑鏁版嵁璁板綍鏁般?/SPAN>

   (2). 鍦?/SPAN>insert鍜?/SPAN>update緇磋〃鏃墮兘鍔犱笂涓涓潯浠舵潵榪囨護緇磋〃涓凡緇忓瓨鍦ㄧ殑璁板綍錛屼緥濡傦細

insert into dim_customer select * from ods_customer where ods_customer.code not exists (dim_customer.code)

 ods_customer涓烘暟鎹簮琛ㄣ?/SPAN>dim_customer涓虹淮琛ㄣ?/SPAN>

   (3). 浣跨敤鏄懼紡鐨勬父鏍囷紝鍥犱負闅愬紡鐨勬父鏍囧皢浼氭墽琛屼袱嬈℃搷浣滐紝絎竴嬈℃绱㈣褰曪紝絎簩嬈℃鏌?/SPAN>too many rows榪欎釜exception,鑰屾樉寮忔父鏍囦笉鎵ц絎簩嬈℃搷浣溿?/SPAN>

3錛?/FONT>  鎹娊鍙栧拰涓婅澆鏃剁殑sql浼樺寲錛?/SPAN>

(1). Where 瀛愬彞涓殑榪炴帴欏哄簭錛?/SPAN>

oracle閲囩敤鑷笅鑰屼笂鐨勯『搴忚В鏋?/SPAN>where瀛愬彞錛屾牴鎹繖涓師鐞嗭紝琛ㄤ箣闂寸殑榪炴帴蹇呴』鍐欏湪鍏朵粬where鏉′歡涔嬪墠錛岄偅浜涘彲浠ヨ繃婊ゆ帀澶ч噺璁板綍鐨勬潯浠跺繀欏誨啓鍦?/SPAN>where瀛愬彞鐨勬湯灝俱傚錛?/SPAN>

浣庢晥錛?/SPAN>select * from emp e where sal>5000 and job = 鈥榤anager鈥?and 25<(select count (*) from emp where mgr=e.empno);

楂樻晥錛?/SPAN>select * from emp e where 25<(select count(*) from emp where mgr=e.empno) and sal>5000 and job=鈥檓anager鈥?

   (2). 鍒犻櫎鍏ㄨ〃鏃訛紝鐢?/SPAN>truncate 鏇夸唬 delete,鍚屾椂娉ㄦ剰truncate鍙兘鍦ㄥ垹闄ゅ叏琛ㄦ椂閫傜敤錛屽洜涓?/SPAN>truncate鏄?/SPAN>ddl鑰屼笉鏄?/SPAN>dml銆?/SPAN>

   (3). 灝介噺澶氫嬌鐢?/SPAN>commit

鍙鏈夊彲鑳藉氨鍦ㄧ▼搴忎腑瀵規瘡涓?/SPAN>delete,insert,update鎿嶄綔灝介噺澶氫嬌鐢?/SPAN>commit,榪欐牱緋葷粺鎬ц兘浼氬洜涓?/SPAN>commit鎵閲婃斁鐨勮祫婧愯屽ぇ澶ф彁楂樸?/SPAN>

   (4). 鐢?/SPAN>exists鏇夸唬in 錛屽彲浠ユ彁楂樻煡璇㈢殑鏁堢巼銆?/SPAN>

   (5). 鐢?/SPAN>not exists 鏇夸唬 not in

   (6). 浼樺寲group by

鎻愰珮group by璇彞鐨勬晥鐜囷紝鍙互灝嗕笉闇瑕佺殑璁板綍鍦?/SPAN>group by涔嬪墠榪囨護鎺夈傚錛?/SPAN>

浣庢晥錛?/SPAN>select job, avg(sal) from emp group by job having job = 鈥榩resident鈥?or job=鈥檓anager鈥?

楂樻晥錛?/SPAN> select job, avg(sal) from emp having  job=鈥檖resident鈥?or job=鈥檓anager鈥?group by job;

   (7). 鏈夋潯浠剁殑浣跨敤union-all 鏇夸唬 union錛氳繖鏍峰仛鎺掑簭灝變笉蹇呰浜嗭紝鏁堢巼浼氭彁楂?/SPAN>3鍒?/SPAN>5鍊嶃?/SPAN>

   (8). 鍒嗙琛ㄥ拰绱㈠紩

       鎬繪槸灝嗕綘鐨勮〃鍜岀儲寮曞緩绔嬪湪涓嶅悓鐨勮〃絀洪棿鍐咃紝鍐充笉瑕佸皢涓嶅睘浜?/SPAN>oracle鍐呴儴緋葷粺鐨勫璞″瓨鏀懼埌system琛ㄧ┖闂村唴銆傚悓鏃剁‘淇濇暟鎹〃絀洪棿鍜岀儲寮曡〃絀洪棿緗簬涓嶅悓鐨勭‖鐩樻帶鍒跺崱鎺у埗鐨勭‖鐩樹笂銆?/SPAN>


杞嚜錛?A >http://blog.csdn.net/eigo/archive/2006/03/02/614157.aspx

]]>
杞細鏁版嵁搴撶瑪璇曢 http://www.tkk7.com/freddychu/archive/2006/03/04/33623.html椋庤惂钀?/dc:creator>椋庤惂钀?/author>Sat, 04 Mar 2006 12:31:00 GMThttp://www.tkk7.com/freddychu/archive/2006/03/04/33623.htmlhttp://www.tkk7.com/freddychu/comments/33623.htmlhttp://www.tkk7.com/freddychu/archive/2006/03/04/33623.html#Feedback0http://www.tkk7.com/freddychu/comments/commentRss/33623.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/33623.html/*
寤鴻〃錛?BR>dept:
 deptno(primary key),dname,loc
emp:
 empno(primary key),ename,job,mgr,sal,deptno
*/

1 鍒楀嚭emp琛ㄤ腑鍚勯儴闂ㄧ殑閮ㄩ棬鍙鳳紝鏈楂樺伐璧勶紝鏈浣庡伐璧?BR>select max(sal) as 鏈楂樺伐璧?min(sal) as 鏈浣庡伐璧?deptno from emp group by deptno;

2 鍒楀嚭emp琛ㄤ腑鍚勯儴闂╦ob涓?CLERK'鐨勫憳宸ョ殑鏈浣庡伐璧勶紝鏈楂樺伐璧?BR>select max(sal) as 鏈楂樺伐璧?min(sal) as 鏈浣庡伐璧?deptno as 閮ㄩ棬鍙?from emp where job = 'CLERK' group by deptno;

3 瀵逛簬emp涓渶浣庡伐璧勫皬浜?000鐨勯儴闂紝鍒楀嚭job涓?CLERK'鐨勫憳宸ョ殑閮ㄩ棬鍙鳳紝鏈浣庡伐璧勶紝鏈楂樺伐璧?BR>select max(sal) as 鏈楂樺伐璧?min(sal) as 鏈浣庡伐璧?deptno as 閮ㄩ棬鍙?from emp as b
where job='CLERK' and 1000>(select min(sal) from emp as a where a.deptno=b.deptno) group by b.deptno

4 鏍規嵁閮ㄩ棬鍙風敱楂樿屼綆錛屽伐璧勬湁浣庤岄珮鍒楀嚭姣忎釜鍛樺伐鐨勫鍚嶏紝閮ㄩ棬鍙鳳紝宸ヨ祫
select deptno as 閮ㄩ棬鍙?ename as 濮撳悕,sal as 宸ヨ祫 from emp order by deptno desc,sal asc

5 鍐欏嚭瀵逛笂棰樼殑鍙︿竴瑙e喅鏂規硶
錛堣琛ュ厖錛?/P>

6 鍒楀嚭'寮犱笁'鎵鍦ㄩ儴闂ㄤ腑姣忎釜鍛樺伐鐨勫鍚嶄笌閮ㄩ棬鍙?BR>select ename,deptno from emp where deptno = (select deptno from emp where ename = '寮犱笁')

7 鍒楀嚭姣忎釜鍛樺伐鐨勫鍚嶏紝宸ヤ綔錛岄儴闂ㄥ彿錛岄儴闂ㄥ悕
select ename,job,emp.deptno,dept.dname from emp,dept where emp.deptno=dept.deptno

8 鍒楀嚭emp涓伐浣滀負'CLERK'鐨勫憳宸ョ殑濮撳悕錛屽伐浣滐紝閮ㄩ棬鍙鳳紝閮ㄩ棬鍚?BR>select ename,job,dept.deptno,dname from emp,dept where dept.deptno=emp.deptno and job='CLERK'

9 瀵逛簬emp涓湁綆$悊鑰呯殑鍛樺伐錛屽垪鍑哄鍚嶏紝綆$悊鑰呭鍚嶏紙綆$悊鑰呭閿負mgr錛?BR>select a.ename as 濮撳悕,b.ename as 綆$悊鑰?from emp as a,emp as b where a.mgr is not null and a.mgr=b.empno

10 瀵逛簬dept琛ㄤ腑錛屽垪鍑烘墍鏈夐儴闂ㄥ悕錛岄儴闂ㄥ彿錛屽悓鏃跺垪鍑哄悇閮ㄩ棬宸ヤ綔涓?CLERK'鐨勫憳宸ュ悕涓庡伐浣?BR>select dname as 閮ㄩ棬鍚?dept.deptno as 閮ㄩ棬鍙?ename as 鍛樺伐鍚?job as 宸ヤ綔 from dept,emp
where dept.deptno *= emp.deptno and job = 'CLERK'

11 瀵逛簬宸ヨ祫楂樹簬鏈儴闂ㄥ鉤鍧囨按騫崇殑鍛樺伐錛屽垪鍑洪儴闂ㄥ彿錛屽鍚嶏紝宸ヨ祫錛屾寜閮ㄩ棬鍙鋒帓搴?BR>select a.deptno as 閮ㄩ棬鍙?a.ename as 濮撳悕,a.sal as 宸ヨ祫 from emp as a
where a.sal>(select avg(sal) from emp as b where a.deptno=b.deptno) order by a.deptno

12 瀵逛簬emp錛屽垪鍑哄悇涓儴闂ㄤ腑騫沖潎宸ヨ祫楂樹簬鏈儴闂ㄥ鉤鍧囨按騫崇殑鍛樺伐鏁板拰閮ㄩ棬鍙鳳紝鎸夐儴闂ㄥ彿鎺掑簭
select count(a.sal) as 鍛樺伐鏁?a.deptno as 閮ㄩ棬鍙?from emp as a
where a.sal>(select avg(sal) from emp as b where a.deptno=b.deptno) group by a.deptno order by a.deptno

13 瀵逛簬emp涓伐璧勯珮浜庢湰閮ㄩ棬騫沖潎姘村鉤錛屼漢鏁板涓?浜虹殑錛屽垪鍑洪儴闂ㄥ彿錛屼漢鏁幫紝鎸夐儴闂ㄥ彿鎺掑簭
select count(a.empno) as 鍛樺伐鏁?a.deptno as 閮ㄩ棬鍙?avg(sal) as 騫沖潎宸ヨ祫 from emp as a
where (select count(c.empno) from emp as c where c.deptno=a.deptno and c.sal>(select avg(sal) from emp as b where c.deptno=b.deptno))>1
group by a.deptno order by a.deptno

14 瀵逛簬emp涓綆浜庤嚜宸卞伐璧勮嚦灝?浜虹殑鍛樺伐錛屽垪鍑哄叾閮ㄩ棬鍙鳳紝濮撳悕錛屽伐璧勶紝浠ュ強宸ヨ祫灝戜簬鑷繁鐨勪漢鏁?BR>select a.deptno,a.ename,a.sal,(select count(b.ename) from emp as b where b.sal<a.sal) as 浜烘暟 from emp as a
where (select count(b.ename) from emp as b where b.sal<a.sal)>5


杞嚜錛?A >http://blog.csdn.net/woolceo/archive/2006/03/02/614094.aspx



]]>
鍦ㄩ儴緗睵ORTAL欏圭洰鏃訛紝閬囧埌寮傚父錛孯epoExceptionTextFormatter ClassNotFound http://www.tkk7.com/freddychu/archive/2006/02/15/30886.html椋庤惂钀?/dc:creator>椋庤惂钀?/author>Wed, 15 Feb 2006 15:14:00 GMThttp://www.tkk7.com/freddychu/archive/2006/02/15/30886.htmlhttp://www.tkk7.com/freddychu/comments/30886.htmlhttp://www.tkk7.com/freddychu/archive/2006/02/15/30886.html#Feedback0http://www.tkk7.com/freddychu/comments/commentRss/30886.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/30886.htmlException:weblogic.management.ApplicationException: prepare failed for content_repo.jar Module: content_repo.jar Error: Exception preparing module: EJBModule(content_repo.jar,status=NEW) Unable to deploy EJB: content_repo.jar from content_repo.jar: Class not found: com.bea.content.repo.i18n.RepoExceptionTextFormatter java.lang.NoClassDefFoundError: Class not found: com.bea.content.repo.i18n.RepoExceptionTextFormatter at weblogic.ejb20.compliance.EJBComplianceChecker.check([Ljava.lang.Object;)V(EJBComplianceChecker.java:287)

鎴戝湪weblogic81 sp3鐨刣oc涓病鏈夊彂鐜癱om.bea.content.repo.i18n榪欎釜package.

閲嶆柊瀹夎浜唚eblogic sp4錛屽氨涓嶅啀鍑虹幇榪欎釜閿欒浜嗐?img src ="http://www.tkk7.com/freddychu/aggbug/30886.html" width = "1" height = "1" />

]]>
GOOGLE鎸戞垬璧涚粌涔犻3鍙婄瓟妗?/title><link>http://www.tkk7.com/freddychu/archive/2005/11/27/21591.html</link><dc:creator>椋庤惂钀?/dc:creator><author>椋庤惂钀?/author><pubDate>Sun, 27 Nov 2005 15:42:00 GMT</pubDate><guid>http://www.tkk7.com/freddychu/archive/2005/11/27/21591.html</guid><wfw:comment>http://www.tkk7.com/freddychu/comments/21591.html</wfw:comment><comments>http://www.tkk7.com/freddychu/archive/2005/11/27/21591.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.tkk7.com/freddychu/comments/commentRss/21591.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/freddychu/services/trackbacks/21591.html</trackback:ping><description><![CDATA[<TABLE> <TBODY> <TR> <TD colSpan=2> <H3>Problem Statement </H3></TD></TR> <TR> <TD>     </TD> <TD>When editing a single line of text, there are four keys that can be used to move the cursor: end, home, left-arrow and right-arrow. As you would expect, left-arrow and right-arrow move the cursor one character left or one character right, unless the cursor is at the beginning of the line or the end of the line, respectively, in which case the keystrokes do nothing (the cursor does not wrap to the previous or next line). The home key moves the cursor to the beginning of the line, and the end key moves the cursor to the end of the line.<BR><BR>You will be given a int, <B>N</B>, representing the number of character in a line of text. The cursor is always between two adjacent characters, at the beginning of the line, or at the end of the line. It starts before the first character, at position 0. The position after the last character on the line is position <B>N</B>. You should simulate a series of keystrokes and return the final position of the cursor. You will be given a String where characters of the String represent the keystrokes made, in order. 'L' and 'R' represent left and right, while 'H' and 'E' represent home and end. </TD></TR> <TR> <TD colSpan=2> <H3>Definition </H3></TD></TR> <TR> <TD>     </TD> <TD> <TABLE> <TBODY> <TR> <TD>Class: </TD> <TD>CursorPosition </TD></TR> <TR> <TD>Method: </TD> <TD>getPosition </TD></TR> <TR> <TD>Parameters: </TD> <TD>String, int </TD></TR> <TR> <TD>Returns: </TD> <TD>int </TD></TR> <TR> <TD>Method signature: </TD> <TD>int getPosition(String keystrokes, int N) </TD></TR> <TR> <TD colSpan=2>(be sure your method is public) </TD></TR></TBODY></TABLE></TD></TR> <TR> <TD>     </TD></TR> <TR> <TD></TD></TR> <TR> <TD colSpan=2> <H3>Constraints </H3></TD></TR> <TR> <TD vAlign=top align=middle>- </TD> <TD><B>keystrokes</B> will be contain between 1 and 50 'L', 'R', 'H', and 'E' characters, inclusive. </TD></TR> <TR> <TD vAlign=top align=middle>- </TD> <TD><B>N</B> will be between 1 and 100, inclusive. </TD></TR> <TR> <TD colSpan=2> <H3>Examples </H3></TD></TR> <TR> <TD noWrap align=middle>0) </TD> <TD></TD></TR> <TR> <TD>     </TD> <TD> <TABLE> <TBODY> <TR> <TD> <TABLE> <TBODY> <TR> <TD><PRE>"ERLLL"</PRE></TD></TR> <TR> <TD><PRE>10</PRE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD><PRE>Returns: 7</PRE></TD></TR> <TR> <TD> <TABLE> <TBODY> <TR> <TD colSpan=2>First, we go to the end of the line at position 10. Then, the right-arrow does nothing because we are already at the end of the line. Finally, three left-arrows brings us to position 7. </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD noWrap align=middle>1) </TD> <TD></TD></TR> <TR> <TD>     </TD> <TD> <TABLE> <TBODY> <TR> <TD> <TABLE> <TBODY> <TR> <TD><PRE>"EHHEEHLLLLRRRRRR"</PRE></TD></TR> <TR> <TD><PRE>2</PRE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD><PRE>Returns: 2</PRE></TD></TR> <TR> <TD> <TABLE> <TBODY> <TR> <TD colSpan=2>All the right-arrows at the end ensure that we end up at the end of the line. </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD noWrap align=middle>2) </TD> <TD></TD></TR> <TR> <TD>     </TD> <TD> <TABLE> <TBODY> <TR> <TD> <TABLE> <TBODY> <TR> <TD><PRE>"ELLLELLRRRRLRLRLLLRLLLRLLLLRLLRRRL"</PRE></TD></TR> <TR> <TD><PRE>10</PRE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD><PRE>Returns: 3</PRE></TD></TR> <TR> <TD></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD noWrap align=middle>3) </TD> <TD></TD></TR> <TR> <TD>     </TD> <TD> <TABLE> <TBODY> <TR> <TD> <TABLE> <TBODY> <TR> <TD><PRE>"RRLEERLLLLRLLRLRRRLRLRLRLRLLLLL"</PRE></TD></TR> <TR> <TD><PRE>19</PRE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD><PRE>Returns: 12</PRE></TD></TR> <TR> <TD></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> <HR> <P>This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved. <BR><BR>絳旀錛?BR><BR><BR></P> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #008080"> 1</SPAN><IMG src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 2</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_29_699_Open_Image onclick="this.style.display='none'; Codehighlighter1_29_699_Open_Text.style.display='none'; Codehighlighter1_29_699_Closed_Image.style.display='inline'; Codehighlighter1_29_699_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_29_699_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_29_699_Closed_Text.style.display='none'; Codehighlighter1_29_699_Open_Image.style.display='inline'; Codehighlighter1_29_699_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> CursorPosition </SPAN><SPAN id=Codehighlighter1_29_699_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_29_699_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080"> 3</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_80_471_Open_Image onclick="this.style.display='none'; Codehighlighter1_80_471_Open_Text.style.display='none'; Codehighlighter1_80_471_Closed_Image.style.display='inline'; Codehighlighter1_80_471_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_80_471_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_80_471_Closed_Text.style.display='none'; Codehighlighter1_80_471_Open_Image.style.display='inline'; Codehighlighter1_80_471_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> getPosition(String keystrokes, </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> N)</SPAN><SPAN id=Codehighlighter1_80_471_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_80_471_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080"> 4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> position </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080"> 5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        String s </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080"> 6</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_165_447_Open_Image onclick="this.style.display='none'; Codehighlighter1_165_447_Open_Text.style.display='none'; Codehighlighter1_165_447_Closed_Image.style.display='inline'; Codehighlighter1_165_447_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_165_447_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_165_447_Closed_Text.style.display='none'; Codehighlighter1_165_447_Open_Image.style.display='inline'; Codehighlighter1_165_447_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> i </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">; i </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000"> keystrokes.length(); i</SPAN><SPAN style="COLOR: #000000">++</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN id=Codehighlighter1_165_447_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_165_447_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080"> 7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>            s </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> keystrokes.substring(i, i</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080"> 8</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_224_277_Open_Image onclick="this.style.display='none'; Codehighlighter1_224_277_Open_Text.style.display='none'; Codehighlighter1_224_277_Closed_Image.style.display='inline'; Codehighlighter1_224_277_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_224_277_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_224_277_Closed_Text.style.display='none'; Codehighlighter1_224_277_Open_Image.style.display='inline'; Codehighlighter1_224_277_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>            </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">L</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">.equals(s))</SPAN><SPAN id=Codehighlighter1_224_277_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_224_277_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080"> 9</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>                </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(position </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">) </SPAN><SPAN style="COLOR: #0000ff">continue</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>                position</SPAN><SPAN style="COLOR: #000000">--</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_299_352_Open_Image onclick="this.style.display='none'; Codehighlighter1_299_352_Open_Text.style.display='none'; Codehighlighter1_299_352_Closed_Image.style.display='inline'; Codehighlighter1_299_352_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_299_352_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_299_352_Closed_Text.style.display='none'; Codehighlighter1_299_352_Open_Image.style.display='inline'; Codehighlighter1_299_352_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>            </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">R</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">.equals(s))</SPAN><SPAN id=Codehighlighter1_299_352_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_299_352_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>                </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(position </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000"> N) </SPAN><SPAN style="COLOR: #0000ff">continue</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>                position</SPAN><SPAN style="COLOR: #000000">++</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">16</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_374_397_Open_Image onclick="this.style.display='none'; Codehighlighter1_374_397_Open_Text.style.display='none'; Codehighlighter1_374_397_Closed_Image.style.display='inline'; Codehighlighter1_374_397_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_374_397_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_374_397_Closed_Text.style.display='none'; Codehighlighter1_374_397_Open_Image.style.display='inline'; Codehighlighter1_374_397_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>            </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">H</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">.equals(s))</SPAN><SPAN id=Codehighlighter1_374_397_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_374_397_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">17</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>                position </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">18</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">19</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_419_442_Open_Image onclick="this.style.display='none'; Codehighlighter1_419_442_Open_Text.style.display='none'; Codehighlighter1_419_442_Closed_Image.style.display='inline'; Codehighlighter1_419_442_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_419_442_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_419_442_Closed_Text.style.display='none'; Codehighlighter1_419_442_Open_Image.style.display='inline'; Codehighlighter1_419_442_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>            </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">E</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">.equals(s))</SPAN><SPAN id=Codehighlighter1_419_442_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_419_442_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">20</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>                position </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> N;<BR></SPAN><SPAN style="COLOR: #008080">21</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">22</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">23</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">24</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">25</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> position;<BR></SPAN><SPAN style="COLOR: #008080">26</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">27</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">28</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_474_497_Open_Image onclick="this.style.display='none'; Codehighlighter1_474_497_Open_Text.style.display='none'; Codehighlighter1_474_497_Closed_Image.style.display='inline'; Codehighlighter1_474_497_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_474_497_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_474_497_Closed_Text.style.display='none'; Codehighlighter1_474_497_Open_Image.style.display='inline'; Codehighlighter1_474_497_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_474_497_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/** */</SPAN><SPAN id=Codehighlighter1_474_497_Open_Text><SPAN style="COLOR: #008000">/**</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008080">29</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>     * </SPAN><SPAN style="COLOR: #808080">@param</SPAN><SPAN style="COLOR: #008000"> args<BR></SPAN><SPAN style="COLOR: #008080">30</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>     </SPAN><SPAN style="COLOR: #008000">*/</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">31</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_539_696_Open_Image onclick="this.style.display='none'; Codehighlighter1_539_696_Open_Text.style.display='none'; Codehighlighter1_539_696_Closed_Image.style.display='inline'; Codehighlighter1_539_696_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_539_696_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_539_696_Closed_Text.style.display='none'; Codehighlighter1_539_696_Open_Image.style.display='inline'; Codehighlighter1_539_696_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000"> main(String[] args) </SPAN><SPAN id=Codehighlighter1_539_696_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_539_696_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">32</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        CursorPosition cursorPosition </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> CursorPosition();<BR></SPAN><SPAN style="COLOR: #008080">33</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> cursor </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> cursorPosition.getPosition(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ERLLL</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="COLOR: #000000">10</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080">34</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">cursor:</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> cursor);<BR></SPAN><SPAN style="COLOR: #008080">35</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">36</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">37</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">38</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV><img src ="http://www.tkk7.com/freddychu/aggbug/21591.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/freddychu/" target="_blank">椋庤惂钀?/a> 2005-11-27 23:42 <a href="http://www.tkk7.com/freddychu/archive/2005/11/27/21591.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>GOOGLE鎸戞垬璧涚粌涔犻2鍙婄瓟妗?/title><link>http://www.tkk7.com/freddychu/archive/2005/11/27/21589.html</link><dc:creator>椋庤惂钀?/dc:creator><author>椋庤惂钀?/author><pubDate>Sun, 27 Nov 2005 15:40:00 GMT</pubDate><guid>http://www.tkk7.com/freddychu/archive/2005/11/27/21589.html</guid><wfw:comment>http://www.tkk7.com/freddychu/comments/21589.html</wfw:comment><comments>http://www.tkk7.com/freddychu/archive/2005/11/27/21589.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/freddychu/comments/commentRss/21589.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/freddychu/services/trackbacks/21589.html</trackback:ping><description><![CDATA[<TABLE> <TBODY> <TR> <TD colSpan=2> <H3>Problem Statement </H3></TD></TR> <TR> <TD>     </TD> <TD>A square matrix is a grid of NxN numbers. For example, the following is a 3x3 matrix: <PRE> 4 3 5 2 4 5 0 1 9</PRE>One way to represent a matrix of numbers, each of which is between 0 and 9 inclusive, is as a row-major String. To generate the String, simply concatenate all of the elements from the first row followed by the second row and so on, without any spaces. For example, the above matrix would be represented as "435245019".<BR><BR>You will be given a square matrix as a row-major String. Your task is to convert it into a String[], where each element represents one row of the original matrix. Element i of the String[] represents row i of the matrix. You should not include any spaces in your return. Hence, for the above String, you would return {"435","245","019"}. If the input does not represent a square matrix because the number of characters is not a perfect square, return an empty String[], {}. </TD></TR> <TR> <TD colSpan=2> <H3>Definition </H3></TD></TR> <TR> <TD>     </TD> <TD> <TABLE> <TBODY> <TR> <TD>Class: </TD> <TD>MatrixTool </TD></TR> <TR> <TD>Method: </TD> <TD>convert </TD></TR> <TR> <TD>Parameters: </TD> <TD>String </TD></TR> <TR> <TD>Returns: </TD> <TD>String[] </TD></TR> <TR> <TD>Method signature: </TD> <TD>String[] convert(String s) </TD></TR> <TR> <TD colSpan=2>(be sure your method is public) </TD></TR></TBODY></TABLE></TD></TR> <TR> <TD>     </TD></TR> <TR> <TD></TD></TR> <TR> <TD colSpan=2> <H3>Constraints </H3></TD></TR> <TR> <TD vAlign=top align=middle>- </TD> <TD><B>s</B> will contain between 1 and 50 digits, inclusive. </TD></TR> <TR> <TD colSpan=2> <H3>Examples </H3></TD></TR> <TR> <TD noWrap align=middle>0) </TD> <TD></TD></TR> <TR> <TD>     </TD> <TD> <TABLE> <TBODY> <TR> <TD> <TABLE> <TBODY> <TR> <TD><PRE>"435245019"</PRE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD><PRE>Returns: {"435", "245", "019" }</PRE></TD></TR> <TR> <TD> <TABLE> <TBODY> <TR> <TD colSpan=2>The example above. </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD noWrap align=middle>1) </TD> <TD></TD></TR> <TR> <TD>     </TD> <TD> <TABLE> <TBODY> <TR> <TD> <TABLE> <TBODY> <TR> <TD><PRE>"9"</PRE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD><PRE>Returns: {"9" }</PRE></TD></TR> <TR> <TD></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD noWrap align=middle>2) </TD> <TD></TD></TR> <TR> <TD>     </TD> <TD> <TABLE> <TBODY> <TR> <TD> <TABLE> <TBODY> <TR> <TD><PRE>"0123456789"</PRE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD><PRE>Returns: { }</PRE></TD></TR> <TR> <TD> <TABLE> <TBODY> <TR> <TD colSpan=2>This input has 10 digits, and 10 is not a perfect square. </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD noWrap align=middle>3) </TD> <TD></TD></TR> <TR> <TD>     </TD> <TD> <TABLE> <TBODY> <TR> <TD> <TABLE> <TBODY> <TR> <TD><PRE>"3357002966366183191503444273807479559869883303524"</PRE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD><PRE>Returns: {"3357002", "9663661", "8319150", "3444273", "8074795", "5986988", "3303524" }</PRE></TD></TR> <TR> <TD></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> <HR> <P>This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved. <BR><BR>絳旀錛?BR><BR><BR></P> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #008080"> 1</SPAN><IMG id=Codehighlighter1_24_689_Open_Image onclick="this.style.display='none'; Codehighlighter1_24_689_Open_Text.style.display='none'; Codehighlighter1_24_689_Closed_Image.style.display='inline'; Codehighlighter1_24_689_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_24_689_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_24_689_Closed_Text.style.display='none'; Codehighlighter1_24_689_Open_Image.style.display='inline'; Codehighlighter1_24_689_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> MatrixTool </SPAN><SPAN id=Codehighlighter1_24_689_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_24_689_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080"> 2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080"> 3</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_61_405_Open_Image onclick="this.style.display='none'; Codehighlighter1_61_405_Open_Text.style.display='none'; Codehighlighter1_61_405_Closed_Image.style.display='inline'; Codehighlighter1_61_405_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_61_405_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_61_405_Closed_Text.style.display='none'; Codehighlighter1_61_405_Open_Image.style.display='inline'; Codehighlighter1_61_405_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> String[] convert(String s)</SPAN><SPAN id=Codehighlighter1_61_405_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_61_405_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080"> 4</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_117_147_Open_Image onclick="this.style.display='none'; Codehighlighter1_117_147_Open_Text.style.display='none'; Codehighlighter1_117_147_Closed_Image.style.display='inline'; Codehighlighter1_117_147_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_117_147_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_117_147_Closed_Text.style.display='none'; Codehighlighter1_117_147_Open_Image.style.display='inline'; Codehighlighter1_117_147_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> (s </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">||</SPAN><SPAN style="COLOR: #000000"> s.length() </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">||</SPAN><SPAN style="COLOR: #000000"> s.length() </SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">50</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN id=Codehighlighter1_117_147_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_117_147_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080"> 5</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_141_142_Open_Image onclick="this.style.display='none'; Codehighlighter1_141_142_Open_Text.style.display='none'; Codehighlighter1_141_142_Closed_Image.style.display='inline'; Codehighlighter1_141_142_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_141_142_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_141_142_Closed_Text.style.display='none'; Codehighlighter1_141_142_Open_Image.style.display='inline'; Codehighlighter1_141_142_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>            </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> String[]</SPAN><SPAN id=Codehighlighter1_141_142_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_141_142_Open_Text><SPAN style="COLOR: #000000">{}</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080"> 6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> length </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> s.length();<BR></SPAN><SPAN style="COLOR: #008080"> 8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> n </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> (</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">)Math.sqrt(length);<BR></SPAN><SPAN style="COLOR: #008080"> 9</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_229_366_Open_Image onclick="this.style.display='none'; Codehighlighter1_229_366_Open_Text.style.display='none'; Codehighlighter1_229_366_Closed_Image.style.display='inline'; Codehighlighter1_229_366_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_229_366_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_229_366_Closed_Text.style.display='none'; Codehighlighter1_229_366_Open_Image.style.display='inline'; Codehighlighter1_229_366_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(n</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">n </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000"> length)</SPAN><SPAN id=Codehighlighter1_229_366_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_229_366_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>            String[] result </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> String[n];<BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_296_344_Open_Image onclick="this.style.display='none'; Codehighlighter1_296_344_Open_Text.style.display='none'; Codehighlighter1_296_344_Closed_Image.style.display='inline'; Codehighlighter1_296_344_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_296_344_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_296_344_Closed_Text.style.display='none'; Codehighlighter1_296_344_Open_Image.style.display='inline'; Codehighlighter1_296_344_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>            </SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> i </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">; i </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000"> n; i</SPAN><SPAN style="COLOR: #000000">++</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN id=Codehighlighter1_296_344_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_296_344_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>                result[i] </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> s.substring(i</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">n, i</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">n </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> n);<BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>            </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> result;<BR></SPAN><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_372_402_Open_Image onclick="this.style.display='none'; Codehighlighter1_372_402_Open_Text.style.display='none'; Codehighlighter1_372_402_Closed_Image.style.display='inline'; Codehighlighter1_372_402_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_372_402_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_372_402_Closed_Text.style.display='none'; Codehighlighter1_372_402_Open_Image.style.display='inline'; Codehighlighter1_372_402_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>        }</SPAN></SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN id=Codehighlighter1_372_402_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_372_402_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">16</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_396_397_Open_Image onclick="this.style.display='none'; Codehighlighter1_396_397_Open_Text.style.display='none'; Codehighlighter1_396_397_Closed_Image.style.display='inline'; Codehighlighter1_396_397_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_396_397_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_396_397_Closed_Text.style.display='none'; Codehighlighter1_396_397_Open_Image.style.display='inline'; Codehighlighter1_396_397_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>            </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> String[]</SPAN><SPAN id=Codehighlighter1_396_397_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_396_397_Open_Text><SPAN style="COLOR: #000000">{}</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">17</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">18</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">19</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">20</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_409_432_Open_Image onclick="this.style.display='none'; Codehighlighter1_409_432_Open_Text.style.display='none'; Codehighlighter1_409_432_Closed_Image.style.display='inline'; Codehighlighter1_409_432_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_409_432_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_409_432_Closed_Text.style.display='none'; Codehighlighter1_409_432_Open_Image.style.display='inline'; Codehighlighter1_409_432_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_409_432_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/** */</SPAN><SPAN id=Codehighlighter1_409_432_Open_Text><SPAN style="COLOR: #008000">/**</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008080">21</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>     * </SPAN><SPAN style="COLOR: #808080">@param</SPAN><SPAN style="COLOR: #008000"> args<BR></SPAN><SPAN style="COLOR: #008080">22</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>     </SPAN><SPAN style="COLOR: #008000">*/</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">23</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_474_686_Open_Image onclick="this.style.display='none'; Codehighlighter1_474_686_Open_Text.style.display='none'; Codehighlighter1_474_686_Closed_Image.style.display='inline'; Codehighlighter1_474_686_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_474_686_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_474_686_Closed_Text.style.display='none'; Codehighlighter1_474_686_Open_Image.style.display='inline'; Codehighlighter1_474_686_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000"> main(String[] args) </SPAN><SPAN id=Codehighlighter1_474_686_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_474_686_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">24</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        MatrixTool matrix </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> MatrixTool();<BR></SPAN><SPAN style="COLOR: #008080">25</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        String[] result </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> matrix.convert(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">3357002966366183191503444273807479559869883303524</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080">26</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_645_683_Open_Image onclick="this.style.display='none'; Codehighlighter1_645_683_Open_Text.style.display='none'; Codehighlighter1_645_683_Closed_Image.style.display='inline'; Codehighlighter1_645_683_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_645_683_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_645_683_Closed_Text.style.display='none'; Codehighlighter1_645_683_Open_Image.style.display='inline'; Codehighlighter1_645_683_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> i </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">; i </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000"> result.length; i</SPAN><SPAN style="COLOR: #000000">++</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN id=Codehighlighter1_645_683_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_645_683_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">27</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>            System.out.println(result[i]);<BR></SPAN><SPAN style="COLOR: #008080">28</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">29</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">30</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">31</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">32</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV><img src ="http://www.tkk7.com/freddychu/aggbug/21589.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/freddychu/" target="_blank">椋庤惂钀?/a> 2005-11-27 23:40 <a href="http://www.tkk7.com/freddychu/archive/2005/11/27/21589.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>GOOGLE鎸戞垬璧涚粌涔犻1鍙婄瓟妗?/title><link>http://www.tkk7.com/freddychu/archive/2005/11/27/21588.html</link><dc:creator>椋庤惂钀?/dc:creator><author>椋庤惂钀?/author><pubDate>Sun, 27 Nov 2005 15:37:00 GMT</pubDate><guid>http://www.tkk7.com/freddychu/archive/2005/11/27/21588.html</guid><wfw:comment>http://www.tkk7.com/freddychu/comments/21588.html</wfw:comment><comments>http://www.tkk7.com/freddychu/archive/2005/11/27/21588.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/freddychu/comments/commentRss/21588.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/freddychu/services/trackbacks/21588.html</trackback:ping><description><![CDATA[     鎽樿: Problem Statement      A simple line drawing program uses a blank 20 x 20 pixel canvas and a directional cursor that starts at the upper left corner pointing straight down. T...  <a href='http://www.tkk7.com/freddychu/archive/2005/11/27/21588.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/freddychu/aggbug/21588.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/freddychu/" target="_blank">椋庤惂钀?/a> 2005-11-27 23:37 <a href="http://www.tkk7.com/freddychu/archive/2005/11/27/21588.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>闈㈣瘯棰樿崯钀?/title><link>http://www.tkk7.com/freddychu/archive/2005/11/16/20003.html</link><dc:creator>椋庤惂钀?/dc:creator><author>椋庤惂钀?/author><pubDate>Wed, 16 Nov 2005 01:59:00 GMT</pubDate><guid>http://www.tkk7.com/freddychu/archive/2005/11/16/20003.html</guid><wfw:comment>http://www.tkk7.com/freddychu/comments/20003.html</wfw:comment><comments>http://www.tkk7.com/freddychu/archive/2005/11/16/20003.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/freddychu/comments/commentRss/20003.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/freddychu/services/trackbacks/20003.html</trackback:ping><description><![CDATA[緇忓吀闈㈣瘯棰? <SCRIPT language=javascript>document.title="緇忓吀闈㈣瘯棰?- "+document.title</SCRIPT> <BR> <P>涓銆侀潰鍚戝璞$殑涓変釜鍩烘湰鐗瑰緛<BR>   2銆佹柟娉曢噸杞藉拰鏂規硶閲嶅啓鐨勬蹇靛拰鍖哄埆<BR>   3銆佹帴鍙e拰鍐呴儴綾匯佹娊璞$被鐨勭壒鎬?BR>   4銆佹枃浠惰鍐欑殑鍩烘湰綾?BR>   **5銆佷覆琛屽寲鐨勬敞鎰忎簨欏逛互鍙婂浣曞疄鐜頒覆琛屽寲<BR>   6銆佺嚎紼嬬殑鍩烘湰姒傚康銆佺嚎紼嬬殑鍩烘湰鐘舵佷互鍙婄姸鎬佷箣闂寸殑鍏崇郴<BR>   7銆佺嚎紼嬬殑鍚屾銆佸浣曞疄鐜扮嚎紼嬬殑鍚屾<BR>   8銆佸嚑縐嶅父鐢ㄧ殑鏁版嵁緇撴瀯鍙婂唴閮ㄥ疄鐜板師鐞嗐?BR>   9銆丼ocket閫氫俊(TCP銆乁DP鍖哄埆鍙奐ava瀹炵幇鏂瑰紡)<BR>  **10銆丣ava鐨勪簨浠跺鎵樻満鍒跺拰鍨冨溇鍥炴敹鏈哄埗<BR>  11銆丣DBC璋冪敤鏁版嵁搴撶殑鍩烘湰姝ラ<BR>  **12銆佽В鏋怷ML鏂囦歡鐨勫嚑縐嶆柟寮忓拰鍖哄埆<BR>  13銆丣ava鍥涚鍩烘湰鏉冮檺鐨勫畾涔?BR>  14銆丣ava鐨勫浗闄呭寲<BR>浜屻丣SP<BR>   1銆佽嚦灝戣鑳借鍑?涓殣鍚璞′互鍙婁粬浠殑鍖哄埆<BR>  ** 2銆乫orward 鍜宺edirect鐨勫尯鍒?BR>   3銆丣SP鐨勫父鐢ㄦ寚浠?BR>涓夈乻ervlet<BR>   1銆佷粈涔堟儏鍐典笅璋冪敤doGet()鍜宒oPost()錛?BR>   2銆乻ervlet鐨刬nit()鏂規硶鍜宻ervice()鏂規硶鐨勫尯鍒?BR>   3銆乻ervlet鐨勭敓鍛藉懆鏈?BR>   4銆佸浣曠幇瀹瀞ervlet鐨勫崟綰跨▼妯″紡<BR>   5銆乻ervlet鐨勯厤緗?BR>   6銆佸洓縐嶄細璇濊窡韙妧鏈?BR>鍥涖丒JB<BR>   **1銆丒JB瀹瑰櫒鎻愪緵鐨勬湇鍔?BR> 涓昏鎻愪緵澹版槑鍛ㄦ湡綆$悊銆佷唬鐮佷駭鐢熴佹寔緇х鐞嗐佸畨鍏ㄣ佷簨鍔$鐞嗐侀攣鍜屽茍鍙戣綆$悊絳夋湇鍔°?BR>   2銆丒JB鐨勮鑹插拰涓変釜瀵硅薄<BR> EJB瑙掕壊涓昏鍖呮嫭Bean寮鍙戣?搴旂敤緇勮鑰?閮ㄧ講鑰?緋葷粺綆$悊鍛?EJB瀹瑰櫒鎻愪緵鑰?EJB鏈嶅姟鍣ㄦ彁渚涜?BR> 涓変釜瀵硅薄鏄疪emote錛圠ocal錛夋帴鍙c丠ome錛圠ocalHome錛夋帴鍙o紝Bean綾?BR>   2銆丒JB鐨勫嚑縐嶇被鍨?BR> 浼氳瘽錛圫ession錛塀ean 錛屽疄浣擄紙Entity錛塀ean 娑堟伅椹卞姩鐨勶紙Message Driven錛塀ean<BR> 浼氳瘽Bean鍙堝彲鍒嗕負鏈夌姸鎬侊紙Stateful錛夊拰鏃犵姸鎬侊紙Stateless錛変袱縐?BR> 瀹炰綋Bean鍙垎涓築ean綆$悊鐨勬寔緇э紙BMP錛夊拰瀹瑰櫒綆$悊鐨勬寔緇э紙CMP錛変袱縐?BR>   3銆乥ean 瀹炰緥鐨勭敓鍛藉懆鏈?BR> 瀵逛簬Stateless Session Bean銆丒ntity Bean銆丮essage Driven Bean涓鑸瓨鍦ㄧ紦鍐叉睜綆$悊錛岃屽浜嶦ntity Bean鍜孲tatefull Session Bean瀛樺湪Cache綆$悊錛岄氬父鍖呭惈鍒涘緩瀹炰緥錛岃緗笂涓嬫枃銆佸垱寤篍JB Object錛坈reate錛夈佷笟鍔℃柟娉曡皟鐢ㄣ乺emove絳夎繃紼嬶紝瀵逛簬瀛樺湪緙撳啿姹犵鐞嗙殑Bean錛屽湪create涔嬪悗瀹炰緥騫朵笉浠庡唴瀛樻竻闄わ紝鑰屾槸閲囩敤緙撳啿姹犺皟搴︽満鍒朵笉鏂噸鐢ㄥ疄渚嬶紝鑰屽浜庡瓨鍦–ache綆$悊鐨凚ean鍒欓氳繃嬋媧誨拰鍘繪縺媧繪満鍒朵繚鎸丅ean鐨勭姸鎬佸茍闄愬埗鍐呭瓨涓疄渚嬫暟閲忋?BR>   4銆佹縺媧繪満鍒?BR> 浠tatefull Session Bean 涓轟緥錛氬叾Cache澶у皬鍐沖畾浜嗗唴瀛樹腑鍙互鍚屾椂瀛樺湪鐨凚ean瀹炰緥鐨勬暟閲忥紝鏍規嵁MRU鎴朜RU綆楁硶錛屽疄渚嬪湪嬋媧誨拰鍘繪縺媧葷姸鎬佷箣闂磋縼縐伙紝嬋媧繪満鍒舵槸褰撳鎴風璋冪敤鏌愪釜EJB瀹炰緥涓氬姟鏂規硶鏃訛紝濡傛灉瀵瑰簲EJB Object鍙戠幇鑷繁娌℃湁緇戝畾瀵瑰簲鐨凚ean瀹炰緥鍒欎粠鍏跺幓嬋媧籅ean瀛樺偍涓紙閫氳繃搴忓垪鍖栨満鍒跺瓨鍌ㄥ疄渚嬶級鍥炲錛堟縺媧伙級姝ゅ疄渚嬨傜姸鎬佸彉榪佸墠浼氳皟鐢ㄥ搴旂殑ejbActive鍜宔jbPassivate鏂規硶銆?BR>   5銆乺emote鎺ュ彛鍜宧ome鎺ュ彛涓昏浣滅敤<BR> remote鎺ュ彛瀹氫箟浜嗕笟鍔℃柟娉曪紝鐢ㄤ簬EJB瀹㈡埛绔皟鐢ㄤ笟鍔℃柟娉?BR> home鎺ュ彛鏄疎JB宸ュ巶鐢ㄤ簬鍒涘緩鍜岀Щ闄ゆ煡鎵綞JB瀹炰緥<BR>   6銆佸鏈嶇璋冪敤EJB瀵硅薄鐨勫嚑涓熀鏈楠?BR>涓銆?nbsp;璁劇疆JNDI鏈嶅姟宸ュ巶浠ュ強JNDI鏈嶅姟鍦板潃緋葷粺灞炴?BR>浜屻?nbsp;鏌ユ壘Home鎺ュ彛<BR>涓夈?nbsp;浠嶩ome鎺ュ彛璋冪敤Create鏂規硶鍒涘緩Remote鎺ュ彛<BR>鍥涖?nbsp;閫氳繃Remote鎺ュ彛璋冪敤鍏朵笟鍔℃柟娉?BR>浜斻佹暟鎹簱<BR>   1銆佸瓨鍌ㄨ繃紼嬬殑緙栧啓<BR>   2銆佸熀鏈殑SQL璇彞<BR>鍏亀eblogic<BR>1銆?nbsp;濡備綍緇檞eblogic鎸囧畾澶у皬鐨勫唴瀛? <BR>鍦ㄥ惎鍔╓eblogic鐨勮剼鏈腑錛堜綅浜庢墍鍦―omian瀵瑰簲鏈嶅姟鍣ㄧ洰褰曚笅鐨剆tartServerName錛夛紝澧炲姞set MEM_ARGS=-Xms32m -Xmx200m錛屽彲浠ヨ皟鏁存渶灝忓唴瀛樹負32M錛屾渶澶?00M<BR>2銆?nbsp;濡備綍璁懼畾鐨剋eblogic鐨勭儹鍚姩妯″紡(寮鍙戞ā寮?涓庝駭鍝佸彂甯冩ā寮?<BR>鍙互鍦ㄧ鐞嗘帶鍒跺彴涓慨鏀瑰搴旀湇鍔″櫒鐨勫惎鍔ㄦā寮忎負寮鍙戞垨浜у搧妯″紡涔嬩竴銆傛垨鑰呬慨鏀規湇鍔$殑鍚姩鏂囦歡鎴栬卌ommenv鏂囦歡錛屽鍔爏et PRODUCTION_MODE=true銆?BR>3銆?nbsp;濡備綍鍚姩鏃朵笉闇杈撳叆鐢ㄦ埛鍚嶄笌瀵嗙爜?<BR>淇敼鏈嶅姟鍚姩鏂囦歡錛屽鍔?WLS_USER鍜學LS_PW欏廣備篃鍙互鍦╞oot.properties鏂囦歡涓鍔犲姞瀵嗚繃鐨勭敤鎴峰悕鍜屽瘑鐮?<BR>4銆?nbsp;鍦╳eblogic綆$悊鍒跺彴涓涓涓簲鐢ㄥ煙(鎴栬呰鏄竴涓綉绔?Domain)榪涜jms鍙奺jb鎴栬繛鎺ユ睜絳夌浉鍏充俊鎭繘琛岄厤緗悗,瀹為檯淇濆瓨鍦ㄤ粈涔堟枃浠朵腑?<BR>淇濆瓨鍦ㄦDomain鐨刢onfig.xml鏂囦歡涓紝瀹冩槸鏈嶅姟鍣ㄧ殑鏍稿績閰嶇疆鏂囦歡銆?BR>5銆?nbsp;璇磋weblogic涓竴涓狣omain鐨勭己鐪佺洰褰曠粨鏋?姣斿瑕佸皢涓涓畝鍗曠殑helloWorld.jsp鏀懼叆浣曠洰褰曚笅,鐒剁殑鍦ㄦ祻瑙堝櫒涓婂氨鍙墦鍏ttp://涓繪満:绔彛鍙?/helloword.jsp灝卞彲浠ョ湅鍒拌繍琛岀粨鏋滀簡? 鍙堟瘮濡傝繖鍏朵腑鐢ㄥ埌浜嗕竴涓嚜宸卞啓鐨刯avaBean璇ュ浣曞姙?<BR>Domain鐩綍\鏈嶅姟鍣ㄧ洰褰昞applications錛屽皢搴旂敤鐩綍鏀懼湪姝ょ洰褰曚笅灝嗗彲浠ヤ綔涓哄簲鐢ㄨ闂紝濡傛灉鏄疻eb搴旂敤錛屽簲鐢ㄧ洰褰曢渶瑕佹弧瓚砏eb搴旂敤鐩綍瑕佹眰錛宩sp鏂囦歡鍙互鐩存帴鏀懼湪搴旂敤鐩綍涓紝Javabean闇瑕佹斁鍦ㄥ簲鐢ㄧ洰褰曠殑WEB-INF鐩綍鐨刢lasses鐩綍涓紝璁劇疆鏈嶅姟鍣ㄧ殑緙虹渷搴旂敤灝嗗彲浠ュ疄鐜板湪嫻忚鍣ㄤ笂鏃犻渶杈撳叆搴旂敤鍚嶃?BR>6銆?nbsp;濡備綍鏌ョ湅鍦╳eblogic涓凡緇忓彂甯冪殑EJB?<BR>鍙互浣跨敤綆$悊鎺у埗鍙幫紝鍦ㄥ畠鐨凞eployment涓彲浠ユ煡鐪嬫墍鏈夊凡鍙戝竷鐨凟JB <BR>7銆?nbsp;濡備綍鍦╳eblogic涓繘琛宻sl閰嶇疆涓庡鎴風鐨勮璇侀厤緗垨璇磋j2ee(鏍囧噯)榪涜ssl鐨勯厤緗?BR>緙虹渷瀹夎涓嬌鐢―emoIdentity.jks鍜孌emoTrust.jks  KeyStore瀹炵幇SSL錛岄渶瑕侀厤緗湇鍔″櫒浣跨敤Enable SSL錛岄厤緗叾绔彛錛屽湪浜у搧妯″紡涓嬮渶瑕佷粠CA鑾峰彇縐佹湁瀵嗛挜鍜屾暟瀛楄瘉涔︼紝鍒涘緩identity鍜宼rust keystore錛岃杞借幏寰楃殑瀵嗛挜鍜屾暟瀛楄瘉涔︺傚彲浠ラ厤緗SSL榪炴帴鏄崟鍚戣繕鏄弻鍚戠殑銆?BR>   8銆佸湪weblogic涓彂甯僥jb闇娑夊強鍒板摢浜涢厤緗枃浠?BR>涓嶅悓綾誨瀷鐨凟JB娑夊強鐨勯厤緗枃浠朵笉鍚岋紝閮芥秹鍙婂埌鐨勯厤緗枃浠跺寘鎷琫jb-jar.xml,weblogic-ejb-jar.xmlCMP瀹炰綋Bean涓鑸繕闇瑕亀eblogic-cmp-rdbms-jar.xml<BR>   9銆丒JB闇鐩存帴瀹炵幇瀹冪殑涓氬姟鎺ュ彛鎴朒ome鎺ュ彛鍚?璇風畝榪扮悊鐢?<BR>榪滅▼鎺ュ彛鍜孒ome鎺ュ彛涓嶉渶瑕佺洿鎺ュ疄鐜幫紝浠栦滑鐨勫疄鐜頒唬鐮佹槸鐢辨湇鍔″櫒浜х敓鐨勶紝紼嬪簭榪愯涓搴斿疄鐜扮被浼氫綔涓哄搴旀帴鍙g被鍨嬬殑瀹炰緥琚嬌鐢ㄣ?BR>  10銆佽璇村湪weblogic涓紑鍙戞秷鎭疊ean鏃剁殑persistent涓巒on-persisten鐨勫樊鍒?BR>persistent鏂瑰紡鐨凪DB鍙互淇濊瘉娑堟伅浼犻掔殑鍙潬鎬?涔熷氨鏄鏋淓JB瀹瑰櫒鍑虹幇闂鑰孞MS鏈嶅姟鍣ㄤ緷鐒朵細灝嗘秷鎭湪姝DB鍙敤鐨勬椂鍊欏彂閫佽繃鏉ワ紝鑰宯on錛峱ersistent鏂瑰紡鐨勬秷鎭皢琚涪寮冦?BR>  11銆佽璇翠綘鎵鐔熸倝鎴栧惉璇磋繃鐨刯2ee涓殑鍑犵甯哥敤妯″紡?鍙婂璁捐妯″紡鐨勪竴浜涚湅娉?BR>   Session Facade Pattern錛氫嬌鐢⊿essionBean璁塊棶EntityBean<BR>Message Facade Pattern錛氬疄鐜板紓姝ヨ皟鐢?BR>EJB Command Pattern錛氫嬌鐢–ommand JavaBeans鍙栦唬SessionBean錛屽疄鐜拌交閲忕駭璁塊棶<BR>Data Transfer Object Factory錛氶氳繃DTO Factory綆鍖朎ntityBean鏁版嵁鎻愪緵鐗規?BR>Generic Attribute Access錛氶氳繃AttibuteAccess鎺ュ彛綆鍖朎ntityBean鏁版嵁鎻愪緵鐗規?BR>Business Interface錛氶氳繃榪滅▼錛堟湰鍦幫級鎺ュ彛鍜孊ean綾誨疄鐜扮浉鍚屾帴鍙h鑼冧笟鍔¢昏緫涓鑷存?BR>錛ワ吉錛㈡灦鏋勭殑璁捐濂藉潖灝嗙洿鎺ュ獎鍝嶇郴緇熺殑鎬ц兘銆佸彲鎵╁睍鎬с佸彲緇存姢鎬с佺粍浠跺彲閲嶇敤鎬у強寮鍙戞晥鐜囥傞」鐩秺澶嶆潅錛岄」鐩槦浼嶈秺搴炲ぇ鍒欒秺鑳戒綋鐜拌壇濂借璁$殑閲嶈鎬с?BR>杞澆鑷細<A >http://blog.csdn.net/laou2008/archive/2005/11/15/529519.aspx</A><BR><BR>瑗塊棬瀛愮殑涓閬撶瑪璇曢<BR><BR>璁捐涓涓嚱鏁幫紝褰㈠紡濡? int func(unsigned int)錛岃姹傛眰鍑轟笉澶т簬杈撳叆鍙傛暟鐨勬渶澶х殑绱犳暟錛屾瘮濡傝緭鍏?2錛岃繑鍥?1銆?BR><BR>杞澆鑷細<A >http://community.csdn.net/Expert/topic/4368/4368551.xml?temp=.4177057</A><BR><BR>寰蔣MSN鍦ㄥ崡澶х殑絎旇瘯棰?BR><BR>緗楅┈鏁板瓧鍏辨湁涓冧釜錛屽嵆 <BR>I(1)錛孷(5)錛孹(10)錛孡(50)錛孋(100)錛孌(500)錛孧(1000)銆?</P> <P>鎸夌収涓嬮潰涓夋潯瑙勫垯鍙互琛ㄧず浠繪剰姝f暣鏁般?</P> <P>閲嶅鏁版錛氫竴涓綏椹暟瀛楅噸澶嶅嚑嬈★紝灝辮〃紺鴻繖涓暟鐨勫嚑鍊嶃?</P> <P>鍙沖姞宸﹀噺錛氬湪涓涓緝澶х殑緗楅┈鏁板瓧鐨勫彸杈硅涓婁竴涓緝灝忕殑緗楅┈鏁板瓧錛?<BR>琛ㄧず澶ф暟瀛楀姞灝忔暟瀛椼傚湪涓涓緝澶х殑鏁板瓧鐨勫乏杈硅涓婁竴涓緝灝忕殑緗?<BR>椹暟瀛楋紝琛ㄧず澶ф暟瀛楀噺灝忔暟瀛椼備絾鏄紝宸﹀噺涓嶈兘璺ㄨ秺絳夌駭銆?<BR>姣斿錛?9涓嶅彲浠ョ敤IC琛ㄧず錛岀敤XCIX琛ㄧず</P> <P>鍩烘湰鏁板瓧鈪犮乆 銆丆 涓殑浠諱綍涓涓?鑷韓榪炵敤鏋勬垚鏁扮洰,鎴栬呮斁鍦ㄥぇ鏁扮殑鍙寵竟榪炵敤鏋勬垚鏁扮洰,閮戒笉鑳借秴榪囦笁涓?姣斿40涓嶈兘鐢╔XXX,鑰岀敤XL琛ㄧず</P> <P>璁捐涓涓嚱鏁?灝?00(鍖呮嫭100)浠ュ唴鐨勬暣鏁拌漿鎹㈡垚緗楅┈鏁板瓧,瓚呰繃100涓嶈冭檻<BR>int itor(int n,char* buf,int bufLength)<BR>鍏朵腑,n鏄杞崲鐨勬暣鏁?buf鏄杈撳嚭鐨勫瓧絎︿覆,bufLength鏄痓uf鐨勫瓧絎﹂暱搴?BR>鎴愬姛,榪斿洖0,鍚﹀垯,榪斿洖 -1;</P> <P>姣斿:<BR>char buf[256];<BR>result = itor(n,buf,sizeof(buf));</P> <P>when n = 28; result = 0, 杈撳嚭"XXVIII"錛?BR>when n = 72; result = 0, 杈撳嚭"LXXII";<BR><BR>杞澆鑷細<A >http://community.csdn.net/Expert/topic/4386/4386877.xml?temp=.411175</A><BR><BR><BR><BR><BR><BR></P><img src ="http://www.tkk7.com/freddychu/aggbug/20003.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/freddychu/" target="_blank">椋庤惂钀?/a> 2005-11-16 09:59 <a href="http://www.tkk7.com/freddychu/archive/2005/11/16/20003.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>杞澆錛欸oogle鏂囦歡緋葷粺http://www.tkk7.com/freddychu/archive/2005/11/09/18892.html椋庤惂钀?/dc:creator>椋庤惂钀?/author>Wed, 09 Nov 2005 01:29:00 GMThttp://www.tkk7.com/freddychu/archive/2005/11/09/18892.htmlhttp://www.tkk7.com/freddychu/comments/18892.htmlhttp://www.tkk7.com/freddychu/archive/2005/11/09/18892.html#Feedback0http://www.tkk7.com/freddychu/comments/commentRss/18892.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/18892.htmlGFS鏄竴涓彲鎵╁睍鐨勫垎甯冨紡鏂囦歡緋葷粺錛岀敤浜庡ぇ鍨嬬殑銆佸垎甯冨紡鐨勩佸澶ч噺鏁版嵁榪涜璁塊棶鐨勫簲鐢ㄣ傚畠榪愯浜庡粔浠風殑鏅氱‖浠朵笂錛屼絾鍙互鎻愪緵瀹歸敊鍔熻兘銆傚畠鍙互緇欏ぇ閲忕殑鐢ㄦ埛鎻愪緵鎬諱綋鎬ц兘杈冮珮鐨勬湇鍔°?
1銆佽璁℃瑙?
錛?錛夎璁℃兂瀹?
GFS涓庤繃鍘葷殑鍒嗗竷寮忔枃浠剁郴緇熸湁寰堝鐩稿悓鐨勭洰鏍囷紝浣咷FS鐨勮璁″彈鍒頒簡褰撳墠鍙婇鏈熺殑搴旂敤鏂歸潰鐨勫伐浣滈噺鍙婃妧鏈幆澧冪殑椹卞姩錛岃繖鍙嶆槧浜嗗畠涓庢棭鏈熺殑鏂囦歡緋葷粺鏄庢樉涓嶅悓鐨勮鎯熾傝繖灝遍渶瑕佸浼犵粺鐨勯夋嫨榪涜閲嶆柊媯楠屽茍榪涜瀹屽叏涓嶅悓鐨勮璁¤鐐圭殑鎺㈢儲銆?
GFS涓庝互寰鐨勬枃浠剁郴緇熺殑涓嶅悓鐨勮鐐瑰涓嬶細
1銆侀儴浠墮敊璇笉鍐嶈褰撲綔寮傚父錛岃屾槸灝嗗叾浣滀負甯歌鐨勬儏鍐靛姞浠ュ鐞嗐傚洜涓烘枃浠剁郴緇熺敱鎴愮櫨涓婂崈涓敤浜庡瓨鍌ㄧ殑鏈哄櫒鏋勬垚錛岃岃繖浜涙満鍣ㄦ槸鐢卞粔浠風殑鏅氶儴浠剁粍鎴愬茍琚ぇ閲忕殑瀹㈡埛鏈鴻闂傞儴浠剁殑鏁伴噺鍜岃川閲忎嬌寰椾竴浜涙満鍣ㄩ殢鏃墮兘鏈夊彲鑳芥棤娉曞伐浣滃茍涓旀湁涓閮ㄥ垎榪樺彲鑳芥棤娉曟仮澶嶃傛墍浠ュ疄鏃跺湴鐩戞帶銆侀敊璇嫻嬨佸閿欍佽嚜鍔ㄦ仮澶嶅緋葷粺鏉ヨ蹇呬笉鍙皯銆?
2銆佹寜鐓т紶緇熺殑鏍囧噯錛屾枃浠墮兘闈炲父澶с傞暱搴﹁揪鍑犱釜GB鐨勬枃浠舵槸寰堝鉤甯哥殑銆傛瘡涓枃浠墮氬父鍖呭惈寰堝搴旂敤瀵硅薄銆傚綋緇忓父瑕佸鐞嗗揩閫熷闀跨殑銆佸寘鍚暟浠ヤ竾璁$殑瀵硅薄銆侀暱搴﹁揪TB鐨勬暟鎹泦鏃訛紝鎴戜滑寰堥毦綆$悊鎴愬崈涓婁竾鐨凨B瑙勬ā鐨勬枃浠跺潡錛屽嵆浣垮簳灞傛枃浠剁郴緇熸彁渚涙敮鎸併傚洜姝わ紝璁捐涓搷浣滅殑鍙傛暟銆佸潡鐨勫ぇ灝忓繀欏昏閲嶆柊鑰冭檻銆傚澶у瀷鐨勬枃浠剁殑綆$悊涓瀹氳鑳藉仛鍒伴珮鏁堬紝瀵瑰皬鍨嬬殑鏂囦歡涔熷繀欏繪敮鎸侊紝浣嗕笉蹇呬紭鍖栥?
3銆佸ぇ閮ㄥ垎鏂囦歡鐨勬洿鏂版槸閫氳繃娣誨姞鏂版暟鎹畬鎴愮殑錛岃屼笉鏄敼鍙樺凡瀛樺湪鐨勬暟鎹傚湪涓涓枃浠朵腑闅忔満鐨勬搷浣滃湪瀹炶返涓嚑涔庝笉瀛樺湪銆備竴鏃﹀啓瀹岋紝鏂囦歡灝卞彧鍙錛屽緢澶氭暟鎹兘鏈夎繖浜涚壒鎬с備竴浜涙暟鎹彲鑳界粍鎴愪竴涓ぇ浠撳簱浠ヤ緵鏁版嵁鍒嗘瀽紼嬪簭鎵弿銆傛湁浜涙槸榪愯涓殑紼嬪簭榪炵畫浜х敓鐨勬暟鎹祦銆傛湁浜涙槸妗f鎬ц川鐨勬暟鎹紝鏈変簺鏄湪鏌愪釜鏈哄櫒涓婁駭鐢熴佸湪鍙﹀涓涓満鍣ㄤ笂澶勭悊鐨勪腑闂存暟鎹傜敱浜庤繖浜涘澶у瀷鏂囦歡鐨勮闂柟寮忥紝娣誨姞鎿嶄綔鎴愪負鎬ц兘浼樺寲鍜屽師瀛愭т繚璇佺殑鐒︾偣銆傝屽湪瀹㈡埛鏈轟腑緙撳瓨鏁版嵁鍧楀垯澶卞幓浜嗗惛寮曞姏銆?
4銆佸伐浣滈噺涓昏鐢變袱縐嶈鎿嶄綔鏋勬垚錛氬澶ч噺鏁版嵁鐨勬祦鏂瑰紡鐨勮鎿嶄綔鍜屽灝戦噺鏁版嵁鐨勯殢鏈烘柟寮忕殑璇繪搷浣溿傚湪鍓嶄竴縐嶈鎿嶄綔涓紝鍙兘瑕佽鍑犵櫨KB錛岄氬父杈?1MB鍜屾洿澶氥傛潵鑷悓涓涓鎴風殑榪炵畫鎿嶄綔閫氬父浼氳鏂囦歡鐨勪竴涓繛緇殑鍖哄煙銆傞殢鏈虹殑璇繪搷浣滈氬父鍦ㄤ竴涓殢鏈虹殑鍋忕Щ澶勮鍑犱釜KB銆傛ц兘鏁忔劅鐨勫簲鐢ㄧ▼搴忛氬父灝嗗灝戦噺鏁版嵁鐨勮鎿嶄綔榪涜鍒嗙被騫惰繘琛屾壒澶勭悊浠ヤ嬌寰楄鎿嶄綔紼沖畾鍦板悜鍓嶆帹榪涳紝鑰屼笉瑕佽瀹冩潵鏉ュ洖鍥炵殑璇匯?
5銆佸伐浣滈噺榪樺寘鍚澶氬澶ч噺鏁版嵁榪涜鐨勩佽繛緇殑銆佸悜鏂囦歡娣誨姞鏁版嵁鐨勫啓鎿嶄綔銆傛墍鍐欑殑鏁版嵁鐨勮妯″拰璇葷浉浼箋備竴鏃﹀啓瀹岋紝鏂囦歡寰堝皯鏀瑰姩銆傚湪闅忔満浣嶇疆瀵瑰皯閲忔暟鎹殑鍐欐搷浣滀篃鏀寔錛屼絾涓嶅繀闈炲父楂樻晥銆?
6銆佺郴緇熷繀欏婚珮鏁堝湴瀹炵幇瀹氫箟瀹屽ソ鐨勫ぇ閲忓鎴峰悓鏃跺悜鍚屼竴涓枃浠剁殑娣誨姞鎿嶄綔鐨勮涔夈?
錛?錛夌郴緇熸帴鍙?
GFS鎻愪緵浜嗕竴涓浉浼煎湴鏂囦歡緋葷粺鐣岄潰錛岃櫧鐒跺畠娌℃湁鍚慞OSIX閭f牱瀹炵幇鏍囧噯鐨凙PI銆傛枃浠跺湪鐩綍涓寜灞傛緇勭粐璧鋒潵騫剁敱璺緞鍚嶆爣璇嗐?
錛?錛変綋緋葷粨鏋勶細
涓涓狦FS闆嗙兢鐢變竴涓猰aster鍜屽ぇ閲忕殑chunkserver鏋勬垚錛屽茍琚澶氬鎴鳳紙Client錛夎闂傚鍥?鎵紺恒侻aster鍜?chunkserver閫氬父鏄繍琛岀敤鎴峰眰鏈嶅姟榪涚▼鐨凩inux鏈哄櫒銆傚彧瑕佽祫婧愬拰鍙潬鎬у厑璁革紝chunkserver鍜宑lient鍙互榪愯鍦ㄥ悓涓涓満鍣ㄤ笂銆?
鏂囦歡琚垎鎴愬浐瀹氬ぇ灝忕殑鍧椼傛瘡涓潡鐢變竴涓笉鍙樼殑銆佸叏灞鍞竴鐨?4浣嶇殑chunk錛峢andle鏍囪瘑錛宑hunk錛峢andle鏄湪鍧楀垱寤烘椂鐢?master鍒嗛厤鐨勩侰hunkServer灝嗗潡褰撲綔Linux鏂囦歡瀛樺偍鍦ㄦ湰鍦扮鐩樺茍鍙互璇誨拰鍐欑敱chunk錛峢andle鍜屼綅鍖洪棿鎸囧畾鐨勬暟鎹傚嚭浜庡彲闈犳ц冭檻錛屾瘡涓涓潡琚鍒跺埌澶氫釜chunkserver涓娿傞粯璁ゆ儏鍐典笅錛屼繚瀛?涓壇鏈紝浣嗚繖鍙互鐢辯敤鎴鋒寚瀹氥?
Master緇存姢鏂囦歡緋葷粺鎵浠ョ殑鍏冩暟鎹紙metadata錛夛紝鍖呮嫭鍚嶅瓧絀洪棿銆佽闂帶鍒朵俊鎭佷粠鏂囦歡鍒板潡鐨勬槧灝勪互鍙婂潡鐨勫綋鍓嶄綅緗傚畠涔熸帶鍒剁郴緇熻寖鍥寸殑媧誨姩錛屽鍧楃綰︼紙lease錛夌鐞嗭紝瀛ゅ効鍧楃殑鍨冨溇鏀墮泦錛宑hunkserver闂寸殑鍧楄縼縐匯侻aster瀹氭湡閫氳繃HeartBeat娑堟伅涓庢瘡涓涓?chunkserver閫氫俊錛岀粰chunkserver浼犻掓寚浠ゅ茍鏀墮泦瀹冪殑鐘舵併?
涓庢瘡涓簲鐢ㄧ浉鑱旂殑GFS瀹㈡埛浠g爜瀹炵幇浜嗘枃浠剁郴緇熺殑API騫朵笌master鍜宑hunkserver閫氫俊浠ヤ唬琛ㄥ簲鐢ㄧ▼搴忚鍜屽啓鏁版嵁銆傚鎴蜂笌master鐨勪氦鎹㈠彧闄愪簬瀵瑰厓鏁版嵁錛坢etadata錛夌殑鎿嶄綔錛屾墍鏈夋暟鎹柟闈㈢殑閫氫俊閮界洿鎺ュ拰chunkserver鑱旂郴銆?
瀹㈡埛鍜宑hunkserver閮戒笉緙撳瓨鏂囦歡鏁版嵁銆傚洜涓虹敤鎴風紦瀛樼殑鐩婂寰箮鍏跺井錛岃繖鏄敱浜庢暟鎹お澶氭垨宸ヤ綔闆嗗お澶ц屾棤娉曠紦瀛樸備笉緙撳瓨鏁版嵁綆鍖栦簡瀹㈡埛紼嬪簭鍜屾暣涓郴緇燂紝鍥犱負涓嶅繀鑰冭檻緙撳瓨鐨勪竴鑷存ч棶棰樸備絾鐢ㄦ埛緙撳瓨鍏冩暟鎹紙metadata錛夈侰hunkserver涔熶笉蹇呯紦瀛樻枃浠訛紝鍥犱負鍧楁椂浣滀負鏈湴鏂囦歡瀛樺偍鐨勩?
錛?錛夊崟master銆?
鍙湁涓涓猰aster涔熸瀬澶х殑綆鍖栦簡璁捐騫朵嬌寰梞aster鍙互鏍規嵁鍏ㄥ眬鎯呭喌浣滃嚭鍏堣繘鐨勫潡鏀劇疆鍜屽鍒跺喅瀹氥備絾鏄垜浠繀欏昏灝唌aster瀵硅鍜屽啓鐨勫弬涓庡噺鑷蟲渶灝戯紝榪欐牱瀹冩墠涓嶄細鎴愪負緋葷粺鐨勭摱棰堛侰lient浠庢潵涓嶄細浠巑aster璇誨拰鍐欐枃浠舵暟鎹侰lient鍙槸璇㈤棶master瀹冨簲璇ュ拰鍝釜 chunkserver鑱旂郴銆侰lient鍦ㄤ竴孌甸檺瀹氱殑鏃墮棿鍐呭皢榪欎簺淇℃伅緙撳瓨錛屽湪鍚庣畫鐨勬搷浣滀腑Client鐩存帴鍜宑hunkserver浜や簰銆?
浠ュ浘1瑙i噴涓涓嬩竴涓畝鍗曠殑璇繪搷浣滅殑浜や簰銆?
1銆乧lient浣跨敤鍥哄畾鐨勫潡澶у皬灝嗗簲鐢ㄧ▼搴忔寚瀹氱殑鏂囦歡鍚嶅拰瀛楄妭鍋忕Щ杞崲鎴愭枃浠剁殑涓涓潡绱㈠紩錛坈hunk index錛夈?
2銆佺粰master鍙戦佷竴涓寘鍚枃浠跺悕鍜屽潡绱㈠紩鐨勮姹傘?
3銆乵aster鍥炲簲瀵瑰簲鐨刢hunk handle鍜屽壇鏈殑浣嶇疆錛堝涓壇鏈級銆?
4銆乧lient浠ユ枃浠跺悕鍜屽潡绱㈠紩涓洪敭緙撳瓨榪欎簺淇℃伅銆傦紙handle鍜屽壇鏈殑浣嶇疆錛夈?
5銆丆lient 鍚戝叾涓竴涓壇鏈彂閫佷竴涓姹傦紝寰堝彲鑳芥槸鏈榪戠殑涓涓壇鏈傝姹傛寚瀹氫簡chunk handle錛坈hunkserver浠hunk handle鏍囪瘑chunk錛夊拰鍧楀唴鐨勪竴涓瓧鑺傚尯闂淬?
6銆侀櫎闈炵紦瀛樼殑淇℃伅涓嶅啀鏈夋晥錛坈ache for a limited time錛夋垨鏂囦歡琚噸鏂版墦寮錛屽惁鍒欎互鍚庡鍚屼竴涓潡鐨勮鎿嶄綔涓嶅啀闇瑕乧lient鍜宮aster闂寸殑浜や簰銆?
閫氬父Client鍙互鍦ㄤ竴涓姹備腑璇㈤棶澶氫釜chunk鐨勫湴鍧錛岃宮aster涔熷彲浠ュ緢蹇洖搴旇繖浜涜姹傘?
錛?錛夊潡瑙勬ā錛?
鍧楄妯℃槸璁捐涓殑涓涓叧閿弬鏁般傛垜浠夋嫨鐨勬槸64MB錛岃繖姣斾竴鑸殑鏂囦歡緋葷粺鐨勫潡瑙勬ā瑕佸ぇ鐨勫銆傛瘡涓潡鐨勫壇鏈綔涓轟竴涓櫘閫氱殑Linux鏂囦歡瀛樺偍錛屽湪闇瑕佺殑鏃跺欏彲浠ユ墿灞曘?
鍧楄妯¤緝澶х殑濂藉鏈夛細
1銆佸噺灝慶lient鍜宮aster涔嬮棿鐨勪氦浜掋傚洜涓鴻鍐欏悓涓涓潡鍙槸瑕佸湪寮濮嬫椂鍚憁aster璇鋒眰鍧椾綅緗俊鎭傚浜庤鍐欏ぇ鍨嬫枃浠惰繖縐嶅噺灝戝挨涓洪噸瑕併傚嵆浣垮浜庤闂皯閲忔暟鎹殑闅忔満璇繪搷浣滀篃鍙互寰堟柟渚跨殑涓轟竴涓妯¤揪鍑犱釜TB鐨勫伐浣滈泦緙撶紦瀛樺潡浣嶇疆淇℃伅銆?
2銆丆lient鍦ㄤ竴涓粰瀹氱殑鍧椾笂寰堝彲鑳芥墽琛屽涓搷浣滐紝鍜屼竴涓猚hunkserver淇濇寔杈冮暱鏃墮棿鐨凾CP榪炴帴鍙互鍑忓皯緗戠粶璐熻澆銆?
3銆佽繖鍑忓皯浜唌aster涓婁繚瀛樼殑鍏冩暟鎹紙metadata錛夌殑瑙勬ā錛屼粠鑰屼嬌寰楀彲浠ュ皢metadata鏀懼湪鍐呭瓨涓傝繖鍙堜細甯︽潵涓浜涘埆鐨勫ソ澶勩?
涓嶅埄鐨勪竴闈細
涓涓皬鏂囦歡鍙兘鍙寘鍚竴涓潡錛屽鏋滃緢澶欳lient璁塊棶鏀規枃浠剁殑璇濓紝瀛樺偍榪欎簺鍧楃殑chunkserver灝嗘垚涓鴻闂殑鐑偣銆備絾鍦ㄥ疄闄呭簲鐢ㄤ腑錛屽簲鐢ㄧ▼搴忛氬父欏哄簭鍦拌鍖呭惈澶氫釜鍧楃殑鏂囦歡錛屾墍浠ヨ繖涓嶆槸涓涓富瑕侀棶棰樸?
錛?錛夊厓鏁版嵁錛坢etadata錛夛細
master瀛樺偍浜嗕笁涓被鍨嬬殑metadata錛氭枃浠剁殑鍚嶅瓧絀洪棿鍜屽潡鐨勫悕瀛楃┖闂達紝浠庢枃浠跺埌鍧楃殑鏄犲皠錛屽潡鐨勫壇鏈殑浣嶇疆銆傛墍鏈夌殑metadata閮芥斁鍦ㄥ唴瀛樹腑銆傚墠涓ょ綾誨瀷鐨刴etadata閫氳繃鍚戞搷浣滄棩蹇楃櫥璁頒慨鏀硅屼繚鎸佷笉鍙橈紝鎿嶄綔鏃ュ織瀛樺偍鍦╩aster鐨勬湰鍦扮鐩樺茍鍦ㄥ嚑涓繙紼嬫満鍣ㄤ笂鐣欐湁鍓湰銆備嬌鐢ㄦ棩蹇椾嬌寰楁垜浠彲浠ュ緢綆鍗曞湴銆佸彲闈犲湴鏇存柊master鐨勭姸鎬侊紝鍗充嬌鍦╩aster宕╂簝鐨勬儏鍐典笅涔熶笉浼氭湁涓嶄竴鑷寸殑闂銆傜浉鍙嶏紝mater鍦ㄦ瘡嬈″惎鍔ㄤ互鍙婂綋鏈?chuankserver鍔犲叆鐨勬椂鍊欒闂瘡涓猚hunkserver鐨勬墍鎷ユ湁鐨勫潡鐨勬儏鍐點?
A銆佸唴瀛樻暟鎹粨鏋勶細
鍥犱負metadata瀛樺偍鍦ㄥ唴瀛樹腑錛屾墍浠aster鐨勬搷浣滃緢蹇傝繘涓姝ワ紝master鍙互杞繪槗鑰屼笖楂樻晥鍦板畾鏈熷湪鍚庡彴鎵弿瀹冪殑鏁翠釜鐘舵併傝繖縐嶅畾鏈熷湴鎵弿琚敤浜庡疄鐜板潡鍨冨溇鏀墮泦銆乧hunkserver鍑虹幇鏁呴殰鏃剁殑鍓湰澶嶅埗銆佷負騫寵 璐熻澆鍜岀鐩樼┖闂磋岃繘琛岀殑鍧楄縼縐匯?
榪欑鏂規硶鐨勪竴涓綔鍦ㄧ殑闂灝辨槸鍧楃殑鏁伴噺涔熷嵆鏁翠釜緋葷粺鐨勫閲忔槸鍚﹀彈闄愪笌master鐨勫唴瀛樸傚疄闄呬笂錛岃繖騫朵笉鏄竴涓弗閲嶇殑闂銆侻aster涓烘瘡涓?64MB鐨勫潡緇存姢鐨刴etadata涓嶈凍64涓瓧鑺傘傞櫎浜嗘渶鍚庝竴鍧楋紝鏂囦歡鎵鏈夌殑鍧楅兘鏄弧鐨勩傜被浼肩殑錛屾瘡涓枃浠剁殑鍚嶅瓧絀洪棿鏁版嵁涔熶笉瓚?4涓瓧鑺傦紝鍥犱負鏂囦歡鍚嶆槸浠ヤ竴縐嶄簨鍏堢‘瀹氱殑鍘嬬緝鏂瑰紡瀛樺偍鐨?濡傛灉瑕佹敮鎸佹洿澶х殑鏂囦歡緋葷粺錛岄偅涔堝鍔犱竴浜涘唴瀛樼殑鏂規硶瀵逛簬鎴戜滑灝嗗厓鏁版嵁錛坢etadata錛変繚瀛樺湪鍐呭瓨縐嶆墍鑾峰緱鐨勭畝鍗曟с佸彲闈犳с侀珮鎬ц兘鍜岀伒媧繪ф潵璇達紝榪欏彧鏄竴涓緢灝忕殑浠d環銆?
B銆佸潡浣嶇疆錛?
master騫朵笉涓篶hunkserver鎵鎷ユ湁鐨勫潡鐨勫壇鏈殑淇濆瓨涓涓笉鍙樼殑璁板綍銆傚畠鍦ㄥ惎鍔ㄦ椂閫氳繃綆鍗曠殑鏌ヨ鏉ヨ幏寰楄繖浜涗俊鎭侻aster鍙互淇濇寔榪欎簺淇℃伅鐨勬洿鏂幫紝鍥犱負瀹冩帶鍒舵墍鏈夊潡鐨勬斁緗茍閫氳繃HeartBeat娑堟伅鏉ョ洃鎺hunkserver鐨勭姸鎬併?
榪欐牱鍋氱殑濂藉錛氬洜涓篶hunkserver鍙兘鍔犲叆鎴栫寮闆嗙兢銆佹敼鍙樿礬寰勫悕銆佸穿婧冦侀噸鍚瓑錛屼竴涓泦緹ら噸鏈夋垚鐧句釜server錛岃繖浜涗簨浠剁粡甯稿彂鐢燂紝榪欑鏂規硶灝辨帓闄や簡master涓巆hunkserver涔嬮棿鐨勫悓姝ラ棶棰樸?
鍙︿竴涓師鍥犳槸錛氬彧鏈塩hunkserver鎵嶈兘紜畾瀹冭嚜宸卞埌搴曟湁鍝簺鍧楋紝鐢變簬閿欒錛宑hunkserver涓殑涓浜涘潡鍙兘浼氬緢鑷劧鐨勬秷澶憋紝榪欐牱鍦╩aster涓氨娌℃湁蹇呰涓烘淇濆瓨涓涓笉鍙樼殑璁板綍銆?
C銆佹搷浣滄棩蹇楋細
鎿嶄綔鏃ュ織鍖呭惈浜嗗metadata鎵浣滅殑淇敼鐨勫巻鍙茶褰曘傚畠浣滀負閫昏緫鏃墮棿綰垮畾涔変簡騫跺彂鎿嶄綔鐨勬墽琛岄『搴忋傛枃浠躲佸潡浠ュ強瀹冧滑鐨勭増鏈彿閮界敱瀹冧滑琚垱寤烘椂鐨勯昏緫鏃墮棿鑰屽敮涓鍦般佹案涔呭湴琚爣璇嗐?
鎿嶄綔鏃ュ織鏄姝ょ殑閲嶈錛屾垜浠繀欏昏灝嗗畠鍙潬鍦頒繚瀛樿搗鏉ワ紝騫朵笖鍙湁鍦╩etadata鐨勬敼鍙樺浐瀹氫笅鏉ヤ箣鍚庢墠灝嗗彉鍖栧憟鐜扮粰鐢ㄦ埛銆傛墍浠ユ垜浠皢鎿嶄綔鏃ュ織澶嶅埗鍒版暟涓繙紼嬬殑鏈哄櫒涓婏紝騫朵笖鍙湁鍦ㄥ皢鐩稿簲鐨勬棩蹇楄褰曞啓鍒版湰鍦板拰榪滅▼鐨勭鐩樹笂涔嬪悗鎵嶅洖絳旂敤鎴風殑璇鋒眰銆?
Master鍙互鐢ㄦ搷浣滄棩蹇楁潵鎭㈠瀹冪殑鏂囦歡緋葷粺鐨勭姸鎬併備負浜嗗皢鍚姩鏃墮棿鍑忚嚦鏈灝忥紝鏃ュ織灝卞繀欏昏姣旇緝灝忋傛瘡褰撴棩蹇楃殑闀垮害澧為暱鍒拌秴榪囦竴瀹氱殑瑙勬ā鍚庯紝master灝辮媯鏌ュ畠鐨勭姸鎬侊紝瀹冨彲浠ヤ粠鏈湴紓佺洏瑁呭叆鏈榪戠殑媯鏌ョ偣鏉ユ仮澶嶇姸鎬併?
鍒涘緩涓涓鏌ョ偣姣旇緝璐規椂錛宮aster鐨勫唴閮ㄧ姸鎬佹槸浠ヤ竴縐嶅湪鍒涘緩涓涓鏌ョ偣鏃跺茍涓嶈借鍗沖皢鍒版潵鐨勪慨鏀規搷浣滅殑鏂瑰紡鏉ョ粍緇囩殑銆侻aster鍒囨崲鍒頒竴涓柊鐨勬棩瀛愭枃浠跺茍鍦ㄤ竴涓崟鐙殑綰跨▼涓垱寤烘鏌ョ偣銆傝繖涓柊鐨勬鏌ョ偣璁板綍浜嗗垏鎹㈠墠鎵鏈夌殑淇敼銆傚湪涓涓湁鏁板崄涓囨枃浠剁殑闆嗙兢涓敤涓鍒嗛挓宸﹀彸灝辮兘瀹屾垚銆傚垱寤哄畬鍚庯紝灝嗗畠鍐欏叆鏈湴鍜岃繙紼嬬殑紓佺洏銆?
錛?錛夋暟鎹畬鏁存?
鍚嶅瓧絀洪棿鐨勪慨鏀瑰繀欏繪槸鍘熷瓙鎬х殑錛屽畠浠彧鑳芥湁master澶勭悊錛氬悕瀛楃┖闂撮攣淇濊瘉浜嗘搷浣滅殑鍘熷瓙鎬у拰姝g‘鎬э紝鑰宮aster鐨勬搷浣滄棩蹇楀湪鍏ㄥ眬鑼冨洿鍐呭畾涔変簡榪欎簺鎿嶄綔鐨勯『搴忋?
鏂囦歡鍖洪棿鐨勭姸鎬佸湪淇敼涔嬪悗渚濊禆浜庝慨鏀圭殑綾誨瀷錛屼笉璁烘搷浣滄垚鍔熻繕鏄け璐ワ紝涔熶笉璁烘槸涓嶆槸騫跺彂鎿嶄綔銆傚鏋滀笉璁轟粠鍝釜鍓湰涓婅錛屾墍鏈夌殑瀹㈡埛閮界湅鍒板悓鏍風殑鏁版嵁錛岄偅涔堟枃浠剁殑榪欎釜鍖哄煙灝辨槸涓鑷寸殑銆傚鏋滄枃浠剁殑鍖哄煙鏄竴鑷寸殑騫朵笖鐢ㄦ埛鍙互鐪嬪埌淇敼鎿嶄綔鎵鍐欑殑鏁版嵁錛岄偅涔堝畠灝辨槸宸插畾涔夌殑銆傚鏋滀慨鏀規槸鍦ㄦ病鏈夊茍鍙戝啓鎿嶄綔鐨勫獎鍝嶄笅瀹屾垚鐨勶紝閭d箞鍙楀獎鍝嶇殑鍖哄煙鏄凡瀹氫箟鐨勶紝鎵鏈夌殑client閮借兘鐪嬪埌鍐欑殑鍐呭銆傛垚鍔熺殑騫跺彂鍐欐搷浣滄槸鏈畾涔変絾鍗存槸涓鑷寸殑銆傚け璐ョ殑淇敼灝嗕嬌鍖洪棿澶勪簬涓嶄竴鑷寸殑鐘舵併?
Write鎿嶄綔鍦ㄥ簲鐢ㄧ▼搴忔寚瀹氱殑鍋忕Щ澶勫啓鍏ユ暟鎹紝鑰宺ecord append鎿嶄綔浣垮緱鏁版嵁錛堣褰曪級鍗充嬌鍦ㄦ湁騫跺彂淇敼鎿嶄綔鐨勬儏鍐典笅涔熻嚦灝戝師瀛愭х殑琚姞鍒癎FS鎸囧畾鐨勫亸縐誨錛屽亸縐誨湴鍧琚繑鍥炵粰鐢ㄦ埛銆?
鍦ㄤ竴緋誨垪鎴愬姛鐨勪慨鏀規搷浣滃悗錛屾渶鍚庣殑淇敼鎿嶄綔淇濊瘉鏂囦歡鍖哄煙鏄凡瀹氫箟鐨勩侴FS閫氳繃瀵規墍鏈夌殑鍓湰鎵ц鍚屾牱欏哄簭鐨勪慨鏀規搷浣滃茍涓斾嬌鐢ㄥ潡鐗堟湰鍙鋒嫻嬭繃鏃剁殑鍓湰錛堢敱浜巆hunkserver閫鍑鴻屽鑷翠涪澶變慨鏀癸級鏉ュ仛鍒拌繖涓鐐廣?
鍥犱負鐢ㄦ埛緙撳瓨浜嗕細浣嶇疆淇℃伅錛屾墍浠ュ湪鏇存柊緙撳瓨涔嬪墠鏈夊彲鑳戒粠涓涓繃鏃剁殑鍓湰涓鍙栨暟鎹備絾榪欐湁緙撳瓨鐨勬埅姝㈡椂闂村拰鏂囦歡鐨勯噸鏂版墦寮鑰屽彈鍒伴檺鍒躲?
鍦ㄤ慨鏀規搷浣滄垚鍔熷悗錛岄儴浠舵晠闅滀粛鍙互鏄暟鎹彈鍒扮牬鍧忋侴FS閫氳繃master鍜宑hunkserver闂村畾鏈熺殑handshake錛屽熷姪鏍¢獙鍜屾潵媯嫻嬪鏁版嵁鐨勭牬鍧忋備竴鏃︽嫻嬪埌錛屽氨浠庝竴涓湁鏁堢殑鍓湰灝藉揩閲嶆柊瀛樺偍銆傚彧鏈夊湪GFS媯嫻嬪墠錛屾墍鏈夌殑鍓湰閮藉け鏁堬紝榪欎釜鍧楁墠浼氫涪澶便?
2銆佺郴緇熶氦浜?
錛?錛夌綰︼紙lease錛夊拰淇敼欏哄簭錛?
錛?錛夋暟鎹祦
鎴戜滑鐨勭洰鏍囨槸鍏呭垎鍒╃敤姣忎釜鏈哄櫒鐨勭綉緇滃甫瀹斤紝閬垮厤緗戠粶鐡墮鍜屽歡榪?
涓轟簡鏈夋晥鐨勫埄鐢ㄧ綉緇滐紝鎴戜滑灝嗘暟鎹祦鍜屾帶鍒舵祦鍒嗙銆傛暟鎹槸浠ユ祦姘寸嚎鐨勬柟寮忓湪閫夊畾鐨刢hunkerserver閾句笂綰挎х殑浼犻掔殑銆傛瘡涓満鍣ㄧ殑鏁翠釜瀵瑰甯﹀閮借鐢ㄤ綔浼犻掓暟鎹備負閬垮厤鐡墮錛屾瘡涓満鍣ㄥ湪鏀跺埌鏁版嵁鍚庯紝灝嗗畠鏀跺埌鏁版嵁灝藉揩浼犻掔粰紱誨畠鏈榪戠殑鏈哄櫒銆?
錛?錛夊師瀛愭х殑record Append錛?
GFS鎻愪緵浜嗕竴涓師瀛愭х殑娣誨姞鎿嶄綔錛歳ecord append銆傚湪浼犵粺鐨勫啓鎿嶄綔涓紝client鎸囧畾琚啓鏁版嵁鐨勫亸縐諱綅緗紝鍚戝悓涓涓尯闂寸殑騫跺彂鐨勫啓鎿嶄綔鏄笉榪炵畫鐨勶細鍖洪棿鏈夊彲鑳藉寘鍚潵鑷涓猚lient鐨勬暟鎹鐗囥傚湪record append涓紝 client鍙槸鎸囧畾鏁版嵁銆侴FS鍦ㄥ叾閫夊畾鐨勫亸縐誨嚭灝嗘暟鎹嚦灝戝師瀛愭х殑鍔犲叆鏂囦歡涓嬈★紝騫跺皢鍋忕Щ榪斿洖緇檆lient銆?
鍦ㄥ垎甯冨紡鐨勫簲鐢ㄤ腑錛屼笉鍚屾満鍣ㄤ笂鐨勮澶歝lient鍙兘浼氬悓鏃跺悜涓涓枃浠舵墽琛屾坊鍔犳搷浣滐紝娣誨姞鎿嶄綔琚綣佷嬌鐢ㄣ傚鏋滅敤浼犵粺鐨剋rite鎿嶄綔錛屽彲鑳介渶瑕侀澶栫殑銆佸鏉傜殑銆佸紑閿杈冨ぇ鐨勫悓姝ワ紝渚嬪閫氳繃鍒嗗竷寮忛攣綆$悊銆傚湪鎴戜滑鐨勫伐浣滈噺涓紝榪欎簺鏂囦歡閫氬父浠ュ涓敓浜ц呭崟涓秷璐硅呴槦鍒楃殑鏂瑰紡鎴栧寘鍚粠澶氫釜涓嶅悓 client鐨勭患鍚堢粨鏋溿?
Record append鍜屽墠闈㈣鐨剋rite鎿嶄綔鐨勬帶鍒舵祦宸笉澶氾紝鍙槸鍦╬rimary涓婂浜嗕竴浜涢昏緫鍒ゆ柇銆傞鍏堬紝client灝嗘暟鎹彂閫佸埌鏂囦歡鏈鍚庝竴鍧楃殑鎵鏈夊壇鏈笂銆傜劧鍚庡悜primary鍙戦佽姹傘侾rimary媯鏌ユ坊鍔犳搷浣滄槸鍚︿細瀵艱嚧璇ュ潡瓚呰繃鏈澶х殑瑙勬ā錛?4M錛夈傚鏋滆繖鏍鳳紝瀹冨皢璇ュ潡鎵╁厖鍒版渶澶ц妯★紝騫跺憡璇夊叾瀹冨壇鏈仛鍚屾牱鐨勪簨錛屽悓鏃墮氱煡client璇ユ搷浣滈渶瑕佸湪涓嬩竴涓潡涓婇噸鏂板皾璇曘傚鏋滆褰曟弧瓚蟲渶澶ц妯$殑瑕佹眰錛宲rimary灝變細灝嗘暟鎹坊鍔犲埌瀹冪殑鍓湰涓婏紝騫跺憡璇夊叾瀹冪殑鍓湰鍦ㄥ湪鍚屾牱鐨勫亸縐誨鍐欐暟鎹紝鏈鍚巔rimary鍚慶lient鎶ュ憡鍐欐搷浣滄垚鍔熴傚鏋滃湪浠諱綍涓涓壇鏈笂record append鎿嶄綔澶辮觸錛宑lient灝嗛噸鏂板皾璇曡鎿嶄綔銆傝繖鏃跺欙紝鍚屼竴涓潡鐨勫壇鏈彲鑳藉寘鍚笉鍚岀殑鏁版嵁錛屽洜涓烘湁鐨勫彲鑳藉鍒朵簡鍏ㄩ儴鐨勬暟鎹紝鏈夌殑鍙兘鍙鍒朵簡閮ㄥ垎銆侴FS涓嶈兘淇濊瘉鎵鏈夌殑鍓湰姣忎釜瀛楄妭閮芥槸涓鏍風殑銆傚畠鍙繚璇佹瘡涓暟鎹綔涓轟竴涓師瀛愬崟鍏冭鍐欒繃鑷沖皯涓嬈°傝繖涓槸榪欐牱寰楀嚭鐨勶細鎿嶄綔瑕佹槸鎴愬姛錛屾暟鎹繀欏誨湪鎵鏈夌殑鍓湰涓婄殑鍚屾牱鐨勫亸縐誨琚啓榪囥傝繘涓姝ワ紝浠庤繖浠ュ悗錛屾墍鏈夌殑鍓湰鑷沖皯鍜岃褰曚竴鏍烽暱錛屾墍浠ュ悗緇殑璁板綍灝嗚鎸囧畾鍒版洿楂樼殑鍋忕Щ澶勬垨鑰呬竴涓笉鍚岀殑鍧椾笂錛屽嵆浣垮彟涓涓壇鏈垚浜唒rimary銆傛牴鎹竴鑷存т繚璇侊紝鎴愬姛鐨剅ecord append鎿嶄綔鐨勫尯闂存槸宸插畾涔夌殑銆傝屽彈鍒板共鎵扮殑鍖洪棿鏄笉涓鑷寸殑銆?
錛?錛夊揩鐓э紙snapshot錛?
蹇収鎿嶄綔鍑犱箮鍦ㄧ灛闂存瀯閫犱竴涓枃浠跺拰鐩綍鏍戠殑鍓湰錛屽悓鏃跺皢姝e湪榪涜鐨勫叾浠栦慨鏀規搷浣滃瀹冪殑褰卞搷鍑忚嚦鏈灝忋?
鎴戜滑浣跨敤copy-on-write鎶鏈潵瀹炵幇snapshot銆傚綋master鍙楀埌涓涓猻napshot璇鋒眰鏃訛紝瀹冮鍏堝皢瑕乻napshot鐨勬枃浠朵笂鍧椾笂鐨刲ease銆傝繖浣垮緱浠諱綍涓涓悜榪欎簺鍧楀啓鏁版嵁鐨勬搷浣滈兘蹇呴』鍜宮aster浜や簰浠ユ壘鍒版嫢鏈塴ease鐨勫壇鏈傝繖灝辯粰master涓涓垱寤鴻繖涓潡鐨勫壇鏈殑鏈轟細銆?
鍓湰琚挙閿鎴栫粓姝㈠悗錛宮aster鍦ㄧ鐩樹笂鐧昏鎵ц鐨勬搷浣滐紝鐒跺悗澶嶅埗婧愭枃浠舵垨鐩綍鏍戠殑metadata浠ュ瀹冪殑鍐呭瓨鐘舵佸疄鏂界櫥璁扮殑鎿嶄綔銆傝繖涓柊鍒涘緩鐨剆napshot鏂囦歡鍜屾簮鏂囦歡錛堝叾metadata錛夋寚鍚戠浉鍚岀殑鍧楋紙chunk錛夈?
Snapshot涔嬪悗錛屽鎴風涓嬈″悜chunk c鍐欑殑鏃跺欙紝瀹冨彂涓涓姹傜粰master浠ユ壘鍒版嫢鏈塴ease鐨勫壇鏈侻aster娉ㄦ剰鍒癱hunk c鐨勫紩鐢ㄨ鏁版瘮1澶э紝瀹冨歡榪熷鐢ㄦ埛鐨勫搷搴旓紝閫夋嫨涓涓猚hunk handle C鈥?鐒跺悗瑕佹眰姣忎竴鏈塩hunk c鐨勫壇鏈殑chunkserver鍒涘緩涓涓潡C鈥欍傛瘡涓猚hunkserver鍦ㄦ湰鍦板垱寤篶hunk C鈥欓伩鍏嶄簡緗戠粶寮閿銆備粠榪欎互鍚庡拰瀵瑰埆鐨勫潡鐨勬搷浣滄病鏈変粈涔堝尯鍒?
3銆丮ASTER鎿嶄綔
MASTER鎵ц鎵鏈夊悕瀛楃┖闂寸殑鎿嶄綔錛岄櫎姝や箣澶栵紝浠栬繕鍦ㄧ郴緇熻寖鍥寸鐞嗘暟鎹潡鐨勫鍒訛細鍐沖畾鏁版嵁鍧楃殑鏀劇疆鏂規錛屼駭鐢熸柊鏁版嵁鍧楀茍灝嗗叾澶囦喚錛屽拰鍏朵粬緋葷粺鑼冨洿鐨勬搷浣滃崗鍚屾潵紜繚鏁版嵁澶囦喚鐨勫畬鏁存э紝鍦ㄦ墍鏈夌殑鏁版嵁鍧楁湇鍔″櫒涔嬮棿騫寵 璐熻澆騫舵敹鍥炴病鏈変嬌鐢ㄧ殑瀛樺偍絀洪棿銆?
3.1 鍚嶅瓧絀洪棿綆$悊鍜屽姞閿?
涓庝紶緇熸枃浠剁郴緇熶笉鍚岀殑鏄紝GFS娌℃湁涓庢瘡涓洰褰曠浉鍏崇殑鑳藉垪鍑哄叾鎵鏈夋枃浠剁殑鏁版嵁緇撴瀯錛屽畠涔熶笉鏀寔鍒悕錛坲nix涓殑紜繛鎺ユ垨絎﹀彿榪炴帴錛夛紝涓嶇鏄鏂囦歡鎴栨槸鐩綍銆侴FS鐨勫悕瀛楃┖闂撮昏緫涓婃槸浠庢枃浠跺厓鏁版嵁鍒拌礬寰勫悕鏄犲皠鐨勪竴涓煡鐢ㄨ〃銆?
MASTER鍦ㄦ墽琛屾煇涓搷浣滃墠閮借鑾峰緱涓緋誨垪閿侊紝渚嬪錛屽畠瑕佸/d1/d2鈥?dn/leaf鎵ц鎿嶄綔錛屽垯瀹冨繀欏昏幏寰?d1錛?d1/d2錛屸︼紝 /d1/d2/鈥?dn鐨勮閿侊紝/d1/d2鈥?dn/leaf鐨勮閿佹垨鍐欓攣錛堝叾涓璴eaf鍙互浣挎枃浠朵篃鍙互鏄洰褰曪級銆侻ASTER鎿嶄綔鐨勫茍琛屾у拰鏁版嵁鐨勪竴鑷存у氨鏄氳繃榪欎簺閿佹潵瀹炵幇鐨勩?
3.2 澶囦喚瀛樺偍鏀劇疆絳栫暐
涓涓狦FS闆嗙兢鏂囦歡緋葷粺鍙兘鏄灞傚垎甯冪殑銆備竴鑸儏鍐典笅鏄垚鍗冧笂涓囦釜鏂囦歡鍧楁湇鍔″櫒鍒嗗竷浜庝笉鍚岀殑鏈烘灦涓婏紝鑰岃繖浜涙枃浠跺潡鏈嶅姟鍣ㄥ張琚垎甯冧簬涓嶅悓鏈烘灦涓婄殑瀹㈡埛鏉ヨ闂傚洜姝わ紝涓嶅悓鏈烘灦涓婄殑涓ゅ彴鏈哄櫒涔嬮棿鐨勯氫俊鍙兘閫氳繃涓涓垨澶氫釜浜ゆ崲鏈恒傛暟鎹潡鍐椾綑閰嶇疆絳栫暐瑕佽揪鍒拌繛涓洰鐨勶細鏈澶х殑鏁版嵁鍙潬鎬у拰鍙敤鎬э紝鏈澶х殑緗戠粶甯﹀鍒╃敤鐜囥傚洜姝わ紝濡傛灉浠呬粎鎶婃暟鎹殑鎷瘋礉緗簬涓嶅悓鐨勬満鍣ㄤ笂寰堥毦婊¤凍榪欎袱涓姹傦紝蹇呴』鍦ㄤ笉鍚岀殑鏈烘灦涓婅繘琛屾暟鎹浠姐傝繖鏍峰嵆浣挎暣涓満鏋惰姣佹垨鏄帀綰匡紝涔熻兘紜繚鏁版嵁鐨勬甯鎬嬌鐢ㄣ傝繖涔熶嬌鏁版嵁浼犺緭錛屽挨鍏舵槸璇繪暟鎹紝鍙互鍏呭垎鍒╃敤甯﹀錛岃闂埌澶氫釜鏈烘灦錛岃屽啓鎿嶄綔錛屽垯涓嶅緱涓嶆秹鍙婂埌鏇村鐨勬満鏋躲?
3.3 浜х敓銆侀噸澶嶅埗銆侀噸騫寵 鏁版嵁鍧?
褰揗ASTER浜х敓鏂扮殑鏁版嵁鍧楁椂錛屽浣曟斁緗柊鏁版嵁鍧楋紝瑕佽冭檻濡備笅鍑犱釜鍥犵礌錛氾紙1錛夊敖閲忔斁緗湪紓佺洏鍒╃敤鐜囦綆鐨勬暟鎹潡鏈嶅姟鍣ㄤ笂錛岃繖鏍鳳紝鎱㈡參鍦板悇鏈嶅姟鍣ㄧ殑紓佺洏鍒╃敤鐜囧氨浼氳揪鍒板鉤琛°傦紙2錛夊敖閲忔帶鍒跺湪涓涓湇鍔″櫒涓婄殑鈥滄柊鍒涘緩鈥濈殑嬈℃暟銆傦紙3錛夌敱浜庝笂涓灝忚妭璁ㄨ鐨勫師鍥狅紝鎴戜滑闇瑕佹妸鏁版嵁鍧楁斁緗簬涓嶅悓鐨勬満鏋朵笂銆?
MASTER鍦ㄥ彲鐢ㄧ殑鏁版嵁鍧楀浠戒綆浜庣敤鎴瘋瀹氱殑鏁扮洰鏃墮渶瑕佽繘琛岄噸澶嶅埗銆傝繖縐嶆儏鍐墊簮浜庡縐嶅師鍥狅細鏈嶅姟鍣ㄤ笉鍙敤錛屾暟鎹鐮村潖錛岀鐩樿鐮村潖錛屾垨鑰呭浠芥暟鐩淇敼銆傛瘡涓闇瑕侀噸澶嶅埗鐨勬暟鎹潡鐨勪紭鍏堢駭鏍規嵁浠ヤ笅鍑犻」紜畾錛氱涓鏄幇鍦ㄧ殑鏁扮洰璺濈洰鏍囩殑璺濈錛屽浜庤兘闃誨鐢ㄦ埛紼嬪簭鐨勬暟鎹潡錛屾垜浠篃鎻愰珮瀹冪殑浼樺厛綰с傛渶鍚庯紝 MASTER鎸夌収浜х敓鏁版嵁鍧楃殑鍘熷垯澶嶅埗鏁版嵁鍧楋紝騫舵妸瀹冧滑鏀懼埌涓嶅悓鐨勬満鏋跺唴鐨勬湇鍔″櫒涓娿?
MASTER鍛ㄦ湡鎬х殑騫寵 鍚勬湇鍔″櫒涓婄殑璐熻澆錛氬畠媯鏌hunk鍒嗗竷鍜岃礋杞藉鉤琛★紝閫氳繃榪欑鏂瑰紡鏉ュ~鍏呬竴涓柊鐨勬湇鍔″櫒鑰屼笉鏄妸鍏朵粬鐨勫唴瀹圭粺緇熸斁緗埌瀹冧笂闈㈠甫鏉ュぇ閲忕殑鍐欐暟鎹傛暟鎹潡鏀劇疆鐨勫師鍒欎笌涓婇潰璁ㄨ鐨勭浉鍚岋紝姝ゅ錛孧ASTER榪樺喅瀹氶偅浜涙暟鎹潡瑕佽縐婚櫎錛屽師鍒欎笂浠栦細娓呴櫎閭d簺絀洪棽絀洪棿浣庝簬騫沖潎鍊肩殑閭d簺鏈嶅姟鍣ㄣ?
3.4 鍨冨溇鏀墮泦
鍦ㄤ竴涓枃浠惰鍒犻櫎涔嬪悗錛孏FS騫朵笉绔嬪嵆鏀跺洖紓佺洏絀洪棿錛岃屾槸絳夊埌鍨冨溇鏀墮泦紼嬪簭鍦ㄦ枃浠跺拰鏁版嵁鍧楃駭鐨勭殑媯鏌ヤ腑鏀跺洖銆?
褰撲竴涓枃浠惰搴旂敤紼嬪簭鍒犻櫎涔嬪悗錛孧ASTER浼氱珛鍗寵褰曚笅榪欎簺鍙樺寲錛屼絾鏂囦歡鎵鍗犵敤鐨勮祫婧愬嵈涓嶄細琚珛鍗蟲敹鍥烇紝鑰屾槸閲嶆柊緇欐枃浠跺懡浜嗕竴涓殣钘忕殑鍚嶅瓧錛屽茍闄勪笂浜嗗垹闄ょ殑鏃墮棿鎴熾傚湪MASTER瀹氭湡媯鏌ュ悕瀛楃┖闂存椂錛屽畠鍒犻櫎瓚呰繃涓夊ぉ錛堝彲浠ヨ瀹氾級鐨勯殣钘忕殑鏂囦歡銆傚湪姝や箣鍓嶏紝鍙互浠ヤ竴涓柊鐨勫悕瀛楁潵璇繪枃浠訛紝榪樺彲浠ヤ互鍓嶇殑鍚嶅瓧鎭㈠銆傚綋闅愯棌鐨勬枃浠跺湪鍚嶅瓧絀洪棿涓鍒犻櫎浠ュ悗錛屽畠鍦ㄥ唴瀛樹腑鐨勫厓鏁版嵁鍗寵鎿﹂櫎錛岃繖灝辨湁鏁堝湴鍒囨柇浜嗕粬鍜屾墍鏈夋暟鎹潡鐨勮仈緋匯?
鍦ㄤ竴涓浉浼肩殑瀹氭湡鐨勫悕瀛楃┖闂存鏌ヤ腑錛孧ASTER紜瀛ゅ効鏁版嵁鍧楋紙涓嶅睘浜庝換浣曟枃浠訛級騫舵摝闄や粬鐨勫厓鏁版嵁錛屽湪鍜孧ASTER鐨勫績璺充俊鎭氦鎹腑錛屾瘡涓湇鍔″櫒鎶ュ憡浠栨墍鎷ユ湁鐨勬暟鎹潡錛孧ASTER榪斿洖鍏冩暟鎹笉鍦ㄥ唴瀛樼殑鏁版嵁鍧楋紝鏈嶅姟鍣ㄥ嵆鍙互鍒犻櫎榪欎簺鏁版嵁鍧椼?
3.5 榪囨椂鏁版嵁鐨勬帰嫻?
鍦ㄦ暟鎹洿鏂版椂濡傛灉鏈嶅姟鍣ㄥ仠鏈轟簡錛岄偅涔堜粬鎵淇濆瓨鐨勬暟鎹浠藉氨浼氳繃鏃躲傚姣忎釜鏁版嵁鍧楋紝MASTER璁劇疆浜嗕竴涓増鏈彿鏉ュ尯鍒洿鏂拌繃鐨勬暟鎹潡鍜岃繃鏃剁殑鏁版嵁鍧椼?
褰揗ASTER鎺堟潈涓涓柊鐨刲ease鏃訛紝浠栦細澧炲姞鏁版嵁鍧楃殑鐗堟湰鍙峰茍浼氶氱煡鏇存柊鏁版嵁澶囦喚銆侻ASTER鍜屽浠介兘浼氳褰曚笅褰撳墠鐨勭増鏈彿錛屽鏋滀竴涓浠藉綋鏃朵笉鍙敤錛岄偅涔堜粬鐨勭増鏈彿涓嶅彲鑳芥彁楂橈紝褰揅hunkServer閲嶆柊鍚姩騫跺悜MASTER鎶ュ憡浠栫殑鏁版嵁鍧楅泦鏃訛紝MASTER灝變細鍙戠幇榪囨椂鐨勬暟鎹?
MASTER鍦ㄥ畾鏈熺殑鍨冨溇鏀墮泦紼嬪簭涓竻闄よ繃鏃剁殑澶囦喚錛屽湪姝や互鍓嶏紝澶勪簬鏁堢巼鑰冭檻錛屽湪鍚勫鎴峰強鑻卞ぇ浣匡紝浠栦細璁や負鏍規湰涓嶅瓨鍦ㄨ繃鏃剁殑鏁版嵁銆備綔涓哄彟涓涓畨鍏ㄦ帾鏂斤紝 MASTER鍦ㄧ粰瀹㈡埛鍙婂叧浜庢暟鎹潡鐨勫簲絳旀垨鏄彟澶栦竴涓鍙栨暟鎹殑鏈嶅姟鍣ㄦ暟鎹槸閮戒細甯︿笂鐗堟湰淇℃伅錛屽湪鎿嶄綔鍓嶅鎴鋒満鍜屾湇鍔″櫒浼氶獙璇佺増鏈俊鎭互紜繚寰楀埌鐨勬槸鏈鏂扮殑鏁版嵁銆?
4銆佸閿欏拰璇婃柇
4.1 楂樺彲闈犳?
4.1.1 蹇熸仮澶?
涓嶇濡備綍緇堟鏈嶅姟錛孧ASTER鍜屾暟鎹潡鏈嶅姟鍣ㄩ兘浼氬湪鍑犵閽熷唴鎭㈠鐘舵佸拰榪愯銆傚疄闄呬笂錛屾垜浠笉瀵規甯哥粓姝㈠拰涓嶆甯哥粓姝㈣繘琛屽尯鍒嗭紝鏈嶅姟鍣ㄨ繘紼嬮兘浼氳鍒囨柇鑰岀粓姝€傚鎴鋒満鍜屽叾浠栫殑鏈嶅姟鍣ㄤ細緇忓巻涓涓皬灝忕殑涓柇錛岀劧鍚庡畠浠殑鐗瑰畾璇鋒眰瓚呮椂錛岄噸鏂拌繛鎺ラ噸鍚殑鏈嶅姟鍣紝閲嶆柊璇鋒眰銆?
4.1.2 鏁版嵁鍧楀浠?
濡備笂鏂囨墍璁ㄨ鐨勶紝姣忎釜鏁版嵁鍧楅兘浼氳澶囦喚鍒版斁鍒頒笉鍚屾満鏋朵笂鐨勪笉鍚屾湇鍔″櫒涓娿傚涓嶅悓鐨勫悕瀛楃┖闂達紝鐢ㄦ埛鍙互璁劇疆涓嶅悓鐨勫浠界駭鍒傚湪鏁版嵁鍧楁湇鍔″櫒鎺夌嚎鎴栨槸鏁版嵁琚牬鍧忔椂錛孧ASTER浼氭寜鐓ч渶瑕佹潵澶嶅埗鏁版嵁鍧椼?
4.1.3 MASTER澶囦喚
涓虹‘淇濆彲闈犳э紝MASTER鐨勭姸鎬併佹搷浣滆褰曞拰媯鏌ョ偣閮藉湪澶氬彴鏈哄櫒涓婅繘琛屼簡澶囦喚銆備竴涓搷浣滃彧鏈夊湪鏁版嵁鍧楁湇鍔″櫒紜洏涓婂埛鏂板茍琚褰曞湪MASTER鍜屽叾澶囦喚鐨勪笂涔嬪悗鎵嶇畻鏄垚鍔熺殑銆傚鏋淢ASTER鎴栨槸紜洏澶辮觸錛岀郴緇熺洃瑙嗗櫒浼氬彂鐜板茍閫氳繃鏀瑰彉鍩熷悕鍚姩瀹冪殑涓涓浠芥満錛岃屽鎴鋒満鍒欎粎浠呮槸浣跨敤瑙勮寖鐨勫悕縐版潵璁塊棶錛屽茍涓嶄細鍙戠幇MASTER鐨勬敼鍙樸?
4.2 鏁版嵁瀹屾暣鎬?
姣忎釜鏁版嵁鍧楁湇鍔″櫒閮藉埄鐢ㄦ牎楠屽拰鏉ユ楠屽瓨鍌ㄦ暟鎹殑瀹屾暣鎬с傚師鍥狅細姣忎釜鏈嶅姟鍣ㄩ殢鏃墮兘鏈夊彂鐢熷穿婧冪殑鍙兘鎬э紝騫朵笖鍦ㄤ袱涓湇鍔″櫒闂存瘮杈冩暟鎹潡涔熸槸涓嶇幇瀹炵殑錛屽悓鏃訛紝鍦ㄤ袱鍙版湇鍔″櫒闂存嫹璐濇暟鎹茍涓嶈兘淇濊瘉鏁版嵁鐨勪竴鑷存с?
姣忎釜Chunk鎸?4kB鐨勫ぇ灝忓垎鎴愬潡錛屾瘡涓潡鏈?2浣嶇殑鏍¢獙鍜岋紝鏍¢獙鍜屽拰鏃ュ織瀛樺偍鍦ㄤ竴璧鳳紝鍜岀敤鎴鋒暟鎹垎寮銆?
鍦ㄨ鏁版嵁鏃訛紝鏈嶅姟鍣ㄩ鍏堟鏌ヤ笌琚鍐呭鐩稿叧閮ㄥ垎鐨勬牎楠屽拰錛屽洜姝わ紝鏈嶅姟鍣ㄤ笉浼氫紶鎾敊璇殑鏁版嵁銆傚鏋滄墍媯鏌ョ殑鍐呭鍜屾牎楠屽拰涓嶇錛屾湇鍔″櫒灝變細緇欐暟鎹姹傝呰繑鍥炰竴涓敊璇殑淇℃伅錛屽茍鎶婅繖涓儏鍐墊姤鍛婄粰MASTER銆傚鎴鋒満灝變細璇誨叾浠栫殑鏈嶅姟鍣ㄦ潵鑾峰彇鏁版嵁錛岃孧ASTER鍒欎細浠庡叾浠栫殑鎷瘋礉鏉ュ鍒舵暟鎹紝絳夊埌涓涓柊鐨勬嫹璐濆畬鎴愭椂錛孧ASTER灝變細閫氱煡鎶ュ憡閿欒鐨勬湇鍔″櫒鍒犻櫎鍑洪敊鐨勬暟鎹潡銆?
闄勫姞鍐欐暟鎹椂鐨勬牎楠屽拰璁$畻浼樺寲浜嗭紝鍥犱負榪欐槸涓昏鐨勫啓鎿嶄綔銆傛垜浠彧鏄洿鏂板鍔犻儴鍒嗙殑鏍¢獙鍜岋紝鍗充嬌鏈熬閮ㄥ垎鐨勬牎楠屽拰鏁版嵁宸茶鎹熷潖鑰屾垜浠病鏈夋鏌ュ嚭鏉ワ紝鏂扮殑鏍¢獙鍜屼笌鏁版嵁浼氫笉鐩哥錛岃繖縐嶅啿紿佸湪涓嬫浣跨敤鏃跺皢浼氳媯鏌ュ嚭鏉ャ?
鐩稿弽錛屽鏋滄槸瑕嗙洊鐜版湁鏁版嵁鐨勫啓錛屽湪鍐欎互鍓嶏紝鎴戜滑蹇呴』媯鏌ョ涓鍜屾渶鍚庝竴涓暟鎹潡錛岀劧鍚庢墠鑳芥墽琛屽啓鎿嶄綔錛屾渶鍚庤綆楀拰璁板綍鏍¢獙鍜屻傚鏋滄垜浠湪瑕嗙洊浠ュ墠涓嶅厛媯鏌ラ浣嶆暟鎹潡錛岃綆楀嚭鐨勬牎楠屽拰鍒欎細鍥犱負娌¤瑕嗙洊鐨勬暟鎹屼駭鐢熼敊璇?
鍦ㄧ┖闂叉椂闂達紝鏈嶅姟鍣ㄤ細媯鏌ヤ笉媧昏穬鐨勬暟鎹潡鐨勬牎楠屽拰錛岃繖鏍峰彲浠ユ鏌ュ嚭涓嶇粡甯歌鐨勬暟鎹殑閿欒銆備竴鏃﹂敊璇媯鏌ュ嚭鏉ワ紝鏈嶅姟鍣ㄤ細鎷瘋礉涓涓紜殑鏁版嵁鍧楁潵浠f浛閿欒鐨勩?
4.3 璇婃柇宸ュ叿
騫挎硾鑰岀粏鑷寸殑璇婃柇鏃ュ織浠ュ井灝忕殑浠d環鎹㈠彇浜嗗湪闂闅旂銆佽瘖鏂佹ц兘鍒嗘瀽鏂歸潰璧峰埌浜嗛噸澶х殑浣滅敤銆侴FS鏈嶅姟鍣ㄧ敤鏃ュ織鏉ヨ褰曟樉钁楃殑浜嬩歡錛堜緥濡傛湇鍔″櫒鍋滄満鍜屽惎鍔級鍜岃繙紼嬬殑搴旂瓟銆傝繙紼嬫棩蹇楄褰曟満鍣ㄤ箣闂寸殑璇鋒眰鍜屽簲絳旓紝閫氳繃鏀墮泦涓嶅悓鏈哄櫒涓婄殑鏃ュ織璁板綍錛屽茍瀵瑰畠浠繘琛屽垎鏋愭仮澶嶏紝鎴戜滑鍙互瀹屾暣鍦伴噸鐜版椿鍔ㄧ殑鍦烘櫙錛屽茍鐢ㄦ鏉ヨ繘琛岄敊璇垎鏋愩?
6 嫻嬮噺
6.1 嫻嬭瘯鐜
涓鍙頒富鎺ф満錛屼袱鍙頒富鎺ф満澶囦喚錛?6鍙版暟鎹潡鏈嶅姟鍣紝16鍙板鎴鋒満銆?
姣忓彴鏈哄櫒錛?鍧桺III1.4G澶勭悊鍣紝2G鍐呭瓨錛?鍧?0G5400rpm鐨勭‖鐩橈紝1鍧?00Mbps鍏ㄥ弻宸ョ綉鍗?
19鍙版湇鍔″櫒榪炴帴鍒頒竴涓狧P2524浜ゆ崲鏈轟笂錛?6鍙板鎴鋒満淇╂帴鍒伴澶栦竴鍙頒氦鎹㈡満涓婏紝涓ゅ彴浜ゆ崲鏈洪氳繃1G鐨勯摼璺浉榪炪?BR>

Google 2003騫村叧浜嶨oogle File System鐨勮鏂?/A>

鍘熸枃鍑哄錛?A >http://www.irunnet.com/viewtopic.php?p=913&sid=4f05f5b8a26e7d0b0e2586190c175d0b#913


]]>
鐮磋ВConfluence http://www.tkk7.com/freddychu/archive/2005/11/08/18756.html椋庤惂钀?/dc:creator>椋庤惂钀?/author>Tue, 08 Nov 2005 05:37:00 GMThttp://www.tkk7.com/freddychu/archive/2005/11/08/18756.htmlhttp://www.tkk7.com/freddychu/comments/18756.htmlhttp://www.tkk7.com/freddychu/archive/2005/11/08/18756.html#Feedback0http://www.tkk7.com/freddychu/comments/commentRss/18756.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/18756.html涓嬭澆錛?A >http://www.atlassian.com/software/confluence/

鐮磋В鍜宩ira涓鏍楓傚弬鑰冩垜鐨勫彟澶栦竴綃囬殢絎旓細銆婄牬瑙IRA銆?/A>銆?img src ="http://www.tkk7.com/freddychu/aggbug/18756.html" width = "1" height = "1" />

]]>
銆愯漿杞姐慻oogle 鐨?1閬撻潰璇曢棶棰?http://www.tkk7.com/freddychu/archive/2005/11/07/18526.html椋庤惂钀?/dc:creator>椋庤惂钀?/author>Mon, 07 Nov 2005 01:36:00 GMThttp://www.tkk7.com/freddychu/archive/2005/11/07/18526.htmlhttp://www.tkk7.com/freddychu/comments/18526.htmlhttp://www.tkk7.com/freddychu/archive/2005/11/07/18526.html#Feedback0http://www.tkk7.com/freddychu/comments/commentRss/18526.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/18526.html杞嚜錛?/FONT>http://www.softboss.com

      10鏈堝簳錛孏oogle鍦ㄧ編鍥姐婇夯鐪佹妧鏈瘎璁恒嬨併奓inuxJournal銆嬨併奙ensa銆嬨併婁粖鏃ョ墿鐞嗐嬬瓑鍑犳湰涓撲笟鏉傚織涓婏紝鍒婄櫥浜嗕竴浠解淕oogle瀹為獙瀹よ兘鍔涘懼悜嫻嬭瘯鈥濄?BR>銆銆璇曞嵎寮澶達紝铔婃儜鍦板啓鐫鈥滆瘯璇曠湅錛佹妸絳旀瀵勫洖Google錛屼綘鏈夊笇鏈涘幓Google鎬婚儴鍙傝錛屽茍鎴愪負鎴戜滑鍏朵腑涓鍛樷濄?/FONT>

鎴戠湅浜嗚繖浜涢鐩紝铏界劧鍙ゆ紝浣嗘槸涔熶笉綆楁湁鍥伴毦錛屾湁鍏磋叮鐨勪漢鍙互鍋氬畬浜嗛偖瀵勭粰google鍏徃錛屼篃璁鎬細寰楀埌涓涓伐浣滄満浼氬憿銆?/FONT>

娉細涓嶈鍚戞垜瑕佺瓟妗堛?/FONT>

1. Solve this cryptic equation, realizing of
course that values for M and E could be
interchanged. No leading zeros are allowed.

WWWDOT - GOOGLE = DOTCOM

2. Write a haiku describing possible methods
for predicting search traffic seasonality.

3.
1
1 1
2 1
1 2 1 1
1 1 1 2 2 1

What is the next line?

4. You are in a maze of twisty little passages,
all alike. There is a dusty laptop here with a
weak wireless connection. There are dull,
lifeless gnomes strolling about. What dost
thou do?

A) Wander aimlessly, bumping into
obstacles until you are eaten by a grue.
B) Use the laptop as a digging device to
tunnel to the next level.
C) Play MPoRPG until the battery dies
along with your hopes.
D) Use the computer to map the nodes
of the maze and discover an exit path.
E) Email your resume to Google, tell the
lead gnome you quit and find yourself
in whole different world.

5. What's broken with Unix?
How would you fix it?

6. On your first day at Google, you discover
that your cubicle mate wrote the textbook
you used as a primary resource in your first
year of graduate school. Do you:

A) Fawn obsequiously and ask if you
can have an autograph.
B) Sit perfectly still and use only soft
keystrokes to avoid disturbing her
concentration.
C) Leave her daily offerings of granola
and English toffee from the food bins.

D) Quote your favorite formula from the
textbook and explain how it's now
your mantra.
E) Show her how example 17b could
have been solved with 34 fewer lines
of code.
7. Which of the following expresses Google鈻?
over-arching philosophy?

A) "I'm feeling lucky"
B) "Don't be evil"
C) "Oh, I already fixed that"
D) "You should never be more than
50 feet from food"
E) All of the above

8. How many different ways can you color an
icosahedron with one of three colors on
each face?

What colors would you choose?

9. This space left intentionally blank. Please fill it
with something that improves upon emptiness.

10.On an infinite, two-dimensional, rectangular
lattice of 1-ohm resistors, what is the
resistance between two nodes that are a
knight's move away?

11.It's 2 PM on a sunny Sunday afternoon in the
Bay Area. You're minutes from the Pacific
Ocean, redwood forest hiking trails and world
class cultural attractions. What do you do?

12.In your opinion, what is the most beautiful
math equation ever derived?

13. Which of the following is NOT an actual
interest group formed by Google employees?

A. Women's basketball
B. Buffy fans
C. Cricketeers
D. Nobel winners
E. Wine club

14.What will be the next great improvement in
search technology?

15.What is the optimal size of a project team,
above which additional members do not
contribute productivity equivalent to the
percentage increase in the staff size?
A) 1
B) 3
C) 5
D) 11
E) 24

16.Given a triangle ABC, how would you use only
a compass and straight edge to find a point P
such that triangles ABP, ACP and BCP have
equal perimeters? (Assume that ABC is
constructed so that a solution does exist.)

17.Consider a function which, for a given whole
number n, returns the number of ones required
when writing out all numbers between 0 and n.
For example, f(13)=6. Notice that f(1)=1. What
is the next largest n such that f(n)=n?

18.What's the coolest hack you've ever written?

19.'Tis known in refined company, that choosing
K things out of N can be done in ways as
many as choosing N minus K from N: I pick K,
you the remaining.

Find though a cooler bijection, where you show
a knack uncanny, of making your choices contain
all K of mine. Oh, for pedantry: let K be no more
than half N.

20.What number comes next in the sequence:
10, 9, 60, 90, 70, 66,?

A)96
B) 1000000000000000000000000000000000
0000000000000000000000000000000000
000000000000000000000000000000000
C) Either of the above
D) None of the above

21.In 29 words or fewer, describe what you
would strive to accomplish if you worked
at Google Labs.



]]>
鐮磋ВJIRA3.3http://www.tkk7.com/freddychu/archive/2005/11/05/18319.html椋庤惂钀?/dc:creator>椋庤惂钀?/author>Sat, 05 Nov 2005 10:18:00 GMThttp://www.tkk7.com/freddychu/archive/2005/11/05/18319.htmlhttp://www.tkk7.com/freddychu/comments/18319.htmlhttp://www.tkk7.com/freddychu/archive/2005/11/05/18319.html#Feedback22http://www.tkk7.com/freddychu/comments/commentRss/18319.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/18319.html涓嬭澆鍦板潃錛?A >http://www.atlassian.com/software/jira/
鎴戜笅杞界殑鏄疛IRA Enterprise: Evaluation鐗堟湰錛屽悓鏃剁敵璇蜂竴涓?0鐨凩icence銆?BR>鐮磋В姣旇緝綆鍗曪紝鏈夊叧Licence鐨勪唬鐮佸湪atlassian-extras-0.7.10.jar涓?BR>1銆佸弽緙栬瘧鍖呬腑鐨勬枃浠訛細com.atlassian.license.DefaultLicense.class銆傛敼鎴愪笅闈細
// Decompiled by DJ v3.8.8.85 Copyright 2005 Atanas Neshkov  Date: 2005-11-5 17:41:28
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name:   DefaultLicense.java

package com.atlassian.license;

import java.util.*;

// Referenced classes of package com.atlassian.license:
//            License, LicenseType

public class DefaultLicense
    
implements License
{

    
public DefaultLicense(Date dateCreated, Date datePurchased, String organisation, LicenseType licenseType, int users)
    
{
        
this.dateCreated = dateCreated;
        
this.datePurchased = datePurchased;
        
this.organisation = organisation;
        
this.licenseType = licenseType;
        
this.users = users;
    }


    
public Date getDateCreated()
    
{
        
return dateCreated;
    }


    
public Date getDatePurchased()
    
{
        
return datePurchased;
    }


    
public String getOrganisation()
    
{
        
return organisation;
    }


    
public LicenseType getLicenseType()
    
{
        
return licenseType;
    }


    
public String toString()
    
{
        
return licenseType.getNiceName() + " licensed to " + organisation;
    }


    
public boolean isExpired()
    
{
        
return false;

    }


    
public Date getExpiryDate()
    
{
        
return null;
    }


    
public boolean isLicenseLevel(Collection levels)
    
{
        
for(Iterator iterator = levels.iterator(); iterator.hasNext();)
        
{
            String level 
= (String)iterator.next();
            
if(getLicenseType().getDescription().toLowerCase().indexOf(level.toLowerCase()) != -1)
                
return true;
        }


        
return false;
    }


    
public int getUsers()
    
{
        
if(licenseType.requiresUserLimit())
            
return users;
        
else
            
return -1;
    }


    
public static long EVALUATION_PERIOD = 0x9fa52400L;
    
protected Date dateCreated;
    
protected Date datePurchased;
    
protected String organisation;
    
protected LicenseType licenseType;
    
private int users;

}


鍏跺疄灝辮浜嗕袱涓柟娉曪細

    public boolean isExpired()
    
{
        
return false;

    }


    
public Date getExpiryDate()
    
{
        
return null;
    }

2銆佹妸緙栬瘧濂界殑class鏂囦歡澶嶅埗鍒癮tlassian-extras-0.7.10.jar涓紝瑕嗙洊鍘熸潵鏂囦歡銆?BR>3銆佸惎鍔ㄦ湇鍔″櫒錛屾垚鍔熴?BR>鎴戞妸鎴戠牬瑙e悗鐨刢lass闄勪笂錛?A HREF="/Files/freddychu/DefaultLicense.zip">http://www.tkk7.com/Files/freddychu/DefaultLicense.zip銆?BR>濡傛灉涓嶈兘涓嬶紝璇風暀涓媏mail.



]]>
Apache鐨勭綉绔欎笉鑳借闂簡http://www.tkk7.com/freddychu/archive/2005/10/27/17103.html椋庤惂钀?/dc:creator>椋庤惂钀?/author>Thu, 27 Oct 2005 12:30:00 GMThttp://www.tkk7.com/freddychu/archive/2005/10/27/17103.htmlhttp://www.tkk7.com/freddychu/comments/17103.htmlhttp://www.tkk7.com/freddychu/archive/2005/10/27/17103.html#Feedback0http://www.tkk7.com/freddychu/comments/commentRss/17103.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/17103.htmlhttp://www.apache.org/ 璁塊棶涓嶄簡錛屾垜姝e湪鐪媥mlBean鍟娿傞毦閬撴病閽辮緗戠錛熷懙鍛?^_^

]]>
Acegi浣跨敤鎰熷彈http://www.tkk7.com/freddychu/archive/2005/10/27/17014.html椋庤惂钀?/dc:creator>椋庤惂钀?/author>Thu, 27 Oct 2005 04:58:00 GMThttp://www.tkk7.com/freddychu/archive/2005/10/27/17014.htmlhttp://www.tkk7.com/freddychu/comments/17014.htmlhttp://www.tkk7.com/freddychu/archive/2005/10/27/17014.html#Feedback3http://www.tkk7.com/freddychu/comments/commentRss/17014.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/17014.html1銆佽繖涓鏋惰繕闇瑕佷笉鏂畬鍠勶紝鑰屼笖榪欎釜欏圭洰涔熷湪涓嶆柇榪涜涓傛瘮濡傦細鐪嬪埌浠ュ墠鐨勪緥瀛愶紝鐗堟湰鏄?.6鐨勶紝闇瑕佸湪web.xml閲岄厤緗涓猣ilter錛屽埌浜?.8.3錛屽氨鍙閰嶇疆涓涓猣ilter錛屾妸浠ュ墠鐨勫涓猣ilter縐誨埌浜唖pring鐨勯厤緗枃浠朵腑瀹炵幇浜嗐傝繕鏈塽serCache鐨勫疄鐜頒篃鍙樺寲浜嗐?BR>2銆侀厤緗繕鏄湁浜涘鏉傘傚湪spring鐨勯厤緗枃浠墮噷瑕佸啓涓嶅皯bean銆傚弬瑙?鏁村悎鍓嶅彴鎶鏈痑cegi+spring+struts 銆?BR>3銆佸浣曞疄鐜拌鑹茬殑鍔ㄦ佸畾涔夛紝鎴戣繕娌℃壘鍒扮浉鍏沖疄鐜幫紝浼間箮鐩墠涓嶆敮鎸併?BR>4銆佸瓨鏀劇敤鎴蜂俊鎭湪琛╱sers錛屾巿鏉冧俊鎭斁鍦╝uthorities琛ㄣ傚湪鎴戜滑瀹為檯寮鍙戝綋涓線寰榪欎袱涓〃闈炲父澶э紝瀛楁寰堝銆傝繖閲屽氨闇瑕佸仛浜涢傚綋鐨勬墿灞曞挴銆?BR>
榪欎釜妗嗘灦鏁翠綋榪樻槸闈炲父鐏墊椿鐨勶紝鍊煎緱鎴戜滑鍦ㄤ簺杞婚噺綰х殑搴旂敤涓嬌鐢ㄣ?img src ="http://www.tkk7.com/freddychu/aggbug/17014.html" width = "1" height = "1" />

]]>
緇堜簬鎼炲畾Acegihttp://www.tkk7.com/freddychu/archive/2005/10/24/16511.html椋庤惂钀?/dc:creator>椋庤惂钀?/author>Sun, 23 Oct 2005 16:23:00 GMThttp://www.tkk7.com/freddychu/archive/2005/10/24/16511.htmlhttp://www.tkk7.com/freddychu/comments/16511.htmlhttp://www.tkk7.com/freddychu/archive/2005/10/24/16511.html#Feedback2http://www.tkk7.com/freddychu/comments/commentRss/16511.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/16511.html浠婂ぉ鑺變簡涓涓嬪崍鍔犱竴鏅氫笂錛岀粓浜庡仛浜嗕竴涓熀浜嶢cegi鐨勮嚜宸辯殑HelloWorld銆?BR>鎰熻鍦≧DBMS鐨勮璇佹柟寮忕殑鎵╁睍涓婃湁浜涗笉鐏墊椿銆傞粯璁ゆ槸鍩轟簬寮婧愮殑鏁版嵁搴揌SQLDB鐨勶紝瀹炵幇榪欎釜鏈哄埗鐨勬槸JdbcDaoImpl.java綾匯傜湅浜唖ourcecode錛屽彂鐜扮被閲岄潰鍐欐浜嗕袱涓猄QL璇彞錛?BR>    public static final String DEF_USERS_BY_USERNAME_QUERY = "SELECT username,password,enabled FROM users WHERE username = ?";
    public static final String DEF_AUTHORITIES_BY_USERNAME_QUERY = "SELECT username,authority FROM authorities WHERE username = ?";

鐩稿叧浠g爜娌¤繘涓姝ョ湅錛屽彂鐜版湁鍑犱釜Polo綾伙紝濡俇ser.java鍜屼笂闈㈢殑璇彞瀵瑰簲錛屾墍浠ワ紝榪欎釜璇彞鐨勫瓧孌典笉鑳介殢渚挎敼銆侸dbcDaoImpl綾葷殑婧愪唬鐮佸緩璁氳繃緇ф壙鏉ユ墿灞曪紝鎴戣寰椾笉鏄緢濂斤紝搴斾負Sql璇彞鍦ㄧ埗綾婚噷鍐欐浜嗐傚湪瀹為檯搴旂敤涓紝users琛ㄧ粨鏋勬瘮榪欏鏉傜殑澶氥?BR>鎯蟲娊絀猴紝閲嶆柊鍐欎竴涓狫dbcDaoImp綾伙紝鏇挎崲涓涓嬨?img src ="http://www.tkk7.com/freddychu/aggbug/16511.html" width = "1" height = "1" />

]]>
主站蜘蛛池模板: 岛国岛国免费V片在线观看 | 免费观看午夜在线欧差毛片| 久久久久久亚洲精品不卡| 999久久久免费精品国产| 免费萌白酱国产一区二区三区| 精品亚洲国产成人av| 亚洲伊人久久大香线蕉在观| 国产亚洲成av人片在线观看| 亚洲另类少妇17p| 日韩a在线观看免费观看| 在线v片免费观看视频| 久久免费观看国产精品88av| 中文字幕不卡免费高清视频| 三年片在线观看免费观看大全中国| 亚洲中文无码亚洲人成影院| 亚洲激情校园春色| 亚洲视频中文字幕| 亚洲av日韩av不卡在线观看| 国产亚洲精品福利在线无卡一| 亚洲成av人片一区二区三区| 国产免费久久精品| 国产成人青青热久免费精品| 夭天干天天做天天免费看| 丁香花免费完整高清观看 | 亚洲国产美女精品久久| 亚洲欧洲在线观看| 亚洲免费视频在线观看| 亚洲国产女人aaa毛片在线| 国产亚洲综合成人91精品| 国产成人A亚洲精V品无码| 精品国产亚洲男女在线线电影| 亚洲区日韩区无码区| 亚洲精品无码你懂的网站| 久久久亚洲精品蜜桃臀| 久久青青草原亚洲av无码| 亚洲三区在线观看无套内射| 亚洲国产精品一区二区久久hs | 国产精品视频全国免费观看| 国产成人亚洲精品播放器下载 | 美腿丝袜亚洲综合| 亚洲中文字幕无码一区|