Dedian  
          -- 關(guān)注搜索引擎的開發(fā)
          日歷
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345
          統(tǒng)計
          • 隨筆 - 82
          • 文章 - 2
          • 評論 - 228
          • 引用 - 0

          導(dǎo)航

          常用鏈接

          留言簿(8)

          隨筆分類(45)

          隨筆檔案(82)

          文章檔案(2)

          Java Spaces

          搜索

          •  

          積分與排名

          • 積分 - 65924
          • 排名 - 816

          最新評論

          閱讀排行榜

          評論排行榜

           

          GData, Google data API, provides a simple standard protocol for reading and writing data on the web, which supports two common XML-based syndication formats (Atom and RSS).

          Briefly browse the documents and javadoc of GData, I found that it is very similiar to my thought on my current clustering searching engine system, designing an interface of data structure for all the request to searching engine servers, and employing an other interface to handle external/internal requests and fill up the data structure.

          Although my first version of searching engine has been deployed on LiveDigital, I am still working on the new version?with clustering?design. source code has been packaged and implementation document is almost done,?I still hope I can learn something from GData, more professional and structrual design.?

          posted @ 2006-05-16 06:01 Dedian 閱讀(258) | 評論 (0)編輯 收藏
           
          1. Google Blog - googleblog.blogspot.com
          2. Google Talkabout - googletalk.blogspot.com
          3. Google Base Blog - googlebase.blogspot.com
          4. Google Video - googlevideo.blogspot.com
          5. Inside Google Desktop - googledesktop.blogspot.com
          6. Google Code - code.google.com
          7. Inside AdWords - adwords.blogspot.com
          8. Inside AdSense - adsense.blogspot.com
          9. Google Reader Blog - googlereader.blogspot.com
          10. Blogger Buzz - buzz.blogger.com
          11. AdWords API Blog - adwordsapi.blogspot.com
          12. Google Enterprise Blog - googleenterprise.blogspot.com
          13. Google Research - googleresearch.blogspot.com
          14. Google Maps API Blog - googlemapsapi.blogspot.com
          15. Google Writely - writely.blogspot.com
          16. Inside Google Book Search - booksearch.blogspot.com
          posted @ 2006-05-16 03:57 Dedian 閱讀(217) | 評論 (0)編輯 收藏
           
          Purpose:

          To control access to an object, provide a surrogate or placeholder (proxy) for it. As a mostly used strategy, Proxy can defer the creation and initialization of the object until it is on demand.

          Structure:

          Similar to adapter, client includes an object of proxy to access, and proxy includes a real object that proxy represents.

          Difference from Adapter:

          Adapter provides a different interface to the object it adapts. In contrast, Proxy provides the same interface as its subject. As a protection of real object, Proxy can refuse to perform an operation that the subject will perform.

          Example:
          http://www.javaworld.com/javaworld/jw-02-2002/jw-0222-designpatterns.html

          Reference:
          Book: (GoF)Design Patterns
          http://en.wikipedia.org/wiki/Proxy_design_pattern
          http://www.inf.bme.hu/ooret/1999osz/DesignPatterns/Proxy4/
          http://alumni.media.mit.edu/~tpminka/patterns/Proxy.html


          posted @ 2006-05-12 04:10 Dedian 閱讀(285) | 評論 (0)編輯 收藏
           
          Purpose:

          Encapsulate a set of objects which interact with each other. The benefit to do this is keeping objects from communicating with each other directly. All the messages between objects should be sent to mediator at first and then mediator will control and coordinate those interaction. Also, mediator can handle external interaction request and decide which object to response the external request.

          Structure:

          star topology: Mediator class is as a hub which connects to a set of classes (colleague classes).

          Difference from Facade Pattern:

          Facade differs from Mediator in that it abstracts a subsystem of objects to provide a more convenient interface. Its protocol is unidirectional. That is, Facade objects make requests of the subsystem classes but not vice versa. In contrast, Mediator enables cooperative behavior that colleague objects don't or can't provide, and the protocol is multidirectional.

          reference:

          Gamma, E., R. Helm, R. Johnson, J. Vlissides (1995). Design Patterns. Addison Wesley. ISBN 0.201-63361-2
          http://sern.ucalgary.ca/courses/seng/443/W02/assignments/Mediator/
          http://my.execpc.com/~gopalan/design/behavioral/mediator/mediator.html
          posted @ 2006-05-12 03:24 Dedian 閱讀(306) | 評論 (0)編輯 收藏
           
          Just wanna add an additional screen for better working, LCD monitor is my favorite thought, here is good article for purchase guide:

          http://reviews.cnet.com/4520-7610_7-5084364-3.html

          and also I have some interests in ViewSonic type

          http://www.viewsonic.com/products/desktopdisplays/lcddisplays/valueseries/va902b/

          but i am not sure if it is best deal :(. coz PRINCETON also has a not bad deal which is cheaper and with DVI connector...

          still thinking and hunting, should be settled down by this week.
          posted @ 2006-05-11 05:39 Dedian 閱讀(215) | 評論 (2)編輯 收藏
           
          http://www.metanotes.com/
          posted @ 2006-05-06 10:00 Dedian 閱讀(184) | 評論 (0)編輯 收藏
           
          Just installed on my xp machine today, updated with Callisto Discovery Site, seems lots of plugins have been integrated. I'd like to see c++, TPTP, WST?and UML plugin tools in it. But still?don't know how to play?Visual Editor ...can't get rid of crutch thought?from Microsoft kits..
          posted @ 2006-05-05 11:29 Dedian 閱讀(249) | 評論 (0)編輯 收藏
           
          問:
          都是撞車而死,J2EE程序員與.Net程序員有什么區(qū)別?

          答:
          J2EE程序員死前有剎車的痕跡----一種打破常規(guī)的操作。
          posted @ 2006-05-05 11:19 Dedian 閱讀(402) | 評論 (1)編輯 收藏
           
          虛無主義者是這樣一種人,對于如其所是地存在的世界,他斷定它不應(yīng)當存在;對于如其應(yīng)是地存在的世界,他斷定它并不實存。

          --摘自朋友的Blog

          這個說的比較抽象,俺翻譯如下,不知是否達意:

          if exists(A)
          {
          ?????Assert(!A.bExisting);
          }
          else if(A != null && A.bExisting)
          {
          ???? Assert(!exists(A));
          }

          ?


          posted @ 2006-05-04 13:34 Dedian 閱讀(319) | 評論 (0)編輯 收藏
           
          1. Design your own Exception hierarchy to handle all categories of potential errors in your system
          2. extend Exception class for your throwable error-handled classes
          3. Throw your defined exception classes in your code block in necessary
          4. Embed error information in your defined exception
          5. if you develop with new Java, be noticed that Exception implements serializable interface, you need define a static final variable for serial version UID, otherwise, warn message will be given by new compiler.

          here is a good article to talk about this issue.
          posted @ 2006-05-03 06:58 Dedian 閱讀(212) | 評論 (0)編輯 收藏
           
          1. put every class in certain packages, including those test classes, not like to use Default package
          2. generate .Jar file including thoes packages.
          3. write script files (*.sh) to run certain test java classes in .Jar in same folder as my .Jar file and set CLASSPATH in my script files
          ex:
          export CLASSPATH=$CLASSPATH:com.mycompany.util-1.0.0.jar
          java com.mycompany.util.TestClass
          4. then run the script file...

          or, we can use command line like this: java -classpath *.jar ..TestClass

          Note: be sure to use complete path for testing classes, otherwise famours NoClassDefFound error will be thrown out.
          posted @ 2006-05-02 05:15 Dedian 閱讀(251) | 評論 (0)編輯 收藏
           
          1. String --> InputStream

          InputStream convertToInputStream(String str)
          {
          ??? ??? ByteArrayInputStream is = new ByteArrayInputStream(str.getBytes());
          ??????? return is;
          }

          2. InputStream --> String
          ????
          String convertToString(InputStream is)
          {
          ??? ??
          ?????? BufferedReader in = new BufferedReader(new InputStreamReader(is));
          ??? ??? StringBuffer buffer = new StringBuffer();
          ??? ??? String line = "";
          ??? ??? while ((line = in.readLine()) != null)
          ??? ??? {
          ???? ??? ??? buffer.append(line);
          ???? ??? }
          ???? ??? return buffer.toString();
          ??? ??? ???
          }

          When I do the socket programming, I always need to deal with inputstream and string, above are the basic ways to so that, but I am not sure if there are any simpler ways to do that...

          posted @ 2006-04-29 05:17 Dedian 閱讀(630) | 評論 (3)編輯 收藏
           

          To configure a persistent CLASSPATH under Windows XP:

          1. Click the Start Button
          2. Select the Control Panel
          3. Click Switch to Classic View
          4. Click the System button
          5. Select the Advanced tab
          6. Click the Environment Variables button
          7. Click the New button to create a CLASSPATH or the Edit button to edit an existing CLASSPATH
          8. Enter CLASSPATH as the variable name
          9. Enter the list of directories or jar files in your CLASSPATH as the variable value, using a semicolon to separate entries in your list
          10. Click OK
          11. Click OK
          12. Click OK
          posted @ 2006-04-28 03:05 Dedian 閱讀(291) | 評論 (3)編輯 收藏
           
          It is common problem of convertion between int & string for certian computer language. Well, in Java, following are some easy ways I usually apply:

          1. int --> String
          ??? a. apply "+" operation with an empty string
          ??? ?? ?? ex:
          ??? ?? ?? int index = 20;
          ??? ?? ?? String indexStr = "" + index;
          ??? b. use String function
          ??? ?? ?? ex:
          ??? ?? ?? int index = 20;
          ??? ?? ?? String indexStr = String.valueOf(index);
          ??? c. convert to Integer class firstly
          ??? ?? ?? ex:
          ??? ?? ?? int index = 20;
          ??? ?? ?? Integer Index = new Integer(index);
          ??? ?? ?? String indexStr = Index.toString();
          ??? ?? ?? or
          ??? ?? ?? String indexStr = Integer.toString(index);

          2. String --> int
          ??? a. use class Integer parse funtion
          ??? ?? ex:
          ??? ?? String indexStr = "20";
          ??? ?? int index = Integer.parseInt(indexStr);
          ??? ?? or
          ??? ?? int index = (new Integer(indexStr)).intValue();

          note: above convertion methods can be applied to other number types, such as float, long, double...

          P.S. for 1.a method, should be noticed that following two expression are different:
          int i = 7;
          int j = 8;

          String str1 = i + j + ""; //(str1 == "15")
          String str2 = "" + i + j; //(str2 == "78")
          ?
          posted @ 2006-04-25 09:22 Dedian 閱讀(739) | 評論 (0)編輯 收藏
           
          purpose:

          Make your code robust and protect your code from invalid data, events or other unexpectable impact.

          good habits:

          -- Handle for invalid inputs (data from external sources, routine input parameters)
          ??? a. garbage in, nothing out
          ??? b. garbage in, error message out
          ??? c. no garbage allowed in

          -- Build your own assert machanism (for debugging purpose)
          ??? a. avoid putting executable code into assertion (otherwise will miss some execution code when releasing)
          ???
          -- Error-Handling Techniques
          ??? a. return a neutral/closest value
          ??? b. skip to next valid data
          ??? c. return last valid data
          ??? d. Log a warning message to a file (Log file)
          ??? e. Return a defined error code (Throw an exception)
          ??? f. call an error-processing routine/object
          ??? g. display an error message (System.out.print)
          ??? h. shut down

          -- tips for Exception mechanism
          ??? a. avoid throwing exceptions in constructors and destrictors unless you catch them in the same place.
          ??? b. throw exceptions at the right level of abstraction
          ??? c. avoid empty catch blocks
          ??? d. consider creating your own project-specific exception class, which can serve as the base class for all exceptions thrown on your project. This supports centralizing and standardizing logging, error reporting and so on.

          -- Damage-containment strategy: Barricade your program (add a firewall layer for your code which maybe contains Assertions and Error-handlers)

          -- Debugging Aids
          ??? a. use offensive programming to notify yourself the potential errors
          ??? b. handle exception cases in a way that makes them obvious during development and recoverable when production code is running.
          ??? c. use version-control tools and build tools like ant and make


          posted @ 2006-04-22 05:40 Dedian 閱讀(154) | 評論 (0)編輯 收藏
          僅列出標題
          共6頁: 上一頁 1 2 3 4 5 6 下一頁 
           
          Copyright © Dedian Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 台北县| 宾川县| 万山特区| 珠海市| 孝义市| 江达县| 彝良县| 仙桃市| 邛崃市| 潞城市| 泰安市| 河津市| 甘谷县| 葵青区| 广德县| 韶山市| 丽水市| 广汉市| 渝北区| 武胜县| 岑巩县| 读书| 大方县| 新沂市| 牙克石市| 屏南县| 沭阳县| 嵩明县| 阳泉市| 新田县| 怀柔区| 肃北| 红安县| 昌吉市| 永新县| 呼和浩特市| 三江| 松滋市| 溧阳市| 商丘市| 临夏市|